Skip to content

Commit

Permalink
tracing: Fix counter for traceon/off event triggers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Rostedt (Red Hat) committed Jan 10, 2014
1 parent 4bf0566 commit e8dc637
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions kernel/trace/trace_events_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e8dc637

Please sign in to comment.