* [PATCH 0/3] tracing/user_events: More efficient data output in user_seq_show()
@ 2026-06-04 12:05 Markus Elfring
2026-06-04 12:07 ` [PATCH 1/3] tracing/user_events: Simplify " Markus Elfring
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Markus Elfring @ 2026-06-04 12:05 UTC (permalink / raw)
To: linux-trace-kernel, Masami Hiramatsu, Mathieu Desnoyers,
Steven Rostedt
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 4 Jun 2026 14:00:56 +0200
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
Simplify data output
Use seq_putc()
Replace a seq_printf() call by seq_puts()
kernel/trace/trace_events_user.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--
2.54.0
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH 1/3] tracing/user_events: Simplify data output in user_seq_show() 2026-06-04 12:05 [PATCH 0/3] tracing/user_events: More efficient data output in user_seq_show() Markus Elfring @ 2026-06-04 12:07 ` Markus Elfring 2026-06-09 16:13 ` Steven Rostedt 2026-06-04 12:10 ` [PATCH 2/3] tracing/user_events: Use seq_putc() " Markus Elfring 2026-06-04 12:12 ` [PATCH 3/3] tracing/user_events: Replace a seq_printf() call by seq_puts() " Markus Elfring 2 siblings, 1 reply; 10+ messages in thread From: Markus Elfring @ 2026-06-04 12:07 UTC (permalink / raw) To: linux-trace-kernel, Masami Hiramatsu, Mathieu Desnoyers, Steven Rostedt Cc: LKML, kernel-janitors From: Markus Elfring <elfring@users.sourceforge.net> Date: Thu, 4 Jun 2026 13:33:43 +0200 Move the specification for a line break from a seq_puts() call to a seq_printf() call. The source code was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- kernel/trace/trace_events_user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c index c4ba484f7b38..a089ac30e407 100644 --- a/kernel/trace/trace_events_user.c +++ b/kernel/trace/trace_events_user.c @@ -2800,8 +2800,7 @@ static int user_seq_show(struct seq_file *m, void *p) mutex_unlock(&group->reg_mutex); - seq_puts(m, "\n"); - seq_printf(m, "Active: %d\n", active); + seq_printf(m, "\nActive: %d\n", active); seq_printf(m, "Busy: %d\n", busy); return 0; -- 2.54.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] tracing/user_events: Simplify data output in user_seq_show() 2026-06-04 12:07 ` [PATCH 1/3] tracing/user_events: Simplify " Markus Elfring @ 2026-06-09 16:13 ` Steven Rostedt 2026-06-09 16:44 ` Markus Elfring 0 siblings, 1 reply; 10+ messages in thread From: Steven Rostedt @ 2026-06-09 16:13 UTC (permalink / raw) To: Markus Elfring Cc: linux-trace-kernel, Masami Hiramatsu, Mathieu Desnoyers, LKML, kernel-janitors On Thu, 4 Jun 2026 14:07:45 +0200 Markus Elfring <Markus.Elfring@web.de> wrote: > --- a/kernel/trace/trace_events_user.c > +++ b/kernel/trace/trace_events_user.c > @@ -2800,8 +2800,7 @@ static int user_seq_show(struct seq_file *m, void *p) > > mutex_unlock(&group->reg_mutex); > > - seq_puts(m, "\n"); > - seq_printf(m, "Active: %d\n", active); > + seq_printf(m, "\nActive: %d\n", active); > seq_printf(m, "Busy: %d\n", busy); This isn't a critical section and I find the original way easier to read. But the other two patches are fine. -- Steve ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] tracing/user_events: Simplify data output in user_seq_show() 2026-06-09 16:13 ` Steven Rostedt @ 2026-06-09 16:44 ` Markus Elfring 2026-06-11 12:59 ` Steven Rostedt 0 siblings, 1 reply; 10+ messages in thread From: Markus Elfring @ 2026-06-09 16:44 UTC (permalink / raw) To: Steven Rostedt, linux-trace-kernel Cc: Masami Hiramatsu, Mathieu Desnoyers, LKML, kernel-janitors >> @@ -2800,8 +2800,7 @@ static int user_seq_show(struct seq_file *m, void *p) >> >> mutex_unlock(&group->reg_mutex); >> >> - seq_puts(m, "\n"); >> - seq_printf(m, "Active: %d\n", active); >> + seq_printf(m, "\nActive: %d\n", active); >> seq_printf(m, "Busy: %d\n", busy); > > This isn't a critical section and I find the original way easier to read. Would you prefer to use a seq_putc() call instead at such a source code place? https://elixir.bootlin.com/linux/v7.1-rc7/source/kernel/trace/trace_events_user.c#L2803 > But the other two patches are fine. Thanks for another bit of positive feedback. Regards, Markus ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] tracing/user_events: Simplify data output in user_seq_show() 2026-06-09 16:44 ` Markus Elfring @ 2026-06-11 12:59 ` Steven Rostedt 2026-06-22 15:07 ` [PATCH v2 0/2] tracing/user_events: More efficient data output in two functions Markus Elfring 0 siblings, 1 reply; 10+ messages in thread From: Steven Rostedt @ 2026-06-11 12:59 UTC (permalink / raw) To: Markus Elfring Cc: linux-trace-kernel, Masami Hiramatsu, Mathieu Desnoyers, LKML, kernel-janitors On Tue, 9 Jun 2026 18:44:04 +0200 Markus Elfring <Markus.Elfring@web.de> wrote: > >> @@ -2800,8 +2800,7 @@ static int user_seq_show(struct seq_file *m, void *p) > >> > >> mutex_unlock(&group->reg_mutex); > >> > >> - seq_puts(m, "\n"); > >> - seq_printf(m, "Active: %d\n", active); > >> + seq_printf(m, "\nActive: %d\n", active); > >> seq_printf(m, "Busy: %d\n", busy); > > > > This isn't a critical section and I find the original way easier to read. > > Would you prefer to use a seq_putc() call instead at such a source code place? > https://elixir.bootlin.com/linux/v7.1-rc7/source/kernel/trace/trace_events_user.c#L2803 Sure, why not. -- Steve ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 0/2] tracing/user_events: More efficient data output in two functions 2026-06-11 12:59 ` Steven Rostedt @ 2026-06-22 15:07 ` Markus Elfring 2026-06-22 15:10 ` [PATCH v2 1/2] tracing/user_events: Use seq_putc() " Markus Elfring 2026-06-22 15:11 ` [PATCH v2 2/2] tracing/user_events: Replace a seq_printf() call by seq_puts() in user_seq_show() Markus Elfring 0 siblings, 2 replies; 10+ messages in thread From: Markus Elfring @ 2026-06-22 15:07 UTC (permalink / raw) To: linux-trace-kernel, Masami Hiramatsu, Mathieu Desnoyers, Steven Rostedt Cc: LKML, kernel-janitors From: Markus Elfring <elfring@users.sourceforge.net> Date: Mon, 22 Jun 2026 16:58:32 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Use seq_putc() in two functions Replace a seq_printf() call by seq_puts() in user_seq_show() v2: Steven Rostedt requested to use seq_putc() calls more often. kernel/trace/trace_events_user.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.54.0 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 1/2] tracing/user_events: Use seq_putc() in two functions 2026-06-22 15:07 ` [PATCH v2 0/2] tracing/user_events: More efficient data output in two functions Markus Elfring @ 2026-06-22 15:10 ` Markus Elfring 2026-06-22 15:11 ` [PATCH v2 2/2] tracing/user_events: Replace a seq_printf() call by seq_puts() in user_seq_show() Markus Elfring 1 sibling, 0 replies; 10+ messages in thread From: Markus Elfring @ 2026-06-22 15:10 UTC (permalink / raw) To: linux-trace-kernel, Masami Hiramatsu, Mathieu Desnoyers, Steven Rostedt Cc: LKML, kernel-janitors From: Markus Elfring <elfring@users.sourceforge.net> Date: Mon, 22 Jun 2026 16:37:18 +0200 Single characters should be put into a sequence. Thus use the corresponding function “seq_putc” for selected calls. The source code was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- kernel/trace/trace_events_user.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c index c4ba484f7b38..a79b7c07dabb 100644 --- a/kernel/trace/trace_events_user.c +++ b/kernel/trace/trace_events_user.c @@ -1813,7 +1813,7 @@ static int user_event_show(struct seq_file *m, struct dyn_event *ev) list_for_each_entry_reverse(field, head, link) { if (depth == 0) - seq_puts(m, " "); + seq_putc(m, ' '); else seq_puts(m, "; "); @@ -1825,7 +1825,7 @@ static int user_event_show(struct seq_file *m, struct dyn_event *ev) depth++; } - seq_puts(m, "\n"); + seq_putc(m, '\n'); return 0; } @@ -2794,13 +2794,13 @@ static int user_seq_show(struct seq_file *m, void *p) busy++; } - seq_puts(m, "\n"); + seq_putc(m, '\n'); active++; } mutex_unlock(&group->reg_mutex); - seq_puts(m, "\n"); + seq_putc(m, '\n'); seq_printf(m, "Active: %d\n", active); seq_printf(m, "Busy: %d\n", busy); -- 2.54.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 2/2] tracing/user_events: Replace a seq_printf() call by seq_puts() in user_seq_show() 2026-06-22 15:07 ` [PATCH v2 0/2] tracing/user_events: More efficient data output in two functions Markus Elfring 2026-06-22 15:10 ` [PATCH v2 1/2] tracing/user_events: Use seq_putc() " Markus Elfring @ 2026-06-22 15:11 ` Markus Elfring 1 sibling, 0 replies; 10+ messages in thread From: Markus Elfring @ 2026-06-22 15:11 UTC (permalink / raw) To: linux-trace-kernel, Masami Hiramatsu, Mathieu Desnoyers, Steven Rostedt Cc: LKML, kernel-janitors From: Markus Elfring <elfring@users.sourceforge.net> Date: Mon, 22 Jun 2026 16:42:07 +0200 A single string should be put into a sequence within a loop. Thus use the corresponding function “seq_puts” for one selected call. The source code was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- kernel/trace/trace_events_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c index a79b7c07dabb..ba9cc168280d 100644 --- a/kernel/trace/trace_events_user.c +++ b/kernel/trace/trace_events_user.c @@ -2781,7 +2781,7 @@ static int user_seq_show(struct seq_file *m, void *p) hash_for_each(group->register_table, i, user, node) { status = user->status; - seq_printf(m, "%s", EVENT_TP_NAME(user)); + seq_puts(m, EVENT_TP_NAME(user)); if (status != 0) { seq_puts(m, " # Used by"); -- 2.54.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/3] tracing/user_events: Use seq_putc() in user_seq_show() 2026-06-04 12:05 [PATCH 0/3] tracing/user_events: More efficient data output in user_seq_show() Markus Elfring 2026-06-04 12:07 ` [PATCH 1/3] tracing/user_events: Simplify " Markus Elfring @ 2026-06-04 12:10 ` Markus Elfring 2026-06-04 12:12 ` [PATCH 3/3] tracing/user_events: Replace a seq_printf() call by seq_puts() " Markus Elfring 2 siblings, 0 replies; 10+ messages in thread From: Markus Elfring @ 2026-06-04 12:10 UTC (permalink / raw) To: linux-trace-kernel, Masami Hiramatsu, Mathieu Desnoyers, Steven Rostedt Cc: LKML, kernel-janitors From: Markus Elfring <elfring@users.sourceforge.net> Date: Thu, 4 Jun 2026 13:40:38 +0200 A line break should be put into a sequence within a loop. Thus use the corresponding function “seq_putc” for one selected call. The source code was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- kernel/trace/trace_events_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c index a089ac30e407..1a0569110bfd 100644 --- a/kernel/trace/trace_events_user.c +++ b/kernel/trace/trace_events_user.c @@ -2794,7 +2794,7 @@ static int user_seq_show(struct seq_file *m, void *p) busy++; } - seq_puts(m, "\n"); + seq_putc(m, '\n'); active++; } -- 2.54.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/3] tracing/user_events: Replace a seq_printf() call by seq_puts() in user_seq_show() 2026-06-04 12:05 [PATCH 0/3] tracing/user_events: More efficient data output in user_seq_show() Markus Elfring 2026-06-04 12:07 ` [PATCH 1/3] tracing/user_events: Simplify " Markus Elfring 2026-06-04 12:10 ` [PATCH 2/3] tracing/user_events: Use seq_putc() " Markus Elfring @ 2026-06-04 12:12 ` Markus Elfring 2 siblings, 0 replies; 10+ messages in thread From: Markus Elfring @ 2026-06-04 12:12 UTC (permalink / raw) To: linux-trace-kernel, Masami Hiramatsu, Mathieu Desnoyers, Steven Rostedt Cc: LKML, kernel-janitors From: Markus Elfring <elfring@users.sourceforge.net> Date: Thu, 4 Jun 2026 13:45:48 +0200 A single string should be put into a sequence within a loop. Thus use the corresponding function “seq_puts” for one selected call. The source code was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- kernel/trace/trace_events_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c index 1a0569110bfd..57a78de4dc98 100644 --- a/kernel/trace/trace_events_user.c +++ b/kernel/trace/trace_events_user.c @@ -2781,7 +2781,7 @@ static int user_seq_show(struct seq_file *m, void *p) hash_for_each(group->register_table, i, user, node) { status = user->status; - seq_printf(m, "%s", EVENT_TP_NAME(user)); + seq_puts(m, EVENT_TP_NAME(user)); if (status != 0) { seq_puts(m, " # Used by"); -- 2.54.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-06-22 15:12 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-06-04 12:05 [PATCH 0/3] tracing/user_events: More efficient data output in user_seq_show() Markus Elfring 2026-06-04 12:07 ` [PATCH 1/3] tracing/user_events: Simplify " Markus Elfring 2026-06-09 16:13 ` Steven Rostedt 2026-06-09 16:44 ` Markus Elfring 2026-06-11 12:59 ` Steven Rostedt 2026-06-22 15:07 ` [PATCH v2 0/2] tracing/user_events: More efficient data output in two functions Markus Elfring 2026-06-22 15:10 ` [PATCH v2 1/2] tracing/user_events: Use seq_putc() " Markus Elfring 2026-06-22 15:11 ` [PATCH v2 2/2] tracing/user_events: Replace a seq_printf() call by seq_puts() in user_seq_show() Markus Elfring 2026-06-04 12:10 ` [PATCH 2/3] tracing/user_events: Use seq_putc() " Markus Elfring 2026-06-04 12:12 ` [PATCH 3/3] tracing/user_events: Replace a seq_printf() call by seq_puts() " Markus Elfring
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox