]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rv: Remove trailing whitespace from tracepoint string
authorGabriele Monaco <gmonaco@redhat.com>
Mon, 28 Jul 2025 13:50:14 +0000 (15:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 14:38:56 +0000 (16:38 +0200)
[ Upstream commit 7b70ac4cad2b20eaf415276bbaa0d9df9abb428c ]

RV event tracepoints print a line with the format:
    "event_xyz: S0 x event -> S1 "
    "event_xyz: S1 x event -> S0 (final)"

While printing an event leading to a non-final state, the line
has a trailing white space (visible above before the closing ").

Adapt the format string not to print the trailing whitespace if we are
not printing "(final)".

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tomas Glozar <tglozar@redhat.com>
Cc: Juri Lelli <jlelli@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Link: https://lore.kernel.org/20250728135022.255578-3-gmonaco@redhat.com
Reviewed-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Stable-dep-of: 7f904ff6e58d ("rv: Use strings in da monitors tracepoints")
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/trace/rv/rv_trace.h

index 422b75f58891eb830cbb5473adc043f583333cc7..18fa0e358a30e42200f2d6dc9bb3293dcb0af625 100644 (file)
@@ -29,11 +29,11 @@ DECLARE_EVENT_CLASS(event_da_monitor,
                __entry->final_state            = final_state;
        ),
 
-       TP_printk("%s x %s -> %s %s",
+       TP_printk("%s x %s -> %s%s",
                __entry->state,
                __entry->event,
                __entry->next_state,
-               __entry->final_state ? "(final)" : "")
+               __entry->final_state ? " (final)" : "")
 );
 
 DECLARE_EVENT_CLASS(error_da_monitor,
@@ -90,12 +90,12 @@ DECLARE_EVENT_CLASS(event_da_monitor_id,
                __entry->final_state            = final_state;
        ),
 
-       TP_printk("%d: %s x %s -> %s %s",
+       TP_printk("%d: %s x %s -> %s%s",
                __entry->id,
                __entry->state,
                __entry->event,
                __entry->next_state,
-               __entry->final_state ? "(final)" : "")
+               __entry->final_state ? " (final)" : "")
 );
 
 DECLARE_EVENT_CLASS(error_da_monitor_id,