linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/7] libtracefs: Facilitate adding and removing kprobes
@ 2021-07-02  3:54 Steven Rostedt
  2021-07-02  3:54 ` [PATCH v4 1/7] libtracefs: Implement tracefs_instances() Steven Rostedt
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Steven Rostedt @ 2021-07-02  3:54 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: Steven Rostedt (VMware)

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

Add a tracefs_kprobe_raw() to facilitate adding kprobe events. It's
denoted as "raw" because it still requires knowing the complex format of
a kprobe, but at least it helps with other formats:

 p:[[system/]event] addr fmt

The user only needs to know the "fmt" part above, and not worry about
what file to open, or how to open it.

Also add a tracefs_kprobe_clear() to clear all kprobes and a
tracefs_kprobe_clear_probe() to clear an individual kprobe. Both have a
"force" parameter, that if set, will then try to disable the kprobe in
all instances (including the top) and then remove the kprobe(s).

Changes since v3: https://lore.kernel.org/linux-trace-devel/20210702031022.154146-1-rostedt@goodmis.org/

 - Silly me used "stat(KPROBE_EVENTS)" to see if the kprobe event
   file existed, but KPROBE_EVENTS is not a full path. Should have
   used tracefs_file_exists() since that's what it's made for.
   My testing missed this, because I forgot to push the changes to
   my test machine, and I tested the code with old logic.

Steven Rostedt (VMware) (7):
  libtracefs: Implement tracefs_instances()
  libtracefs: Implement tracefs_kprobe_raw()
  libtracefs: Implement tracefs_kretprobe_raw()
  libtracefs: Implement tracefs_get_kprobes()
  libtracefs: Implement tracefs_kprobe_clear_all() to remove all kprobes
  libtracefs: Implement tracefs_kprobe_clear_probe()
  libtracefs: Add man pages for kprobe functions

 Documentation/libtracefs-kprobes.txt | 275 +++++++++++++++++++++
 include/tracefs.h                    |   9 +
 src/Makefile                         |   1 +
 src/tracefs-instance.c               |  78 ++++++
 src/tracefs-kprobes.c                | 349 +++++++++++++++++++++++++++
 5 files changed, 712 insertions(+)
 create mode 100644 Documentation/libtracefs-kprobes.txt
 create mode 100644 src/tracefs-kprobes.c

-- 
2.30.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-07-02 11:50 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02  3:54 [PATCH v4 0/7] libtracefs: Facilitate adding and removing kprobes Steven Rostedt
2021-07-02  3:54 ` [PATCH v4 1/7] libtracefs: Implement tracefs_instances() Steven Rostedt
2021-07-02 11:10   ` Yordan Karadzhov (VMware)
2021-07-02 11:33     ` Steven Rostedt
2021-07-02 11:39       ` Yordan Karadzhov (VMware)
2021-07-02 11:50         ` Steven Rostedt
2021-07-02  3:54 ` [PATCH v4 2/7] libtracefs: Implement tracefs_kprobe_raw() Steven Rostedt
2021-07-02  3:54 ` [PATCH v4 3/7] libtracefs: Implement tracefs_kretprobe_raw() Steven Rostedt
2021-07-02  3:54 ` [PATCH v4 4/7] libtracefs: Implement tracefs_get_kprobes() Steven Rostedt
2021-07-02  3:54 ` [PATCH v4 5/7] libtracefs: Implement tracefs_kprobe_clear_all() to remove all kprobes Steven Rostedt
2021-07-02 11:15   ` Yordan Karadzhov (VMware)
2021-07-02 11:35     ` Steven Rostedt
2021-07-02  3:54 ` [PATCH v4 6/7] libtracefs: Implement tracefs_kprobe_clear_probe() Steven Rostedt
2021-07-02  3:54 ` [PATCH v4 7/7] libtracefs: Add man pages for kprobe functions Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).