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 <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Nicolas Schier <[email protected]> Cc: Nick Desaulniers <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Linus Torvalds <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 9f0cb91 commit 8c4e53a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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)