aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2008-07-15 09:53:37 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-18 12:57:34 -0400
commit1e01cb0c6ff7e9ddb6547551794c6aa82785a7cb (patch)
tree791ecc834a169f6e3d7322a0c285dd95e9cd0c31
parente59494f441c834ca7aaa0e6fa6678ddbd3d72743 (diff)
ftrace: only trace preempt off with preempt tracer
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 <srostedt@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/trace/trace_irqsoff.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c
index 421d6fe3650e..b1e4a89b08eb 100644
--- a/kernel/trace/trace_irqsoff.c
+++ b/kernel/trace/trace_irqsoff.c
@@ -337,12 +337,14 @@ EXPORT_SYMBOL(trace_hardirqs_off_caller);
337#ifdef CONFIG_PREEMPT_TRACER 337#ifdef CONFIG_PREEMPT_TRACER
338void trace_preempt_on(unsigned long a0, unsigned long a1) 338void trace_preempt_on(unsigned long a0, unsigned long a1)
339{ 339{
340 stop_critical_timing(a0, a1); 340 if (preempt_trace())
341 stop_critical_timing(a0, a1);
341} 342}
342 343
343void trace_preempt_off(unsigned long a0, unsigned long a1) 344void trace_preempt_off(unsigned long a0, unsigned long a1)
344{ 345{
345 start_critical_timing(a0, a1); 346 if (preempt_trace())
347 start_critical_timing(a0, a1);
346} 348}
347#endif /* CONFIG_PREEMPT_TRACER */ 349#endif /* CONFIG_PREEMPT_TRACER */
348 350