Re: [PATCH] ring-buffer/Documentation: Add documentation on buffer_percent file

From: Steven Rostedt
Date: Tue Dec 26 2023 - 12:51:18 EST



Jon,

I was about to ask if you can take this through your tree, but then I did a
self edit :-p

On Tue, 26 Dec 2023 12:35:25 -0500
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>
>
> When the buffer_percent file was added to the kernel, the documentation
> should have been updated to document what that file does.
>
> Fixes: 03329f9939781 ("tracing: Add tracefs file buffer_percentage")
> Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
> ---
> Documentation/trace/ftrace.rst | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst
> index 933e7efb9f1b..16eabb00fa55 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 water-mark for how much the ring buffer needs to be filled
> + before a waiter is woken up. That is, if an application call a

"calls"

> + 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 splice system calls are blocked on this file.

"the splice system"

> +
> + 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

Will send a v2.

-- Steve