tracing: Remove spurious default precision from show_event_trigger/filter formats
PATCH 1/1 tracing: Remove spurious default precision from show_event_trigger/filter formats
From: David Laight <[email protected]>
Change 2d8b7f9bf8e6e ("tracing: Have show_event_trigger/filter format a bit more in columns") added space padding to align the output.
However it used ("%*.s", len, "") which requests the default precision.
It doesn't matter here whether the userspace default (0) or kernel
default (no precision) is used, but the format should be "%*s".
--- kernel/trace/trace_events.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace_events.c +2 -2
@@ -1718,7 +1718,7 @@ static int t_show_filters(struct seq_file *m, void *v) len =get_call_len (call); -seq_printf (m,"%s:%s%*.s%s\n" , call->class->system, +seq_printf (m,"%s:%s%*s%s\n" , call->class->system,trace_event_name (call), len,"" , filter->filter_string);return 0 ;
@@ -1750,7 +1750,7 @@ static int t_show_triggers(struct seq_file *m, void *v) len =get_call_len (call);list_for_each_entry_rcu (data, &file->triggers, list) { -seq_printf (m,"%s:%s%*.s" , call->class->system, +seq_printf (m,"%s:%s%*s" , call->class->system,trace_event_name (call), len,"" ); data->cmd_ops->
Signature · 1 line
2.39.5
Quoted 8 lines · On Thu, 26 Mar 2026 20:18:24 +0000 [email protected] wrote:
From: David Laight <[email protected]>
Change
2d8b7f9bf8e6e("tracing: Have show_event_trigger/filter format a bit more in columns") added space padding to align the output.
However it used ("%*.s", len, "") which requests the default precision.
It doesn't matter here whether the userspace default (0) or kernel
default (no precision) is used, but the format should be "%*s".
Looks good to me.
Thanks!
Quoted 30 lines
Signed-off-by David Laight <[email protected]>--- kernel/trace/trace_events.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)kernel/trace/trace_events.c +2
-2@@ -1718,7 +1718,7 @@ static int t_show_filters(struct seq_file *m, void *v) len =get_call_len (call); -seq_printf (m,"%s:%s%*.s%s\n" , call->class->system, +seq_printf (m,"%s:%s%*s%s\n" , call->class->system,trace_event_name (call), len,"" , filter->filter_string);return 0 ;@@ -1750,7 +1750,7 @@ static int t_show_triggers(struct seq_file *m, void *v) len =get_call_len (call);list_for_each_entry_rcu (data, &file->triggers, list) { -seq_printf (m,"%s:%s%*.s" , call->class->system, +seq_printf (m,"%s:%s%*s" , call->class->system,trace_event_name (call), len,"" ); data->cmd_ops->Signature · 1 line
2.39.5
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
Quoted 9 lines · On Thu 2026-03-26 20:18:24, [email protected] wrote:
From: David Laight <[email protected]>
Change
2d8b7f9bf8e6e("tracing: Have show_event_trigger/filter format a bit more in columns") added space padding to align the output.
However it used ("%*.s", len, "") which requests the default precision.
It doesn't matter here whether the userspace default (0) or kernel
default (no precision) is used, but the format should be "%*s".Signed-off-by David Laight <[email protected]>
Makes sense. It does not change the output because it printed an empty string "" so the precision did not matter.
Best Regards,
Petr
Steven Rostedt
maintainerQuoted 9 lines · On Fri, 27 Mar 2026 10:15:17 +0100 Petr Mladek <[email protected]> wrote:
Quoted 8 lines · On Thu 2026-03-26 20:18:24, [email protected] wrote:
From: David Laight <[email protected]>
Change
2d8b7f9bf8e6e("tracing: Have show_event_trigger/filter format a bit more in columns") added space padding to align the output.
However it used ("%*.s", len, "") which requests the default precision.
It doesn't matter here whether the userspace default (0) or kernel
default (no precision) is used, but the format should be "%*s".
Quoted 4 lines
Quoted 1 line
Signed-off-by David Laight <[email protected]>Makes sense. It does not change the output because it printed an empty string "" so the precision did not matter.
Right. I use this in user space all the time, and add "%*.s" a lot.
I tested it and it doesn't change the output so I'm happy to take it through my tree.
-- Steve
Quoted 5 lines
Reviewed-by Petr Mladek <[email protected]>Best Regards,
Petr
Quoted 38 lines · On Thu, Mar 26, 2026 at 08:18:24PM +0000, [email protected] wrote:
From: David Laight <[email protected]>
Change
2d8b7f9bf8e6e("tracing: Have show_event_trigger/filter format a bit more in columns") added space padding to align the output.
However it used ("%*.s", len, "") which requests the default precision.
It doesn't matter here whether the userspace default (0) or kernel
default (no precision) is used, but the format should be "%*s".Signed-off-by David Laight <[email protected]>--- kernel/trace/trace_events.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)kernel/trace/trace_events.c +2
-2@@ -1718,7 +1718,7 @@ static int t_show_filters(struct seq_file *m, void *v) len =get_call_len (call); -seq_printf (m,"%s:%s%*.s%s\n" , call->class->system, +seq_printf (m,"%s:%s%*s%s\n" , call->class->system,trace_event_name (call), len,"" , filter->filter_string);return 0 ;@@ -1750,7 +1750,7 @@ static int t_show_triggers(struct seq_file *m, void *v) len =get_call_len (call);list_for_each_entry_rcu (data, &file->triggers, list) { -seq_printf (m,"%s:%s%*.s" , call->class->system, +seq_printf (m,"%s:%s%*s" , call->class->system,trace_event_name (call), len,"" ); data->cmd_ops->Signature · 1 line
2.39.5
LGTM.
Signature · 1 line
Aaron Tomlin