diff options
author | David Howells <dhowells@redhat.com> | 2012-11-19 17:21:03 -0500 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2012-11-19 17:21:03 -0500 |
commit | d2709c7ce4c513ab7f4ca9a106a930621811f2d3 (patch) | |
tree | da6e14e27b02b2d234aad0eb1ccf5bbfa06d0cb8 /tools/perf/perf.h | |
parent | f2d9cae9ea9e0228f6eb4d4c5ab4f548d0270d1a (diff) |
perf: Make perf build for x86 with UAPI disintegration applied
Make perf build for x86 once the UAPI disintegration patches for that arch
have been applied by adding the appropriate -I flags - in the right order -
and then converting some #includes that use ../.. notation to find main kernel
headerfiles to use <asm/foo.h> and <linux/foo.h> instead.
Note that -Iarch/foo/include/uapi is present _before_ -Iarch/foo/include.
This makes sure we get the userspace version of the pt_regs struct. Ideally,
we wouldn't have the latter -I flag at all, but unfortunately we want
asm/svm.h and asm/vmx.h in builtin-kvm.c and these aren't part of the UAPI -
at least not for x86. I wonder if the bits outside of the __KERNEL__ guards
*should* be transferred there.
I note also that perf seems to do its dependency handling manually by listing
all the header files it might want to use in LIB_H in the Makefile. Can this
be changed to use -MD?
Note that to do make this work, we need to export and UAPI disintegrate
linux/hw_breakpoint.h, which I think should've been exported previously so that
perf can access the bits. We have to do this in the same patch to maintain
bisectability.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'tools/perf/perf.h')
-rw-r--r-- | tools/perf/perf.h | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/tools/perf/perf.h b/tools/perf/perf.h index e2ba8f004d32..238f923f2218 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h | |||
@@ -5,8 +5,9 @@ struct winsize; | |||
5 | 5 | ||
6 | void get_term_dimensions(struct winsize *ws); | 6 | void get_term_dimensions(struct winsize *ws); |
7 | 7 | ||
8 | #include <asm/unistd.h> | ||
9 | |||
8 | #if defined(__i386__) | 10 | #if defined(__i386__) |
9 | #include "../../arch/x86/include/asm/unistd.h" | ||
10 | #define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory") | 11 | #define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory") |
11 | #define cpu_relax() asm volatile("rep; nop" ::: "memory"); | 12 | #define cpu_relax() asm volatile("rep; nop" ::: "memory"); |
12 | #define CPUINFO_PROC "model name" | 13 | #define CPUINFO_PROC "model name" |
@@ -16,7 +17,6 @@ void get_term_dimensions(struct winsize *ws); | |||
16 | #endif | 17 | #endif |
17 | 18 | ||
18 | #if defined(__x86_64__) | 19 | #if defined(__x86_64__) |
19 | #include "../../arch/x86/include/asm/unistd.h" | ||
20 | #define rmb() asm volatile("lfence" ::: "memory") | 20 | #define rmb() asm volatile("lfence" ::: "memory") |
21 | #define cpu_relax() asm volatile("rep; nop" ::: "memory"); | 21 | #define cpu_relax() asm volatile("rep; nop" ::: "memory"); |
22 | #define CPUINFO_PROC "model name" | 22 | #define CPUINFO_PROC "model name" |
@@ -26,20 +26,17 @@ void get_term_dimensions(struct winsize *ws); | |||
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #ifdef __powerpc__ | 28 | #ifdef __powerpc__ |
29 | #include "../../arch/powerpc/include/uapi/asm/unistd.h" | ||
30 | #define rmb() asm volatile ("sync" ::: "memory") | 29 | #define rmb() asm volatile ("sync" ::: "memory") |
31 | #define cpu_relax() asm volatile ("" ::: "memory"); | 30 | #define cpu_relax() asm volatile ("" ::: "memory"); |
32 | #define CPUINFO_PROC "cpu" | 31 | #define CPUINFO_PROC "cpu" |
33 | #endif | 32 | #endif |
34 | 33 | ||
35 | #ifdef __s390__ | 34 | #ifdef __s390__ |
36 | #include "../../arch/s390/include/asm/unistd.h" | ||
37 | #define rmb() asm volatile("bcr 15,0" ::: "memory") | 35 | #define rmb() asm volatile("bcr 15,0" ::: "memory") |
38 | #define cpu_relax() asm volatile("" ::: "memory"); | 36 | #define cpu_relax() asm volatile("" ::: "memory"); |
39 | #endif | 37 | #endif |
40 | 38 | ||
41 | #ifdef __sh__ | 39 | #ifdef __sh__ |
42 | #include "../../arch/sh/include/asm/unistd.h" | ||
43 | #if defined(__SH4A__) || defined(__SH5__) | 40 | #if defined(__SH4A__) || defined(__SH5__) |
44 | # define rmb() asm volatile("synco" ::: "memory") | 41 | # define rmb() asm volatile("synco" ::: "memory") |
45 | #else | 42 | #else |
@@ -50,35 +47,30 @@ void get_term_dimensions(struct winsize *ws); | |||
50 | #endif | 47 | #endif |
51 | 48 | ||
52 | #ifdef __hppa__ | 49 | #ifdef __hppa__ |
53 | #include "../../arch/parisc/include/asm/unistd.h" | ||
54 | #define rmb() asm volatile("" ::: "memory") | 50 | #define rmb() asm volatile("" ::: "memory") |
55 | #define cpu_relax() asm volatile("" ::: "memory"); | 51 | #define cpu_relax() asm volatile("" ::: "memory"); |
56 | #define CPUINFO_PROC "cpu" | 52 | #define CPUINFO_PROC "cpu" |
57 | #endif | 53 | #endif |
58 | 54 | ||
59 | #ifdef __sparc__ | 55 | #ifdef __sparc__ |
60 | #include "../../arch/sparc/include/uapi/asm/unistd.h" | ||
61 | #define rmb() asm volatile("":::"memory") | 56 | #define rmb() asm volatile("":::"memory") |
62 | #define cpu_relax() asm volatile("":::"memory") | 57 | #define cpu_relax() asm volatile("":::"memory") |
63 | #define CPUINFO_PROC "cpu" | 58 | #define CPUINFO_PROC "cpu" |
64 | #endif | 59 | #endif |
65 | 60 | ||
66 | #ifdef __alpha__ | 61 | #ifdef __alpha__ |
67 | #include "../../arch/alpha/include/asm/unistd.h" | ||
68 | #define rmb() asm volatile("mb" ::: "memory") | 62 | #define rmb() asm volatile("mb" ::: "memory") |
69 | #define cpu_relax() asm volatile("" ::: "memory") | 63 | #define cpu_relax() asm volatile("" ::: "memory") |
70 | #define CPUINFO_PROC "cpu model" | 64 | #define CPUINFO_PROC "cpu model" |
71 | #endif | 65 | #endif |
72 | 66 | ||
73 | #ifdef __ia64__ | 67 | #ifdef __ia64__ |
74 | #include "../../arch/ia64/include/asm/unistd.h" | ||
75 | #define rmb() asm volatile ("mf" ::: "memory") | 68 | #define rmb() asm volatile ("mf" ::: "memory") |
76 | #define cpu_relax() asm volatile ("hint @pause" ::: "memory") | 69 | #define cpu_relax() asm volatile ("hint @pause" ::: "memory") |
77 | #define CPUINFO_PROC "model name" | 70 | #define CPUINFO_PROC "model name" |
78 | #endif | 71 | #endif |
79 | 72 | ||
80 | #ifdef __arm__ | 73 | #ifdef __arm__ |
81 | #include "../../arch/arm/include/asm/unistd.h" | ||
82 | /* | 74 | /* |
83 | * Use the __kuser_memory_barrier helper in the CPU helper page. See | 75 | * Use the __kuser_memory_barrier helper in the CPU helper page. See |
84 | * arch/arm/kernel/entry-armv.S in the kernel source for details. | 76 | * arch/arm/kernel/entry-armv.S in the kernel source for details. |
@@ -89,13 +81,11 @@ void get_term_dimensions(struct winsize *ws); | |||
89 | #endif | 81 | #endif |
90 | 82 | ||
91 | #ifdef __aarch64__ | 83 | #ifdef __aarch64__ |
92 | #include "../../arch/arm64/include/asm/unistd.h" | ||
93 | #define rmb() asm volatile("dmb ld" ::: "memory") | 84 | #define rmb() asm volatile("dmb ld" ::: "memory") |
94 | #define cpu_relax() asm volatile("yield" ::: "memory") | 85 | #define cpu_relax() asm volatile("yield" ::: "memory") |
95 | #endif | 86 | #endif |
96 | 87 | ||
97 | #ifdef __mips__ | 88 | #ifdef __mips__ |
98 | #include "../../arch/mips/include/asm/unistd.h" | ||
99 | #define rmb() asm volatile( \ | 89 | #define rmb() asm volatile( \ |
100 | ".set mips2\n\t" \ | 90 | ".set mips2\n\t" \ |
101 | "sync\n\t" \ | 91 | "sync\n\t" \ |
@@ -112,7 +102,7 @@ void get_term_dimensions(struct winsize *ws); | |||
112 | #include <sys/types.h> | 102 | #include <sys/types.h> |
113 | #include <sys/syscall.h> | 103 | #include <sys/syscall.h> |
114 | 104 | ||
115 | #include "../../include/uapi/linux/perf_event.h" | 105 | #include <linux/perf_event.h> |
116 | #include "util/types.h" | 106 | #include "util/types.h" |
117 | #include <stdbool.h> | 107 | #include <stdbool.h> |
118 | 108 | ||