tracing: Move setting of tracing_selftest_running out of register_tracer()
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Sun, 28 May 2023 05:17:38 +0000 (01:17 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Mon, 29 May 2023 01:15:04 +0000 (21:15 -0400)
commite8352cf5778c53b80fdcee086278b2048ddb8f98
tree499782b275bd548161b0daa52ee8023584068f7d
parentf1aab363438cd1c55a3c5420db2a17c0e29ef625
tracing: Move setting of tracing_selftest_running out of register_tracer()

The variables tracing_selftest_running and tracing_selftest_disabled are
only used for when CONFIG_FTRACE_STARTUP_TEST is enabled. Make them only
visible within the selftest code. The setting of those variables are in
the register_tracer() call, and set in a location where they do not need
to be. Create a wrapper around run_tracer_selftest() called
do_run_tracer_selftest() which sets those variables, and have
register_tracer() call that instead.

Having those variables only set within the CONFIG_FTRACE_STARTUP_TEST
scope gets rid of them (and also the ability to remove testing against
them) when the startup tests are not enabled (most cases).

Link: https://lkml.kernel.org/r/20230528051742.1325503-2-rostedt@goodmis.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace.c