Skip to content

Commit 3b1679e

Browse files
Andrei-Alexandru Tachicirostedt
authored andcommitted
tracing: Fix enabling multiple events on the kernel command line and bootconfig
Multiple events can be enabled on the kernel command line via a comma separator. But if the are specified one at a time, then only the last event is enabled. This is because the event names are saved in a temporary buffer, and each call by the init cmdline code will reset that buffer. This also affects names in the boot config file, as it may call the callback multiple times with an example of: kernel.trace_event = ":mod:rproc_qcom_common", ":mod:qrtr", ":mod:qcom_aoss" Change the cmdline callback function to append a comma and the next value if the temporary buffer already has content. Cc: stable@vger.kernel.org Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Link: https://patch.msgid.link/20260302-trace-events-allow-multiple-modules-v1-1-ce4436e37fb8@oss.qualcomm.com Signed-off-by: Andrei-Alexandru Tachici <andrei-alexandru.tachici@oss.qualcomm.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 457965c commit 3b1679e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

kernel/trace/trace_events.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4493,7 +4493,11 @@ static char bootup_event_buf[COMMAND_LINE_SIZE] __initdata;
44934493

44944494
static __init int setup_trace_event(char *str)
44954495
{
4496-
strscpy(bootup_event_buf, str, COMMAND_LINE_SIZE);
4496+
if (bootup_event_buf[0] != '\0')
4497+
strlcat(bootup_event_buf, ",", COMMAND_LINE_SIZE);
4498+
4499+
strlcat(bootup_event_buf, str, COMMAND_LINE_SIZE);
4500+
44974501
trace_set_ring_buffer_expanded(NULL);
44984502
disable_tracing_selftest("running event tracing");
44994503

0 commit comments

Comments
 (0)