Skip to content

Commit 8c4e53a

Browse files
committed
tracing: Call trace_ftrace_test_filter() for the event
The trace event filter bootup self test tests a bunch of filter logic against the ftrace_test_filter event, but does not actually call the event. Work is being done to cause a warning if an event is defined but not used. To quiet the warning call the trace event under an if statement where it is disabled so it doesn't get optimized out. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Nicolas Schier <nicolas.schier@linux.dev> Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/20250723194212.274458858@kernel.org Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 9f0cb91 commit 8c4e53a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

kernel/trace/trace_events_filter.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2900,6 +2900,10 @@ static __init int ftrace_test_event_filter(void)
29002900
if (i == DATA_CNT)
29012901
printk(KERN_CONT "OK\n");
29022902

2903+
/* Need to call ftrace_test_filter to prevent a warning */
2904+
if (!trace_ftrace_test_filter_enabled())
2905+
trace_ftrace_test_filter(1, 2, 3, 4, 5, 6, 7, 8);
2906+
29032907
return 0;
29042908
}
29052909

0 commit comments

Comments
 (0)