tracing: Add a per-event-trigger 'paused' field
authorTom Zanussi <tom.zanussi@linux.intel.com>
Thu, 10 Dec 2015 18:50:47 +0000 (12:50 -0600)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 8 Mar 2016 16:19:33 +0000 (11:19 -0500)
Add a simple per-trigger 'paused' flag, allowing individual triggers
to pause.  We could leave it to individual triggers that need this
functionality to do it themselves, but we also want to allow other
events to control pausing, so add it to the trigger data.

Link: http://lkml.kernel.org/r/fed37e4879684d7dcc57fe00ce0cbf170032b06d.1449767187.git.tom.zanussi@linux.intel.com
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Tested-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.h
kernel/trace/trace_events_trigger.c

index 0044b91d546946ac62cf7198592c1f07b5adccab..f1868677f8563108659930a4f86d8ed7d771b50c 100644 (file)
@@ -1172,6 +1172,7 @@ struct event_trigger_data {
        struct event_filter __rcu       *filter;
        char                            *filter_str;
        void                            *private_data;
+       bool                            paused;
        struct list_head                list;
 };
 
index 0a62887c63c086495b166348f028e0f717264ad5..e4d8b376317594b6f83990041c0037f1943b62b8 100644 (file)
@@ -72,6 +72,8 @@ event_triggers_call(struct trace_event_file *file, void *rec)
                return tt;
 
        list_for_each_entry_rcu(data, &file->triggers, list) {
+               if (data->paused)
+                       continue;
                if (!rec) {
                        data->ops->func(data, rec);
                        continue;
@@ -110,6 +112,8 @@ event_triggers_post_call(struct trace_event_file *file,
        struct event_trigger_data *data;
 
        list_for_each_entry_rcu(data, &file->triggers, list) {
+               if (data->paused)
+                       continue;
                if (data->cmd_ops->trigger_type & tt)
                        data->ops->func(data, rec);
        }