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@xxxxxxxxx> --- 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