diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2014-01-07 04:25:50 +0100 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-01-10 03:19:44 +0100 |
commit | e8dc637152d2921447b012f58c51e0342304af33 (patch) | |
tree | ec87bd05d5b70181099e9c3de3ea128db0c58dcf /kernel/trace/trace_events_trigger.c | |
parent | tracing: Remove double-underscore naming in syscall trigger invocations (diff) | |
download | linux-e8dc637152d2921447b012f58c51e0342304af33.tar.xz linux-e8dc637152d2921447b012f58c51e0342304af33.zip |
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.home
Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_events_trigger.c')
-rw-r--r-- | kernel/trace/trace_events_trigger.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c index f6dd115b958d..a53e0da7e333 100644 --- a/kernel/trace/trace_events_trigger.c +++ b/kernel/trace/trace_events_trigger.c @@ -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 |