Skip to content

Commit

Permalink
trace: fix logic to start/stop counting
Browse files Browse the repository at this point in the history
The logic in the tracing_start/stop code prevents the WARN_ON
from ever detecting if a start/stop pair was mismatched.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Jan 23, 2009
1 parent 94523e8 commit b06a830
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,13 +610,12 @@ void tracing_start(void)
return;

spin_lock_irqsave(&tracing_start_lock, flags);
if (--trace_stop_count)
goto out;

if (trace_stop_count < 0) {
/* Someone screwed up their debugging */
WARN_ON_ONCE(1);
trace_stop_count = 0;
if (--trace_stop_count) {
if (trace_stop_count < 0) {
/* Someone screwed up their debugging */
WARN_ON_ONCE(1);
trace_stop_count = 0;
}
goto out;
}

Expand Down

0 comments on commit b06a830

Please sign in to comment.