Skip to contentSkip to conversation

perf tools: Move syscall number fallbacks from perf-sys.h to tools/arch/x86/include/asm/

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jul 13, 2016 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  cec07f53c398f22576df77052c4777dc13f14962
Gitweb:     http://git.kernel.org/tip/cec07f53c398f22576df77052c4777dc13f14962
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Thu, 7 Jul 2016 18:28:43 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 12 Jul 2016 15:19:54 -0300

perf tools: Move syscall number fallbacks from perf-sys.h to tools/arch/x86/include/asm/

And remove the empty tools/arch/x86/include/asm/unistd_{32,64}.h files introduced by eae7a755ee81 ("perf tools, x86: Build perf on older user-space as well").

This way we get closer to mirroring the kernel for cases where __NR_ can't be found for some include path/_GNU_SOURCE/whatever scenario.

---
 tools/arch/x86/include/asm/unistd_32.h  |  9 +++++++++
 tools/arch/x86/include/asm/unistd_64.h  |  9 +++++++++
 tools/perf/config/Makefile              |  1 +
 tools/perf/perf-sys.h                   | 18 ------------------
 tools/perf/util/include/asm/unistd_32.h |  1 -
 tools/perf/util/include/asm/unistd_64.h |  1 -
 6 files changed, 19 insertions(+), 20 deletions(-)
tools/arch/x86/include/asm/unistd_32.h new file +9 -0
new file mode 100644
index 0000000..cf33ab0
@@ -0,0 +1,9 @@
+#ifndef __NR_perf_event_open
+# define __NR_perf_event_open 336
+#endif
+#ifndef __NR_futex
+# define __NR_futex 240
+#endif
+#ifndef __NR_gettid
+# define __NR_gettid 224
+#endif
tools/arch/x86/include/asm/unistd_64.h new file +9 -0
new file mode 100644
index 0000000..2c98356
@@ -0,0 +1,9 @@
+#ifndef __NR_perf_event_open
+# define __NR_perf_event_open 298
+#endif
+#ifndef __NR_futex
+# define __NR_futex 202
+#endif
+#ifndef __NR_gettid
+# define __NR_gettid 186
+#endif
tools/perf/config/Makefile +1 -0
index c7e269a..7d2ea69 100644
@@ -209,6 +209,7 @@ CFLAGS += -I$(src-perf)/arch/$(ARCH)/include
 CFLAGS += -I$(srctree)/tools/include/
 CFLAGS += -I$(srctree)/arch/$(ARCH)/include/uapi
 CFLAGS += -I$(srctree)/arch/$(ARCH)/include
+CFLAGS += -I$(srctree)/tools/arch/$(ARCH)/include
 CFLAGS += -I$(srctree)/include/uapi
 CFLAGS += -I$(srctree)/include
 
tools/perf/perf-sys.h +0 -18
index 83a25ce..5cee8a3 100644
@@ -11,29 +11,11 @@
 #if defined(__i386__)
 #define cpu_relax()	asm volatile("rep; nop" ::: "memory");
 #define CPUINFO_PROC	{"model name"}
-#ifndef __NR_perf_event_open
-# define __NR_perf_event_open 336
-#endif
-#ifndef __NR_futex
-# define __NR_futex 240
-#endif
-#ifndef __NR_gettid
-# define __NR_gettid 224
-#endif
 #endif
 
 #if defined(__x86_64__)
 #define cpu_relax()	asm volatile("rep; nop" ::: "memory");
 #define CPUINFO_PROC	{"model name"}
-#ifndef __NR_perf_event_open
-# define __NR_perf_event_open 298
-#endif
-#ifndef __NR_futex
-# define __NR_futex 202
-#endif
-#ifndef __NR_gettid
-# define __NR_gettid 186
-#endif
 #endif
 
 #ifdef __powerpc__
tools/perf/util/include/asm/unistd_32.h deleted +0 -1
deleted file mode 100644
index 8b13789..0000000
@@ -1 +0,0 @@
-
tools/perf/util/include/asm/unistd_64.h deleted +0 -1
deleted file mode 100644
index 8b13789..0000000
@@ -1 +0,0 @@
-