]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Skip selftests if tracing is disabled
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 1 Mar 2021 15:49:35 +0000 (10:49 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 4 Mar 2021 14:51:25 +0000 (09:51 -0500)
commit9cf341827159f2d345d0053c1b464f0c76098d12
tree9efeb847d912419a98b91fc382b8d2c6841598f6
parentf1f8b2bef589c3793ec0c4d23b2228d0a3dbb5df
tracing: Skip selftests if tracing is disabled

If tracing is disabled for some reason (traceoff_on_warning, command line,
etc), the ftrace selftests are guaranteed to fail, as their results are
defined by trace data in the ring buffers. If the ring buffers are turned
off, the tests will fail, due to lack of data.

Because tracing being disabled is for a specific reason (warning, user
decided to, etc), it does not make sense to enable tracing to run the self
tests, as the test output may corrupt the reason for the tracing to be
disabled.

Instead, simply skip the self tests and report that they are being skipped
due to tracing being disabled.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace.c