* [PATCH] ring-buffer: Removed unnecessary if() goto out where out is the next line
@ 2025-05-27 19:51 Steven Rostedt
2025-05-28 0:34 ` Masami Hiramatsu
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2025-05-27 19:51 UTC (permalink / raw)
To: LKML, Linux Trace Kernel; +Cc: Masami Hiramatsu, Mathieu Desnoyers
From: Steven Rostedt <rostedt@goodmis.org>
In the function ring_buffer_discard_commit() there's an if statement that
jumps to the next line:
if (rb_try_to_discard(cpu_buffer, event))
goto out;
out:
This was caused by the change that modified the way timestamps were taken
in interrupt context, and removed the code between the if statement and
the goto, but failed to update the conditional logic.
Fixes: a389d86f7fd0 ("ring-buffer: Have nested events still record running time stamp")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
kernel/trace/ring_buffer.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index e2aa90dc8d9e..0a3be3a01d14 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -4681,10 +4681,7 @@ void ring_buffer_discard_commit(struct trace_buffer *buffer,
RB_WARN_ON(buffer, !local_read(&cpu_buffer->committing));
rb_decrement_entry(cpu_buffer, event);
- if (rb_try_to_discard(cpu_buffer, event))
- goto out;
-
- out:
+ rb_try_to_discard(cpu_buffer, event);
rb_end_commit(cpu_buffer);
trace_recursive_unlock(cpu_buffer);
--
2.47.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ring-buffer: Removed unnecessary if() goto out where out is the next line
2025-05-27 19:51 [PATCH] ring-buffer: Removed unnecessary if() goto out where out is the next line Steven Rostedt
@ 2025-05-28 0:34 ` Masami Hiramatsu
2025-05-28 16:30 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Masami Hiramatsu @ 2025-05-28 0:34 UTC (permalink / raw)
To: Steven Rostedt
Cc: LKML, Linux Trace Kernel, Masami Hiramatsu, Mathieu Desnoyers
On Tue, 27 May 2025 15:51:16 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
>
> In the function ring_buffer_discard_commit() there's an if statement that
> jumps to the next line:
>
> if (rb_try_to_discard(cpu_buffer, event))
> goto out;
> out:
>
> This was caused by the change that modified the way timestamps were taken
> in interrupt context, and removed the code between the if statement and
> the goto, but failed to update the conditional logic.
>
OK, so this is a kind of cleanup.
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Thanks,
> Fixes: a389d86f7fd0 ("ring-buffer: Have nested events still record running time stamp")
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> kernel/trace/ring_buffer.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index e2aa90dc8d9e..0a3be3a01d14 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -4681,10 +4681,7 @@ void ring_buffer_discard_commit(struct trace_buffer *buffer,
> RB_WARN_ON(buffer, !local_read(&cpu_buffer->committing));
>
> rb_decrement_entry(cpu_buffer, event);
> - if (rb_try_to_discard(cpu_buffer, event))
> - goto out;
> -
> - out:
> + rb_try_to_discard(cpu_buffer, event);
> rb_end_commit(cpu_buffer);
>
> trace_recursive_unlock(cpu_buffer);
> --
> 2.47.2
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ring-buffer: Removed unnecessary if() goto out where out is the next line
2025-05-28 0:34 ` Masami Hiramatsu
@ 2025-05-28 16:30 ` Steven Rostedt
0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2025-05-28 16:30 UTC (permalink / raw)
To: Masami Hiramatsu (Google); +Cc: LKML, Linux Trace Kernel, Mathieu Desnoyers
On Wed, 28 May 2025 09:34:55 +0900
Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:
> OK, so this is a kind of cleanup.
Correct, which is why I only added a "Fixes" tag but not a "stable" tag.
If someone wants to backport this, let them ;-)
>
> Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Thanks,
-- Steve
>
> Thanks,
>
> > Fixes: a389d86f7fd0 ("ring-buffer: Have nested events still record running time stamp")
> > Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-28 16:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-27 19:51 [PATCH] ring-buffer: Removed unnecessary if() goto out where out is the next line Steven Rostedt
2025-05-28 0:34 ` Masami Hiramatsu
2025-05-28 16:30 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).