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>
This commit is contained in:
Ingo Molnar 2008-11-12 13:17:38 +01:00
Родитель f88c4ae9f8
Коммит 2b7d0390a6
3 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -17,13 +17,8 @@
* want per guest time just set the kernel.vsyscall64 sysctl to 0. * want per guest time just set the kernel.vsyscall64 sysctl to 0.
*/ */
/* Protect userspace from profiling */ /* Disable profiling for userspace code: */
#ifdef CONFIG_TRACE_UNLIKELY_PROFILE #define DISABLE_UNLIKELY_PROFILE
# undef likely
# undef unlikely
# define likely(x) likely_notrace(x)
# define unlikely(x) unlikely_notrace(x)
#endif
#include <linux/time.h> #include <linux/time.h>
#include <linux/init.h> #include <linux/init.h>

Просмотреть файл

@ -9,6 +9,9 @@
* Also alternative() doesn't work. * Also alternative() doesn't work.
*/ */
/* Disable profiling for userspace code: */
#define DISABLE_UNLIKELY_PROFILE
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/posix-timers.h> #include <linux/posix-timers.h>
#include <linux/time.h> #include <linux/time.h>

Просмотреть файл

@ -59,7 +59,11 @@ extern void __chk_io_ptr(const volatile void __iomem *);
* specific implementations come from the above header files * specific implementations come from the above header files
*/ */
#ifdef CONFIG_TRACE_UNLIKELY_PROFILE /*
* Note: DISABLE_UNLIKELY_PROFILE can be used by special lowlevel code
* to disable branch tracing on a per file basis.
*/
#if defined(CONFIG_TRACE_UNLIKELY_PROFILE) && !defined(DISABLE_UNLIKELY_PROFILE)
struct ftrace_likely_data { struct ftrace_likely_data {
const char *func; const char *func;
const char *file; const char *file;