linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] ring-buffer/Documentation: Add documentation on buffer_percent file
@ 2023-12-29 17:24 Steven Rostedt
  2023-12-31  4:39 ` Randy Dunlap
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2023-12-29 17:24 UTC (permalink / raw)
  To: LKML, Linux Trace Kernel, linux-doc, Jonathan Corbet
  Cc: Masami Hiramatsu, Mathieu Desnoyers, Randy Dunlap

From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

When the buffer_percent file was added to the kernel, the documentation
should have been updated to document what that file does.

Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Fixes: 03329f9939781 ("tracing: Add tracefs file buffer_percentage")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
Changes since v2: https://lore.kernel.org/linux-trace-kernel/20231226130149.4685c838@gandalf.local.home

- s/watermark/water-mark/ (Randy Dunlap)

- Added '::' and indented the number list so that it has better
  formatting (kernel test robot)

 Documentation/trace/ftrace.rst | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst
index 933e7efb9f1b..917501a2f348 100644
--- a/Documentation/trace/ftrace.rst
+++ b/Documentation/trace/ftrace.rst
@@ -180,6 +180,21 @@ of ftrace. Here is a list of some of the key files:
 	Only active when the file contains a number greater than 0.
 	(in microseconds)
 
+  buffer_percent:
+
+	This is the watermark for how much the ring buffer needs to be filled
+	before a waiter is woken up. That is, if an application calls a
+	blocking read syscall on one of the per_cpu trace_pipe_raw files, it
+	will block until the given amount of data specified by buffer_percent
+	is in the ring buffer before it wakes the reader up. This also
+	controls how the splice system calls are blocked on this file::
+
+	  0   - means to wake up as soon as there is any data in the ring buffer.
+	  50  - means to wake up when roughly half of the ring buffer sub-buffers
+	        are full.
+	  100 - means to block until the ring buffer is totally full and is
+	        about to start overwriting the older data.
+
   buffer_size_kb:
 
 	This sets or displays the number of kilobytes each CPU
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] ring-buffer/Documentation: Add documentation on buffer_percent file
  2023-12-29 17:24 [PATCH v3] ring-buffer/Documentation: Add documentation on buffer_percent file Steven Rostedt
@ 2023-12-31  4:39 ` Randy Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: Randy Dunlap @ 2023-12-31  4:39 UTC (permalink / raw)
  To: Steven Rostedt, LKML, Linux Trace Kernel, linux-doc,
	Jonathan Corbet
  Cc: Masami Hiramatsu, Mathieu Desnoyers



On 12/29/23 09:24, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> 
> When the buffer_percent file was added to the kernel, the documentation
> should have been updated to document what that file does.
> 
> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> Fixes: 03329f9939781 ("tracing: Add tracefs file buffer_percentage")
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

LGTM. Thanks.
Acked-by: Randy Dunlap <rdunlap@infradead.org>

> ---
> Changes since v2: https://lore.kernel.org/linux-trace-kernel/20231226130149.4685c838@gandalf.local.home
> 
> - s/watermark/water-mark/ (Randy Dunlap)

That comment is backwards. :)
No new patch needed IMO.

> 
> - Added '::' and indented the number list so that it has better
>   formatting (kernel test robot)
> 
>  Documentation/trace/ftrace.rst | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst
> index 933e7efb9f1b..917501a2f348 100644
> --- a/Documentation/trace/ftrace.rst
> +++ b/Documentation/trace/ftrace.rst
> @@ -180,6 +180,21 @@ of ftrace. Here is a list of some of the key files:
>  	Only active when the file contains a number greater than 0.
>  	(in microseconds)
>  
> +  buffer_percent:
> +
> +	This is the watermark for how much the ring buffer needs to be filled
> +	before a waiter is woken up. That is, if an application calls a
> +	blocking read syscall on one of the per_cpu trace_pipe_raw files, it
> +	will block until the given amount of data specified by buffer_percent
> +	is in the ring buffer before it wakes the reader up. This also
> +	controls how the splice system calls are blocked on this file::
> +
> +	  0   - means to wake up as soon as there is any data in the ring buffer.
> +	  50  - means to wake up when roughly half of the ring buffer sub-buffers
> +	        are full.
> +	  100 - means to block until the ring buffer is totally full and is
> +	        about to start overwriting the older data.
> +
>    buffer_size_kb:
>  
>  	This sets or displays the number of kilobytes each CPU

-- 
#Randy

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-31  4:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-29 17:24 [PATCH v3] ring-buffer/Documentation: Add documentation on buffer_percent file Steven Rostedt
2023-12-31  4:39 ` Randy Dunlap

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).