]> Git Repo - linux.git/commitdiff
ftrace: only trace preempt off with preempt tracer
authorSteven Rostedt <[email protected]>
Tue, 15 Jul 2008 13:53:37 +0000 (09:53 -0400)
committerIngo Molnar <[email protected]>
Fri, 18 Jul 2008 16:57:34 +0000 (18:57 +0200)
When PREEMPT_TRACER and IRQSOFF_TRACER are both configured and irqsoff
tracer is running, the preempt_off sections might also be traced.

Thanks to Andrew Morton for pointing out my mistake of spin_lock disabling
interrupts while he was reviewing ftrace.txt. Seems that my example I used
actually hit this bug.

Signed-off-by: Steven Rostedt <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
kernel/trace/trace_irqsoff.c

index 421d6fe3650eded0e30ed86105de823c344beb3d..b1e4a89b08eb5bf7118e33be5cb27939dd600691 100644 (file)
@@ -337,12 +337,14 @@ EXPORT_SYMBOL(trace_hardirqs_off_caller);
 #ifdef CONFIG_PREEMPT_TRACER
 void trace_preempt_on(unsigned long a0, unsigned long a1)
 {
-       stop_critical_timing(a0, a1);
+       if (preempt_trace())
+               stop_critical_timing(a0, a1);
 }
 
 void trace_preempt_off(unsigned long a0, unsigned long a1)
 {
-       start_critical_timing(a0, a1);
+       if (preempt_trace())
+               start_critical_timing(a0, a1);
 }
 #endif /* CONFIG_PREEMPT_TRACER */
 
This page took 0.055999 seconds and 4 git commands to generate.