]> Pileus Git - ~andy/linux/commitdiff
tracing: Fix counter for traceon/off event triggers
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Tue, 7 Jan 2014 03:25:50 +0000 (22:25 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Fri, 10 Jan 2014 02:19:44 +0000 (21:19 -0500)
The counters for the traceon and traceoff are only suppose to decrement
when the trigger enables or disables tracing. It is not suppose to decrement
every time the event is hit.

Only decrement the counter if the trigger actually did something.

Link: http://lkml.kernel.org/r/20140106223124.0e5fd0b4@gandalf.local.home
Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace_events_trigger.c

index f6dd115b958dd8c029445d0e1071153824a7fbbd..a53e0da7e33334ed5bfb2138825f857f71eb22fe 100644 (file)
@@ -742,13 +742,16 @@ traceon_trigger(struct event_trigger_data *data)
 static void
 traceon_count_trigger(struct event_trigger_data *data)
 {
+       if (tracing_is_on())
+               return;
+
        if (!data->count)
                return;
 
        if (data->count != -1)
                (data->count)--;
 
-       traceon_trigger(data);
+       tracing_on();
 }
 
 static void
@@ -763,13 +766,16 @@ traceoff_trigger(struct event_trigger_data *data)
 static void
 traceoff_count_trigger(struct event_trigger_data *data)
 {
+       if (!tracing_is_on())
+               return;
+
        if (!data->count)
                return;
 
        if (data->count != -1)
                (data->count)--;
 
-       traceoff_trigger(data);
+       tracing_off();
 }
 
 static int