A later commit will apply a filter to events recorded to the trace
output. To prevent any user confusion, remove pre-existing filters when
enabling an event provided via the '-e' command line argument.

Suggested-by: Tomas Glozar <[email protected]>
Signed-off-by: Valentin Schneider <[email protected]>
---
 tools/tracing/rtla/src/trace.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/tracing/rtla/src/trace.c b/tools/tracing/rtla/src/trace.c
index e407447773d04..f67f02cc92cdd 100644
--- a/tools/tracing/rtla/src/trace.c
+++ b/tools/tracing/rtla/src/trace.c
@@ -473,6 +473,10 @@ static int trace_event_enable_filter(struct trace_instance 
*instance,
        char filter[MAX_PATH];
        int retval;
 
+       /* Unconditionally clean any pre-existing filters */
+       tracefs_event_file_write(instance->inst, tevent->system,
+                                tevent->event, "filter", "0");
+
        if (!tevent->filter)
                return 0;
 
-- 
2.55.0


Reply via email to