Skip to content

Commit

Permalink
tracing: Remove extra space at the end of hwlat_detector/mode
Browse files Browse the repository at this point in the history
[ Upstream commit 2cf0dee ]

Space is printed after each mode value including the last one:
$ echo \"$(sudo cat /sys/kernel/tracing/hwlat_detector/mode)\"
"none [round-robin] per-cpu "

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Link: https://lore.kernel.org/linux-trace-kernel/20230825103432.7750-1-m.kobuk@ispras.ru

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Fixes: 8fa826b ("trace/hwlat: Implement the mode config option")
Signed-off-by: Mikhail Kobuk <m.kobuk@ispras.ru>
Reviewed-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Mikhail Kobuk authored and gregkh committed Sep 13, 2023
1 parent ca5e842 commit fb34716
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace_hwlat.c
Expand Up @@ -635,7 +635,7 @@ static int s_mode_show(struct seq_file *s, void *v)
else
seq_printf(s, "%s", thread_mode_str[mode]);

if (mode != MODE_MAX)
if (mode < MODE_MAX - 1) /* if mode is any but last */
seq_puts(s, " ");

return 0;
Expand Down

0 comments on commit fb34716

Please sign in to comment.