Em Mon, Jun 27, 2016 at 10:21:10AM +0800, Hekuang escreveu: > 在 2016/6/27 5:08, Nilay Vaish 写道: > > On 26 June 2016 at 06:20, He Kuang <heku...@huawei.com> wrote: > > > From: Wang Nan <wangn...@huawei.com> > > > This patch copies "include/linux/math64.h" into > > > "tools/include/linux/math64.h" and copies > > > "include/asm-generic/div64.h" into > > > "tools/include/asm-generic/div64.h", to enable other libraries use > > > arithmetic operation defined in them. > > This probably is a newbie question. What prevents us from using the > > header files directly? > For not being influenced by kernel headers update too much, perf adopts > the header files in its own folder.
yeah, we used to include them directly, but then, changes in the kernel sometimes broke the tools/ build, so we instead copy it and check for changes using diff as part of the build process, flagging changes, like the one I'm investigating now: [acme@jouet linux]$ diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl --- tools/perf/arch/x86/entry/syscalls/syscall_64.tbl 2016-06-06 11:06:31.423335774 -0300 +++ arch/x86/entry/syscalls/syscall_64.tbl 2016-06-06 11:06:30.511345336 -0300 @@ -374,3 +374,5 @@ 543 x32 io_setup compat_sys_io_setup 544 x32 io_submit compat_sys_io_submit 545 x32 execveat compat_sys_execveat/ptregs +534 x32 preadv2 compat_sys_preadv2 +535 x32 pwritev2 compat_sys_pwritev2 [acme@jouet linux]$ Flagged in the build process: <SNIP> ... get_cpuid: [ on ] ... bpf: [ on ] GEN /tmp/build/perf/common-cmds.h Warning: x86_64's syscall_64.tbl differs from kernel CC /tmp/build/perf/fixdep.o LD /tmp/build/perf/fixdep-in <SNIP> - Arnaldo