diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-11-12 07:17:38 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-12 07:26:38 -0500 |
commit | 2b7d0390a6d6d595f43ea3806639664afe5b9ebe (patch) | |
tree | 661cd33467685dd268e35d7e4dc1dbf2aa83d994 | |
parent | f88c4ae9f8c3939bee4337c75c7a673b5de7a8a7 (diff) |
tracing: branch tracer, fix vdso crash
Impact: fix bootup crash
the branch tracer missed arch/x86/vdso/vclock_gettime.c from
disabling tracing, which caused such bootup crashes:
[ 201.840097] init[1]: segfault at 7fffed3fe7c0 ip 00007fffed3fea2e sp 000077
also clean up the ugly ifdefs in arch/x86/kernel/vsyscall_64.c by
creating DISABLE_UNLIKELY_PROFILE facility for code to turn off
instrumentation on a per file basis.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/vsyscall_64.c | 9 | ||||
-rw-r--r-- | arch/x86/vdso/vclock_gettime.c | 3 | ||||
-rw-r--r-- | include/linux/compiler.h | 6 |
3 files changed, 10 insertions, 8 deletions
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c index 2f90202e59b3..ece02932ea57 100644 --- a/arch/x86/kernel/vsyscall_64.c +++ b/arch/x86/kernel/vsyscall_64.c | |||
@@ -17,13 +17,8 @@ | |||
17 | * want per guest time just set the kernel.vsyscall64 sysctl to 0. | 17 | * want per guest time just set the kernel.vsyscall64 sysctl to 0. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | /* Protect userspace from profiling */ | 20 | /* Disable profiling for userspace code: */ |
21 | #ifdef CONFIG_TRACE_UNLIKELY_PROFILE | 21 | #define DISABLE_UNLIKELY_PROFILE |
22 | # undef likely | ||
23 | # undef unlikely | ||
24 | # define likely(x) likely_notrace(x) | ||
25 | # define unlikely(x) unlikely_notrace(x) | ||
26 | #endif | ||
27 | 22 | ||
28 | #include <linux/time.h> | 23 | #include <linux/time.h> |
29 | #include <linux/init.h> | 24 | #include <linux/init.h> |
diff --git a/arch/x86/vdso/vclock_gettime.c b/arch/x86/vdso/vclock_gettime.c index 1ef0f90813d6..6e667631e7dc 100644 --- a/arch/x86/vdso/vclock_gettime.c +++ b/arch/x86/vdso/vclock_gettime.c | |||
@@ -9,6 +9,9 @@ | |||
9 | * Also alternative() doesn't work. | 9 | * Also alternative() doesn't work. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | /* Disable profiling for userspace code: */ | ||
13 | #define DISABLE_UNLIKELY_PROFILE | ||
14 | |||
12 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
13 | #include <linux/posix-timers.h> | 16 | #include <linux/posix-timers.h> |
14 | #include <linux/time.h> | 17 | #include <linux/time.h> |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 935e30cfaf3c..63b7d9089d6e 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -59,7 +59,11 @@ extern void __chk_io_ptr(const volatile void __iomem *); | |||
59 | * specific implementations come from the above header files | 59 | * specific implementations come from the above header files |
60 | */ | 60 | */ |
61 | 61 | ||
62 | #ifdef CONFIG_TRACE_UNLIKELY_PROFILE | 62 | /* |
63 | * Note: DISABLE_UNLIKELY_PROFILE can be used by special lowlevel code | ||
64 | * to disable branch tracing on a per file basis. | ||
65 | */ | ||
66 | #if defined(CONFIG_TRACE_UNLIKELY_PROFILE) && !defined(DISABLE_UNLIKELY_PROFILE) | ||
63 | struct ftrace_likely_data { | 67 | struct ftrace_likely_data { |
64 | const char *func; | 68 | const char *func; |
65 | const char *file; | 69 | const char *file; |