* [PATCH] trace-cmd: Use the new libtracefs API to address all dynamic events
@ 2022-03-09 5:44 Tzvetomir Stoyanov (VMware)
2022-03-09 16:36 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2022-03-09 5:44 UTC (permalink / raw)
To: rostedt; +Cc: linux-trace-devel
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] trace-cmd: Use the new libtracefs API to address all dynamic events
2022-03-09 5:44 [PATCH] trace-cmd: Use the new libtracefs API to address all dynamic events Tzvetomir Stoyanov (VMware)
@ 2022-03-09 16:36 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2022-03-09 16:36 UTC (permalink / raw)
To: Tzvetomir Stoyanov (VMware); +Cc: linux-trace-devel
On Wed, 9 Mar 2022 07:44:58 +0200
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:
> 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>
Applied, thanks Tzvetomir!
-- Steve
> ---
> 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)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-09 16:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-09 5:44 [PATCH] trace-cmd: Use the new libtracefs API to address all dynamic events Tzvetomir Stoyanov (VMware)
2022-03-09 16:36 ` 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).