diff options
author | Tom Zanussi <tom.zanussi@linux.intel.com> | 2015-12-10 12:50:49 -0600 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2016-03-08 11:19:35 -0500 |
commit | a88e1cfb1d3081ffb34864d9cf8a5c289630f48e (patch) | |
tree | c8b64b61980d5d52ce0d25b3d330cda332c74ec8 /kernel/trace/trace_events_trigger.c | |
parent | a5863dae84e2da83a1e5de485a7f150d0c28f08e (diff) | |
download | lwn-a88e1cfb1d3081ffb34864d9cf8a5c289630f48e.tar.gz lwn-a88e1cfb1d3081ffb34864d9cf8a5c289630f48e.zip |
tracing: Add an unreg_all() callback to trigger commands
Add a new unreg_all() callback that can be used to remove all
command-specific triggers from an event and arrange to have it called
whenever a trigger file is opened with O_TRUNC set.
Commands that don't want truncate semantics, or existing commands that
don't implement this function simply do nothing and their triggers
remain intact.
Link: http://lkml.kernel.org/r/2b7d62854d01f28c19185e1bbb8f826f385edfba.1449767187.git.tom.zanussi@linux.intel.com
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
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 | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c index a11bb4780f82..cbb7ee531983 100644 --- a/kernel/trace/trace_events_trigger.c +++ b/kernel/trace/trace_events_trigger.c @@ -193,6 +193,19 @@ static int event_trigger_regex_open(struct inode *inode, struct file *file) return -ENODEV; } + if ((file->f_mode & FMODE_WRITE) && + (file->f_flags & O_TRUNC)) { + struct trace_event_file *event_file; + struct event_command *p; + + event_file = event_file_data(file); + + list_for_each_entry(p, &trigger_commands, list) { + if (p->unreg_all) + p->unreg_all(event_file); + } + } + if (file->f_mode & FMODE_READ) { ret = seq_open(file, &event_triggers_seq_ops); if (!ret) { |