All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] docs: ftrace: Specifies when buffers get clear
@ 2019-12-18 19:15 Frank A. Cancio Bello
  2019-12-18 19:33 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Frank A. Cancio Bello @ 2019-12-18 19:15 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar, Jonathan Corbet, linux-doc, linux-kernel
  Cc: joel, nachukannan, saiprakash.ranjan

Clarify a few places where the ring buffer and the "snapshot" buffer
are cleared as a side effect of an operation.

This will avoid users lost of tracing data because of these so far
undocumented behavior.

Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com>
---
Changes in v2:
  - Per Steven comment correct the fact that the "snapshot" buffer is
    not touched when writing in the "trace" file.
  - Use tab instead of spaces for alignment.

 Documentation/trace/ftrace.rst | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst
index d2b5657ed33e..46df39300d22 100644
--- a/Documentation/trace/ftrace.rst
+++ b/Documentation/trace/ftrace.rst
@@ -95,7 +95,8 @@ of ftrace. Here is a list of some of the key files:
   current_tracer:
 
 	This is used to set or display the current tracer
-	that is configured.
+	that is configured. Changing the current tracer clears
+	the ring buffer content as well as the "snapshot" buffer.
 
   available_tracers:
 
@@ -126,7 +127,8 @@ of ftrace. Here is a list of some of the key files:
 	This file holds the output of the trace in a human
 	readable format (described below). Note, tracing is temporarily
 	disabled when the file is open for reading. Once all readers
-	are closed, tracing is re-enabled.
+	are closed, tracing is re-enabled. Opening this file for
+	writing with the O_TRUNC flag clears the ring buffer content.
 
   trace_pipe:
 
@@ -490,6 +492,9 @@ of ftrace. Here is a list of some of the key files:
 
 	  # echo global > trace_clock
 
+	Setting a clock clears the ring buffer content as well as the
+	"snapshot" buffer.
+
   trace_marker:
 
 	This is a very useful file for synchronizing user space
-- 
2.17.1


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

* Re: [PATCH v2] docs: ftrace: Specifies when buffers get clear
  2019-12-18 19:15 [PATCH v2] docs: ftrace: Specifies when buffers get clear Frank A. Cancio Bello
@ 2019-12-18 19:33 ` Steven Rostedt
  2019-12-18 19:38   ` Jonathan Corbet
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2019-12-18 19:33 UTC (permalink / raw)
  To: Frank A. Cancio Bello
  Cc: Ingo Molnar, Jonathan Corbet, linux-doc, linux-kernel, joel,
	nachukannan, saiprakash.ranjan

On Wed, 18 Dec 2019 14:15:53 -0500
"Frank A. Cancio Bello" <frank@generalsoftwareinc.com> wrote:

> Clarify a few places where the ring buffer and the "snapshot" buffer
> are cleared as a side effect of an operation.
> 
> This will avoid users lost of tracing data because of these so far
> undocumented behavior.
> 
> Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com>

Thanks for the update.

Jon, do you want to take this?

Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

> ---
> Changes in v2:
>   - Per Steven comment correct the fact that the "snapshot" buffer is
>     not touched when writing in the "trace" file.
>   - Use tab instead of spaces for alignment.
> 
>  Documentation/trace/ftrace.rst | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst
> index d2b5657ed33e..46df39300d22 100644
> --- a/Documentation/trace/ftrace.rst
> +++ b/Documentation/trace/ftrace.rst
> @@ -95,7 +95,8 @@ of ftrace. Here is a list of some of the key files:
>    current_tracer:
>  
>  	This is used to set or display the current tracer
> -	that is configured.
> +	that is configured. Changing the current tracer clears
> +	the ring buffer content as well as the "snapshot" buffer.
>  
>    available_tracers:
>  
> @@ -126,7 +127,8 @@ of ftrace. Here is a list of some of the key files:
>  	This file holds the output of the trace in a human
>  	readable format (described below). Note, tracing is temporarily
>  	disabled when the file is open for reading. Once all readers
> -	are closed, tracing is re-enabled.
> +	are closed, tracing is re-enabled. Opening this file for
> +	writing with the O_TRUNC flag clears the ring buffer content.
>  
>    trace_pipe:
>  
> @@ -490,6 +492,9 @@ of ftrace. Here is a list of some of the key files:
>  
>  	  # echo global > trace_clock
>  
> +	Setting a clock clears the ring buffer content as well as the
> +	"snapshot" buffer.
> +
>    trace_marker:
>  
>  	This is a very useful file for synchronizing user space


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

* Re: [PATCH v2] docs: ftrace: Specifies when buffers get clear
  2019-12-18 19:33 ` Steven Rostedt
@ 2019-12-18 19:38   ` Jonathan Corbet
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Corbet @ 2019-12-18 19:38 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Frank A. Cancio Bello, Ingo Molnar, linux-doc, linux-kernel,
	joel, nachukannan, saiprakash.ranjan

On Wed, 18 Dec 2019 14:33:51 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> Jon, do you want to take this?

Sure, will do.

jon

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

end of thread, other threads:[~2019-12-18 19:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 19:15 [PATCH v2] docs: ftrace: Specifies when buffers get clear Frank A. Cancio Bello
2019-12-18 19:33 ` Steven Rostedt
2019-12-18 19:38   ` Jonathan Corbet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.