[PATCH 0/2] trace-cmd record: Handle persistent ring buffers

Steven Rostedt <[email protected]> Tue, 3 Feb 2026 20:18:04 -0500
Newsgroups org.kernel.vger.linux-trace-devel
Message-ID <[email protected]>
From: "Steven Rostedt (Google)" <[email protected]>

Now that a ring buffer instance can be from a previous boot, allow trace-cmd
to be able to read its content and still get the function names from the
addresses.

If a persistent ring buffer is from a previous boot, it will have a
"last_boot_info" file. This contains the address of the _text section of the
core kernel as well as where all the modules were loaded. This can be used
to calculate the addresses in the previous boot ring buffer to the addresses
in the current kallsyms to find out the name of the function an address
belongs to.

Also if the last_boot_info file exists, the /proc/modules file is read. This
is because functions in modules needs to have its address calculated from
where its module was loaded in the previous boot to where it is loaded in
the current boot. The last_boot_info contains the addresses of the modules
of the previous boot, and /proc/modules contains the addresses of the
modules from the current boot. With both the addresses of functions in
modules can be converted to the corresponding address in kallsyms.

Steven Rostedt (Google) (2):
  trace-cmd record: Handle last_boot_info file
  trace-cmd record: Add section for /proc/modules

 .../trace-cmd/trace-cmd.dat.v7.5.txt          | 31 +++++++++--
 .../include/private/trace-cmd-private.h       |  3 ++
 lib/trace-cmd/trace-ftrace.c                  |  4 +-
 lib/trace-cmd/trace-input.c                   | 31 +++++++++++
 lib/trace-cmd/trace-output.c                  | 32 ++++++++++++
 tracecmd/include/trace-local.h                |  2 +
 tracecmd/trace-dump.c                         | 32 ++++++++++++
 tracecmd/trace-record.c                       | 52 +++++++++++++++++++
 8 files changed, 180 insertions(+), 7 deletions(-)

-- 
2.51.0