From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Cc: Steven Rostedt <rostedt@goodmis.org>
Subject: [PATCH v6 00/10] libtracefs: Facilitate adding and removing kprobes
Date: Fri, 2 Jul 2021 14:56:06 -0400 [thread overview]
Message-ID: <20210702185616.167778-1-rostedt@goodmis.org> (raw)
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 v4: https://lore.kernel.org/linux-trace-devel/20210702142242.163989-1-rostedt@goodmis.org/
- Rename tracefs_kprobe_type() to tracefs_kprobe_info() that not only returns the
type, but also allows the user to get the strings for the type (before the ':')
the addr, and the format.
- Have tracefs_get_kprobes() take a type parameter to explicitly ask for a
kprobes or kretprobes.
- Added a helper function parse_kprobes() to remove the parsing of the
kprobe_events file out of the main logic.
- Updated the tracefs_utest to use the kprobe APIs instead of just writing
to the kprobe file directly (This helped catch a lot of bugs).
Steven Rostedt (VMware) (10):
libtracefs: Implement tracefs_instances()
libtracefs: Implement tracefs_kprobe_raw()
libtracefs: Implement tracefs_kretprobe_raw()
libtracefs: Implement tracefs_get_kprobes()
libtracefs: Add helper function to parse kprobes
libtracefs: Implement tracefs_kprobe_info()
libtracefs: Implement tracefs_kprobe_clear_all() to remove all kprobes
libtracefs: Implement tracefs_kprobe_clear_probe()
libtracefs: Add man pages for kprobe functions
libtracefs: Update the unit tests to use the kprobe API instead
Documentation/libtracefs-kprobes.txt | 297 ++++++++++++++++
include/tracefs.h | 17 +
src/Makefile | 1 +
src/tracefs-instance.c | 76 +++++
src/tracefs-kprobes.c | 485 +++++++++++++++++++++++++++
utest/tracefs-utest.c | 195 +++++++++--
6 files changed, 1042 insertions(+), 29 deletions(-)
create mode 100644 Documentation/libtracefs-kprobes.txt
create mode 100644 src/tracefs-kprobes.c
--
2.30.2
next reply other threads:[~2021-07-02 18:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-02 18:56 Steven Rostedt [this message]
2021-07-02 18:56 ` [PATCH v6 01/10] libtracefs: Implement tracefs_instances() Steven Rostedt
2021-07-02 18:56 ` [PATCH v6 02/10] libtracefs: Implement tracefs_kprobe_raw() Steven Rostedt
2021-07-02 18:56 ` [PATCH v6 03/10] libtracefs: Implement tracefs_kretprobe_raw() Steven Rostedt
2021-07-02 18:56 ` [PATCH v6 04/10] libtracefs: Implement tracefs_get_kprobes() Steven Rostedt
2021-07-02 18:56 ` [PATCH v6 05/10] libtracefs: Add helper function to parse kprobes Steven Rostedt
2021-07-02 18:56 ` [PATCH v6 06/10] libtracefs: Implement tracefs_kprobe_info() Steven Rostedt
2021-07-02 18:56 ` [PATCH v6 07/10] libtracefs: Implement tracefs_kprobe_clear_all() to remove all kprobes Steven Rostedt
2021-07-02 18:56 ` [PATCH v6 08/10] libtracefs: Implement tracefs_kprobe_clear_probe() Steven Rostedt
2021-07-02 18:56 ` [PATCH v6 09/10] libtracefs: Add man pages for kprobe functions Steven Rostedt
2021-07-02 18:56 ` [PATCH v6 10/10] libtracefs: Update the unit tests to use the kprobe API instead Steven Rostedt
2021-07-02 18:59 ` [PATCH v6 00/10] libtracefs: Facilitate adding and removing kprobes 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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210702185616.167778-1-rostedt@goodmis.org \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).