diff options
-rw-r--r-- | arch/x86/Kconfig | 2 | ||||
-rw-r--r-- | arch/x86/kernel/ftrace.c | 21 |
2 files changed, 2 insertions, 21 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index a6be725cb049..2cf7bbcaed4e 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -34,7 +34,7 @@ config X86 | |||
34 | select HAVE_FUNCTION_TRACER | 34 | select HAVE_FUNCTION_TRACER |
35 | select HAVE_FUNCTION_GRAPH_TRACER | 35 | select HAVE_FUNCTION_GRAPH_TRACER |
36 | select HAVE_FUNCTION_TRACE_MCOUNT_TEST | 36 | select HAVE_FUNCTION_TRACE_MCOUNT_TEST |
37 | select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE || FUNCTION_GRAPH_TRACER | 37 | select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE |
38 | select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64) | 38 | select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64) |
39 | select HAVE_ARCH_KGDB if !X86_VOYAGER | 39 | select HAVE_ARCH_KGDB if !X86_VOYAGER |
40 | select HAVE_ARCH_TRACEHOOK | 40 | select HAVE_ARCH_TRACEHOOK |
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index e3fad2ef622c..918073c6681b 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c | |||
@@ -367,25 +367,6 @@ int ftrace_disable_ftrace_graph_caller(void) | |||
367 | return ftrace_mod_jmp(ip, old_offset, new_offset); | 367 | return ftrace_mod_jmp(ip, old_offset, new_offset); |
368 | } | 368 | } |
369 | 369 | ||
370 | #else /* CONFIG_DYNAMIC_FTRACE */ | ||
371 | |||
372 | /* | ||
373 | * These functions are picked from those used on | ||
374 | * this page for dynamic ftrace. They have been | ||
375 | * simplified to ignore all traces in NMI context. | ||
376 | */ | ||
377 | static atomic_t nmi_running; | ||
378 | |||
379 | void arch_ftrace_nmi_enter(void) | ||
380 | { | ||
381 | atomic_inc(&nmi_running); | ||
382 | } | ||
383 | |||
384 | void arch_ftrace_nmi_exit(void) | ||
385 | { | ||
386 | atomic_dec(&nmi_running); | ||
387 | } | ||
388 | |||
389 | #endif /* !CONFIG_DYNAMIC_FTRACE */ | 370 | #endif /* !CONFIG_DYNAMIC_FTRACE */ |
390 | 371 | ||
391 | /* Add a function return address to the trace stack on thread info.*/ | 372 | /* Add a function return address to the trace stack on thread info.*/ |
@@ -475,7 +456,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) | |||
475 | &return_to_handler; | 456 | &return_to_handler; |
476 | 457 | ||
477 | /* Nmi's are currently unsupported */ | 458 | /* Nmi's are currently unsupported */ |
478 | if (unlikely(atomic_read(&nmi_running))) | 459 | if (unlikely(in_nmi())) |
479 | return; | 460 | return; |
480 | 461 | ||
481 | if (unlikely(atomic_read(¤t->tracing_graph_pause))) | 462 | if (unlikely(atomic_read(¤t->tracing_graph_pause))) |