]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tracing: Return -EINVAL if a boot tracer tries to enable the mmiotracer at boot
authorSteven Rostedt <rostedt@goodmis.org>
Thu, 19 Dec 2024 20:12:00 +0000 (15:12 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 26 Dec 2024 15:38:36 +0000 (10:38 -0500)
The mmiotracer is not set to be enabled at boot up from the kernel command
line. If the boot command line tries to enable that tracer, it will fail
to be enabled. The return code is currently zero when that happens so the
caller just thinks it was enabled. Return -EINVAL in this case.

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: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/20241219201344.854254394@goodmis.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace.c

index e6e1de69af018b8373a8864f78f4285a0769b2bf..0aaf442271e93374e3b246549bcc9df76aaa0bff 100644 (file)
@@ -6116,7 +6116,7 @@ int tracing_set_tracer(struct trace_array *tr, const char *buf)
        if (system_state < SYSTEM_RUNNING && t->noboot) {
                pr_warn("Tracer '%s' is not allowed on command line, ignored\n",
                        t->name);
-               return 0;
+               return -EINVAL;
        }
 
        /* Some tracers are only allowed for the top level buffer */