Skip to contentSkip to conversation

tracing: Remove spurious default precision from show_event_trigger/filter formats

PATCH In review [email protected] 5 participants 5 messages Mar 26 – Mar 27 Tracing

lore
Share & tools
lore
#0 lore raw

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
index 249d1cba72c0..6b54c10f9ba4 100644
@@ -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->print(m, data);
Signature · 1 line
2.39.5
maintainer Acked-by on v1 1/1
#1 lore raw
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
---
 kernel/trace/trace_events.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace_events.c +2 -2
index 249d1cba72c0..6b54c10f9ba4 100644
@@ -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->print(m, data);
Signature · 1 line
2.39.5
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
Reviewed-by on v1 1/1
#2 lore raw
In reply to [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".

Makes sense. It does not change the output because it printed an empty string "" so the precision did not matter.

Best Regards,
Petr

Reviewed-by on v1 1/1
#4 lore raw
In reply to [email protected]
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".

---
 kernel/trace/trace_events.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace_events.c +2 -2
index 249d1cba72c0..6b54c10f9ba4 100644
@@ -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->print(m, data);
Signature · 1 line
2.39.5

LGTM.

Signature · 1 line
Aaron Tomlin
maintainer
#3 lore raw
In reply to Petr Mladek
Quoted 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

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

Best Regards,
Petr