1 From cec07f53c398f22576df77052c4777dc13f14962 Mon Sep 17 00:00:00 2001
2 From: Arnaldo Carvalho de Melo <acme@redhat.com>
3 Date: Thu, 7 Jul 2016 18:28:43 -0300
4 Subject: perf tools: Move syscall number fallbacks from perf-sys.h to tools/arch/x86/include/asm/
6 From: Arnaldo Carvalho de Melo <acme@redhat.com>
8 commit cec07f53c398f22576df77052c4777dc13f14962 upstream.
10 And remove the empty tools/arch/x86/include/asm/unistd_{32,64}.h files
11 introduced by eae7a755ee81 ("perf tools, x86: Build perf on older
14 This way we get closer to mirroring the kernel for cases where __NR_
15 can't be found for some include path/_GNU_SOURCE/whatever scenario.
17 Cc: Adrian Hunter <adrian.hunter@intel.com>
18 Cc: David Ahern <dsahern@gmail.com>
19 Cc: Jiri Olsa <jolsa@kernel.org>
20 Cc: Namhyung Kim <namhyung@kernel.org>
21 Cc: Wang Nan <wangnan0@huawei.com>
22 Link: http://lkml.kernel.org/n/tip-kpj6m3mbjw82kg6krk2z529e@git.kernel.org
23 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
24 Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
25 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
28 tools/arch/x86/include/asm/unistd_32.h | 9 +++++++++
29 tools/arch/x86/include/asm/unistd_64.h | 9 +++++++++
30 tools/perf/config/Makefile | 1 +
31 tools/perf/perf-sys.h | 18 ------------------
32 tools/perf/util/include/asm/unistd_32.h | 1 -
33 tools/perf/util/include/asm/unistd_64.h | 1 -
34 6 files changed, 19 insertions(+), 20 deletions(-)
37 +++ b/tools/arch/x86/include/asm/unistd_32.h
39 +#ifndef __NR_perf_event_open
40 +# define __NR_perf_event_open 336
43 +# define __NR_futex 240
46 +# define __NR_gettid 224
49 +++ b/tools/arch/x86/include/asm/unistd_64.h
51 +#ifndef __NR_perf_event_open
52 +# define __NR_perf_event_open 298
55 +# define __NR_futex 202
58 +# define __NR_gettid 186
60 --- a/tools/perf/config/Makefile
61 +++ b/tools/perf/config/Makefile
62 @@ -200,6 +200,7 @@ CFLAGS += -I$(src-perf)/arch/$(ARCH)/inc
63 CFLAGS += -I$(srctree)/tools/include/
64 CFLAGS += -I$(srctree)/arch/$(ARCH)/include/uapi
65 CFLAGS += -I$(srctree)/arch/$(ARCH)/include
66 +CFLAGS += -I$(srctree)/tools/arch/$(ARCH)/include
67 CFLAGS += -I$(srctree)/include/uapi
68 CFLAGS += -I$(srctree)/include
70 --- a/tools/perf/perf-sys.h
71 +++ b/tools/perf/perf-sys.h
74 #define cpu_relax() asm volatile("rep; nop" ::: "memory");
75 #define CPUINFO_PROC {"model name"}
76 -#ifndef __NR_perf_event_open
77 -# define __NR_perf_event_open 336
80 -# define __NR_futex 240
83 -# define __NR_gettid 224
87 #if defined(__x86_64__)
88 #define cpu_relax() asm volatile("rep; nop" ::: "memory");
89 #define CPUINFO_PROC {"model name"}
90 -#ifndef __NR_perf_event_open
91 -# define __NR_perf_event_open 298
94 -# define __NR_futex 202
97 -# define __NR_gettid 186
102 --- a/tools/perf/util/include/asm/unistd_32.h
106 --- a/tools/perf/util/include/asm/unistd_64.h