Commit e8dc6371 authored by Steven Rostedt (Red Hat)'s avatar Steven Rostedt (Red Hat) Committed by Steven Rostedt

tracing: Fix counter for traceon/off event triggers

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.homeAcked-by: default avatarTom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 4bf0566d
...@@ -742,13 +742,16 @@ traceon_trigger(struct event_trigger_data *data) ...@@ -742,13 +742,16 @@ traceon_trigger(struct event_trigger_data *data)
static void static void
traceon_count_trigger(struct event_trigger_data *data) traceon_count_trigger(struct event_trigger_data *data)
{ {
if (tracing_is_on())
return;
if (!data->count) if (!data->count)
return; return;
if (data->count != -1) if (data->count != -1)
(data->count)--; (data->count)--;
traceon_trigger(data); tracing_on();
} }
static void static void
...@@ -763,13 +766,16 @@ traceoff_trigger(struct event_trigger_data *data) ...@@ -763,13 +766,16 @@ traceoff_trigger(struct event_trigger_data *data)
static void static void
traceoff_count_trigger(struct event_trigger_data *data) traceoff_count_trigger(struct event_trigger_data *data)
{ {
if (!tracing_is_on())
return;
if (!data->count) if (!data->count)
return; return;
if (data->count != -1) if (data->count != -1)
(data->count)--; (data->count)--;
traceoff_trigger(data); tracing_off();
} }
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment