archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <>
Cc: "Steven Rostedt (VMware)" <>
Subject: [PATCH v2 0/4] libtracefs: Facilitate adding and removing kprobes
Date: Wed, 30 Jun 2021 11:47:25 -0400	[thread overview]
Message-ID: <> (raw)

From: "Steven Rostedt (VMware)" <>

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).

(Man pages still coming after this).

Changes since v1:
 - Added a tracefs_instances() to get the names of all instances
 - Rewrote the tracefs_kprobe_clear*() to use the tracefs_instances,
   which simplified the code tremendously.
 - Do not fail on failed: allocating various memory, disabling
   events, finding instances, etc, in the tracefs_kprobe_clear*()
   because it may still succeed, if the failed part were not what
   was causing it to not succeed.

Steven Rostedt (VMware) (4):
  libtracefs: Implement tracefs_instances()
  libtracefs: Implement tracefs_kprobe_raw()
  libtracefs: Implement tracefs_kprobe_clear() to remove all kprobes
  libtracefs: Implement tracefs_kprobe_clear_probe()

 include/tracefs.h      |   6 ++
 src/Makefile           |   1 +
 src/tracefs-instance.c |  78 +++++++++++++++
 src/tracefs-kprobes.c  | 215 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 300 insertions(+)
 create mode 100644 src/tracefs-kprobes.c


             reply	other threads:[~2021-06-30 15:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-30 15:47 Steven Rostedt [this message]
2021-06-30 15:47 ` [PATCH v2 1/4] libtracefs: Implement tracefs_instances() Steven Rostedt
2021-06-30 15:47 ` [PATCH v2 2/4] libtracefs: Implement tracefs_kprobe_raw() Steven Rostedt
2021-06-30 19:46   ` Yordan Karadzhov (VMware)
2021-06-30 19:53     ` Steven Rostedt
2021-06-30 20:05       ` Yordan Karadzhov (VMware)
2021-06-30 15:47 ` [PATCH v2 3/4] libtracefs: Implement tracefs_kprobe_clear() to remove all kprobes Steven Rostedt
2021-06-30 15:47 ` [PATCH v2 4/4] libtracefs: Implement tracefs_kprobe_clear_probe() Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \
    --subject='Re: [PATCH v2 0/4] libtracefs: Facilitate adding and removing kprobes' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox