Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+8 -2
+8 -2
kernel/trace/trace_events_trigger.c
··· 742 742 static void 743 743 traceon_count_trigger(struct event_trigger_data *data) 744 744 { 745 + if (tracing_is_on()) 746 + return; 747 + 745 748 if (!data->count) 746 749 return; 747 750 748 751 if (data->count != -1) 749 752 (data->count)--; 750 753 751 - traceon_trigger(data); 754 + tracing_on(); 752 755 } 753 756 754 757 static void ··· 766 763 static void 767 764 traceoff_count_trigger(struct event_trigger_data *data) 768 765 { 766 + if (!tracing_is_on()) 767 + return; 768 + 769 769 if (!data->count) 770 770 return; 771 771 772 772 if (data->count != -1) 773 773 (data->count)--; 774 774 775 - traceoff_trigger(data); 775 + tracing_off(); 776 776 } 777 777 778 778 static int