[PATCH v5 4/4] tracing/Documentation: Add a section about backup instance

Masami Hiramatsu (Google) posted 4 patches 1 week, 6 days ago
There is a newer version of this series
[PATCH v5 4/4] tracing/Documentation: Add a section about backup instance
Posted by Masami Hiramatsu (Google) 1 week, 6 days ago
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Add a section about backup instance to the debugging.rst.

Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
 Documentation/trace/debugging.rst |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/Documentation/trace/debugging.rst b/Documentation/trace/debugging.rst
index 4d88c346fc38..73e2154bcf98 100644
--- a/Documentation/trace/debugging.rst
+++ b/Documentation/trace/debugging.rst
@@ -159,3 +159,22 @@ If setting it from the kernel command line, it is recommended to also
 disable tracing with the "traceoff" flag, and enable tracing after boot up.
 Otherwise the trace from the most recent boot will be mixed with the trace
 from the previous boot, and may make it confusing to read.
+
+Using a backup instance for keeping previous boot data
+------------------------------------------------------
+
+It is also possible to record trace data at system boot time by specifying
+events with the persistent ring buffer, but in this case the data before the
+reboot will be lost before it can be read. This problem can be solved by a
+backup instance. From the kernel command line::
+
+  reserve_mem=12M:4096:trace trace_instance=boot_map@trace,sched,irq trace_instance=backup=boot_map
+
+When the boot up, the previous data in the`boot_map` is copied to "backup"
+instance, and the "sched:*" and "irq:*" events for current boot are traced on
+"boot_map". Thus user can read the previous boot data from the "backup" instance
+without stopping trace.
+
+Note that this "backup" instance is readonly, and will be removed automatically
+if you clear the trace data or read out all trace data from "trace_pipe" or
+"trace_pipe_raw" files.
\ No newline at end of file
Re: [PATCH v5 4/4] tracing/Documentation: Add a section about backup instance
Posted by Steven Rostedt 1 week, 4 days ago
On Wed, 28 Jan 2026 09:10:11 +0900
"Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:

> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Add a section about backup instance to the debugging.rst.
> 
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> ---
>  Documentation/trace/debugging.rst |   19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/Documentation/trace/debugging.rst b/Documentation/trace/debugging.rst
> index 4d88c346fc38..73e2154bcf98 100644
> --- a/Documentation/trace/debugging.rst
> +++ b/Documentation/trace/debugging.rst
> @@ -159,3 +159,22 @@ If setting it from the kernel command line, it is recommended to also
>  disable tracing with the "traceoff" flag, and enable tracing after boot up.
>  Otherwise the trace from the most recent boot will be mixed with the trace
>  from the previous boot, and may make it confusing to read.
> +
> +Using a backup instance for keeping previous boot data
> +------------------------------------------------------
> +
> +It is also possible to record trace data at system boot time by specifying
> +events with the persistent ring buffer, but in this case the data before the
> +reboot will be lost before it can be read. This problem can be solved by a
> +backup instance. From the kernel command line::
> +
> +  reserve_mem=12M:4096:trace trace_instance=boot_map@trace,sched,irq trace_instance=backup=boot_map
> +
> +When the boot up, the previous data in the`boot_map` is copied to "backup"

  s/When the boot up/On boot up/                   copied to the "backup"

> +instance, and the "sched:*" and "irq:*" events for current boot are traced on

                                                  for the current boot are traced in


> +"boot_map". Thus user can read the previous boot data from the "backup" instance

               Thus the user

> +without stopping trace.

           stopping the trace.

> +
> +Note that this "backup" instance is readonly, and will be removed automatically
> +if you clear the trace data or read out all trace data from "trace_pipe" or
> +"trace_pipe_raw" files.
> \ No newline at end of file

Definite articles are a pain ;-)

-- Steve
Re: [PATCH v5 4/4] tracing/Documentation: Add a section about backup instance
Posted by Masami Hiramatsu (Google) 1 week, 3 days ago
On Thu, 29 Jan 2026 15:19:00 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Wed, 28 Jan 2026 09:10:11 +0900
> "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:
> 
> > From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> > 
> > Add a section about backup instance to the debugging.rst.
> > 
> > Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> > ---
> >  Documentation/trace/debugging.rst |   19 +++++++++++++++++++
> >  1 file changed, 19 insertions(+)
> > 
> > diff --git a/Documentation/trace/debugging.rst b/Documentation/trace/debugging.rst
> > index 4d88c346fc38..73e2154bcf98 100644
> > --- a/Documentation/trace/debugging.rst
> > +++ b/Documentation/trace/debugging.rst
> > @@ -159,3 +159,22 @@ If setting it from the kernel command line, it is recommended to also
> >  disable tracing with the "traceoff" flag, and enable tracing after boot up.
> >  Otherwise the trace from the most recent boot will be mixed with the trace
> >  from the previous boot, and may make it confusing to read.
> > +
> > +Using a backup instance for keeping previous boot data
> > +------------------------------------------------------
> > +
> > +It is also possible to record trace data at system boot time by specifying
> > +events with the persistent ring buffer, but in this case the data before the
> > +reboot will be lost before it can be read. This problem can be solved by a
> > +backup instance. From the kernel command line::
> > +
> > +  reserve_mem=12M:4096:trace trace_instance=boot_map@trace,sched,irq trace_instance=backup=boot_map
> > +
> > +When the boot up, the previous data in the`boot_map` is copied to "backup"
> 
>   s/When the boot up/On boot up/                   copied to the "backup"

Ah, thanks,

> 
> > +instance, and the "sched:*" and "irq:*" events for current boot are traced on
> 
>                                                   for the current boot are traced in
> 
> 
> > +"boot_map". Thus user can read the previous boot data from the "backup" instance

   ^ the "boot_map".

> 
>                Thus the user
> 
> > +without stopping trace.
> 
>            stopping the trace.

OK.

> 
> > +
> > +Note that this "backup" instance is readonly, and will be removed automatically
> > +if you clear the trace data or read out all trace data from "trace_pipe" or
> > +"trace_pipe_raw" files.
> > \ No newline at end of file
> 
> Definite articles are a pain ;-)

Thanks!

> 
> -- Steve


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>
Re: [PATCH v5 4/4] tracing/Documentation: Add a section about backup instance
Posted by Steven Rostedt 1 week, 3 days ago
On Fri, 30 Jan 2026 22:24:49 +0900
Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:
> > > +
> > > +When the boot up, the previous data in the`boot_map` is copied to "backup"  
> > 
> >   s/When the boot up/On boot up/                   copied to the "backup"  
> 
> Ah, thanks,
> 
> >   
> > > +instance, and the "sched:*" and "irq:*" events for current boot are traced on  
> > 
> >                                                   for the current boot are traced in
> > 
> >   
> > > +"boot_map". Thus user can read the previous boot data from the "backup" instance  
> 
>    ^ the "boot_map".

Nope ;-)  In this case, leaving out the "the" is appropriate. Now you would
need article if it was: the "boot_map" instance

But because you left out "instance" you don't need the article, as
"boot_map" is a name of an object and doesn't need the article when used by
itself.

You wouldn't use an article with:

  The code was written by Steven.

But you would if you said:

  The code was written by the Steven person.

 ;-)

> > 
> > Definite articles are a pain ;-)  

As I said. Definite articles in English are a pain ;)

-- Steve
Re: [PATCH v5 4/4] tracing/Documentation: Add a section about backup instance
Posted by Steven Rostedt 1 week, 3 days ago
On Fri, 30 Jan 2026 09:23:29 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> Nope ;-)  In this case, leaving out the "the" is appropriate. Now you would
> need article if it was: the "boot_map" instance

  "need the article"

God, I can't even get it right :-p

-- Steve