aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2014-01-06 22:25:50 -0500
committerSteven Rostedt <rostedt@goodmis.org>2014-01-09 21:19:44 -0500
commite8dc637152d2921447b012f58c51e0342304af33 (patch)
treeec87bd05d5b70181099e9c3de3ea128db0c58dcf
parent4bf0566db15eda214cc64a77d4d3b96e010ec6ac (diff)
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>
-rw-r--r--kernel/trace/trace_events_trigger.c10
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)
742static void 742static void
743traceon_count_trigger(struct event_trigger_data *data) 743traceon_count_trigger(struct event_trigger_data *data)
744{ 744{
745 if (tracing_is_on())
746 return;
747
745 if (!data->count) 748 if (!data->count)
746 return; 749 return;
747 750
748 if (data->count != -1) 751 if (data->count != -1)
749 (data->count)--; 752 (data->count)--;
750 753
751 traceon_trigger(data); 754 tracing_on();
752} 755}
753 756
754static void 757static void
@@ -763,13 +766,16 @@ traceoff_trigger(struct event_trigger_data *data)
763static void 766static void
764traceoff_count_trigger(struct event_trigger_data *data) 767traceoff_count_trigger(struct event_trigger_data *data)
765{ 768{
769 if (!tracing_is_on())
770 return;
771
766 if (!data->count) 772 if (!data->count)
767 return; 773 return;
768 774
769 if (data->count != -1) 775 if (data->count != -1)
770 (data->count)--; 776 (data->count)--;
771 777
772 traceoff_trigger(data); 778 tracing_off();
773} 779}
774 780
775static int 781static int