* [PATCH] ring-buffer: Remove stale comment from ring_buffer_size()
@ 2023-12-20 13:10 Steven Rostedt
2023-12-20 14:27 ` Masami Hiramatsu
0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2023-12-20 13:10 UTC (permalink / raw)
To: LKML, Linux Trace Kernel
Cc: Masami Hiramatsu, Mark Rutland, Mathieu Desnoyers, David Laight
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
It's been 11 years since the ring_buffer_size() function was updated to
use the nr_pages from the buffer->buffers[cpu] structure instead of using
the buffer->nr_pages that no longer exists.
The comment in the code is more of what a change log should have and is
pretty much useless for development. It's saying how things worked back in
2012 that bares no purpose on today's code. Remove it.
Link: https://lore.kernel.org/linux-trace-kernel/84d3b41a72bd43dbb9d44921ef535c92@AcuMS.aculab.com/
Reported-by: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
kernel/trace/ring_buffer.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 173d2595ce2d..7887d61d5b56 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -5122,12 +5122,6 @@ EXPORT_SYMBOL_GPL(ring_buffer_iter_advance);
*/
unsigned long ring_buffer_size(struct trace_buffer *buffer, int cpu)
{
- /*
- * Earlier, this method returned
- * buffer->subbuf_size * buffer->nr_pages
- * Since the nr_pages field is now removed, we have converted this to
- * return the per cpu buffer value.
- */
if (!cpumask_test_cpu(cpu, buffer->cpumask))
return 0;
--
2.42.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ring-buffer: Remove stale comment from ring_buffer_size()
2023-12-20 13:10 [PATCH] ring-buffer: Remove stale comment from ring_buffer_size() Steven Rostedt
@ 2023-12-20 14:27 ` Masami Hiramatsu
0 siblings, 0 replies; 2+ messages in thread
From: Masami Hiramatsu @ 2023-12-20 14:27 UTC (permalink / raw)
To: Steven Rostedt
Cc: LKML, Linux Trace Kernel, Masami Hiramatsu, Mark Rutland,
Mathieu Desnoyers, David Laight
On Wed, 20 Dec 2023 08:10:28 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
>
> It's been 11 years since the ring_buffer_size() function was updated to
> use the nr_pages from the buffer->buffers[cpu] structure instead of using
> the buffer->nr_pages that no longer exists.
>
> The comment in the code is more of what a change log should have and is
> pretty much useless for development. It's saying how things worked back in
> 2012 that bares no purpose on today's code. Remove it.
>
> Link: https://lore.kernel.org/linux-trace-kernel/84d3b41a72bd43dbb9d44921ef535c92@AcuMS.aculab.com/
>
Looks good to me.
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Thanks,
> Reported-by: David Laight <David.Laight@ACULAB.COM>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> kernel/trace/ring_buffer.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index 173d2595ce2d..7887d61d5b56 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -5122,12 +5122,6 @@ EXPORT_SYMBOL_GPL(ring_buffer_iter_advance);
> */
> unsigned long ring_buffer_size(struct trace_buffer *buffer, int cpu)
> {
> - /*
> - * Earlier, this method returned
> - * buffer->subbuf_size * buffer->nr_pages
> - * Since the nr_pages field is now removed, we have converted this to
> - * return the per cpu buffer value.
> - */
> if (!cpumask_test_cpu(cpu, buffer->cpumask))
> return 0;
>
> --
> 2.42.0
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-20 14:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-20 13:10 [PATCH] ring-buffer: Remove stale comment from ring_buffer_size() Steven Rostedt
2023-12-20 14:27 ` Masami Hiramatsu
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).