Skip to content

Commit

Permalink
tracing/dynevent: Delete all matched events
Browse files Browse the repository at this point in the history
When user gives an event name to delete, delete all
matched events instead of the first one.

This means if there are several events which have same
name but different group (subsystem) name, those are
removed if user passed only the event name, e.g.

  # cat kprobe_events
  p:group1/testevent _do_fork
  p:group2/testevent fork_idle
  # echo -:testevent >> kprobe_events
  # cat kprobe_events
  #

Link: http://lkml.kernel.org/r/156095684958.28024.16597826267117453638.stgit@devnote2

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
  • Loading branch information
Masami Hiramatsu authored and Steven Rostedt (VMware) committed Aug 31, 2019
1 parent 60d53e2 commit cb8e7a8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kernel/trace/trace_dynevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ int dyn_event_release(int argc, char **argv, struct dyn_event_operations *type)
for_each_dyn_event_safe(pos, n) {
if (type && type != pos->ops)
continue;
if (pos->ops->match(system, event, pos)) {
ret = pos->ops->free(pos);
if (!pos->ops->match(system, event, pos))
continue;

ret = pos->ops->free(pos);
if (ret)
break;
}
}
mutex_unlock(&event_mutex);

Expand Down

0 comments on commit cb8e7a8

Please sign in to comment.