Commit 8f21943e authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt (Google)
Browse files

tracing: Fix output of set_event for some cached module events

The following works fine:

 ~# echo ':mod:trace_events_sample' > /sys/kernel/tracing/set_event
 ~# cat /sys/kernel/tracing/set_event
 *:*:mod:trace_events_sample
 ~#

But if a name is given without a ':' where it can match an event name or
system name, the output of the cached events does not include a new line:

 ~# echo 'foo_bar:mod:trace_events_sample' > /sys/kernel/tracing/set_event
 ~# cat /sys/kernel/tracing/set_event
 foo_bar:mod:trace_events_sample~#

Add the '\n' to that as well.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/20250121151336.6c491844@gandalf.local.home


Fixes: b355247d ("tracing: Cache ":mod:" events for modules not loaded yet")
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent f95ee542
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1634,7 +1634,7 @@ static int s_show(struct seq_file *m, void *v)

	/* When match is set, system and event are not */
	if (iter->event_mod->match) {
		seq_printf(m, "%s:mod:%s", iter->event_mod->match,
		seq_printf(m, "%s:mod:%s\n", iter->event_mod->match,
			   iter->event_mod->module);
		return 0;
	}