linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH] trace-cmd: Use the new libtracefs API to address all dynamic events
Date: Wed,  9 Mar 2022 07:44:58 +0200	[thread overview]
Message-ID: <20220309054458.636350-1-tz.stoyanov@gmail.com> (raw)

The trace-cmd reset logic clears all dynamically created ftrace events.
The current implementation lists all events that should be cleared.
That logic is fragile, as when a new type of dynamic event is
introduced the logic should be updated. Instead, the newly introduced
libtracefs define should be used: TRACEFS_DYNEVENT_ALL.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 tracecmd/trace-record.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 9afc1042..8d9cbac2 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -5262,12 +5262,7 @@ static void clear_all_dynamic_events(void)
 {
 	/* Clear event probes first, as they may be attached to other dynamic event */
 	tracefs_dynevent_destroy_all(TRACEFS_DYNEVENT_EPROBE, true);
-	tracefs_dynevent_destroy_all(TRACEFS_DYNEVENT_KPROBE |
-				     TRACEFS_DYNEVENT_KRETPROBE |
-				     TRACEFS_DYNEVENT_UPROBE |
-				     TRACEFS_DYNEVENT_URETPROBE |
-				     TRACEFS_DYNEVENT_SYNTH,
-				     true);
+	tracefs_dynevent_destroy_all(TRACEFS_DYNEVENT_ALL, true);
 }
 
 static void clear_func_filters(void)
-- 
2.34.1


             reply	other threads:[~2022-03-09  5:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09  5:44 Tzvetomir Stoyanov (VMware) [this message]
2022-03-09 16:36 ` [PATCH] trace-cmd: Use the new libtracefs API to address all dynamic events 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=20220309054458.636350-1-tz.stoyanov@gmail.com \
    --to=tz.stoyanov@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.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).