]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Fix event probe removal from dynamic events
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 13 Oct 2021 20:51:12 +0000 (16:51 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 13 Oct 2021 23:26:57 +0000 (19:26 -0400)
commitd23a979205aaafe833c90d355420365c2b871e5e
tree570644cf6e6fa437582b43fd79531331d82a71f9
parentc4fb290ee04fd957fa28847f066b4f940774a34b
tracing: Fix event probe removal from dynamic events

When an event probe is to be removed via the API that created it via the
dynamic events, an -ENOENT error is returned.

This is because the removal of the event probe does not expect to see the
event system and name that the event probe is attached to, even though
that's part of the API to create it. As the removal of probes is to use
the same API as they are created.

In fact, the removal is not consistent with the kprobes and uprobes
removal. Fix that by allowing various ways to remove the eprobe.

The eprobe is created with:

 e:[GROUP/]NAME SYSTEM/EVENT [OPTIONS]

Have it get removed by echoing in the following into dynamic_events:

 # Remove all eprobes with NAME
 echo '-:NAME' >> dynamic_events

 # Remove a specific eprobe
 echo '-:GROUP/NAME' >> dynamic_events
 echo '-:GROUP/NAME SYSTEM/EVENT' >> dynamic_events
 echo '-:NAME SYSTEM/EVENT' >> dynamic_events
 echo '-:GROUP/NAME SYSTEM/EVENT OPTIONS' >> dynamic_events
 echo '-:NAME SYSTEM/EVENT OPTIONS' >> dynamic_events

Link: https://lkml.kernel.org/r/20211012081925.0e19cc4f@gandalf.local.home
Link: https://lkml.kernel.org/r/20211013205533.630722129@goodmis.org
Suggested-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Fixes: 1a327be3f20f8 ("tracing: Add a probe that attaches to trace events")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_eprobe.c