]> Pileus Git - ~andy/linux/commitdiff
trace: fix logic to start/stop counting
authorSteven Rostedt <srostedt@redhat.com>
Thu, 22 Jan 2009 19:26:15 +0000 (14:26 -0500)
committerIngo Molnar <mingo@elte.hu>
Fri, 23 Jan 2009 10:10:45 +0000 (11:10 +0100)
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>
kernel/trace/trace.c

index 757ae6f7e64839c8d59aea65f15c1593e8c955e3..2129ab9d2a48b9effc3c6c4cca3906a35b42492c 100644 (file)
@@ -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;
        }