Skip to content

Commit a3ae76d

Browse files
committed
tracing: Make tracing_selftest_running/delete nops when not used
There's no reason to test the condition variables tracing_selftest_running or tracing_selftest_delete when tracing selftests are not enabled. Make them define 0s when not the selftests are not configured in. Link: https://lkml.kernel.org/r/20230528051742.1325503-4-rostedt@goodmis.org Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 9da705d commit a3ae76d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

kernel/trace/trace.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
*/
6161
bool ring_buffer_expanded;
6262

63+
#ifdef CONFIG_FTRACE_STARTUP_TEST
6364
/*
6465
* We need to change this state when a selftest is running.
6566
* A selftest will lurk into the ring-buffer to count the
@@ -75,14 +76,16 @@ static bool __read_mostly tracing_selftest_running;
7576
*/
7677
bool __read_mostly tracing_selftest_disabled;
7778

78-
#ifdef CONFIG_FTRACE_STARTUP_TEST
7979
void __init disable_tracing_selftest(const char *reason)
8080
{
8181
if (!tracing_selftest_disabled) {
8282
tracing_selftest_disabled = true;
8383
pr_info("Ftrace startup test is disabled due to %s\n", reason);
8484
}
8585
}
86+
#else
87+
#define tracing_selftest_running 0
88+
#define tracing_selftest_disabled 0
8689
#endif
8790

8891
/* Pipe tracepoints to printk */

0 commit comments

Comments
 (0)