[PATCH v7 0/4] tracing: Remove backup instance after read all

From: Masami Hiramatsu (Google)

Date: Mon Feb 09 2026 - 04:25:34 EST


Hi,

Here is the v7 of the series to improve backup instances of
the persistent ring buffer. The previous version is here:

https://lore.kernel.org/all/176991653525.4025429.12655335935351822711.stgit@xxxxxxxxxxxxxxxxxxxxxxxxxxxx/

This version is rebased on the latest linux-trace/for-next,
remove update_last_data_if_empty() from snapshot file [1/4] and,
use -EACCES instead of -EPERM.

Series Description
------------------
Since backup instances are a kind of snapshot of the persistent
ring buffer, it should be readonly. And if it is readonly
there is no reason to keep it after reading all data via trace_pipe
because the data has been consumed. But user should be able to remove
the readonly instance by rmdir or truncating `trace` file.

Thus, [2/4] makes backup instances readonly (not able to write any
events, cleanup trace, change buffer size). Also, [3/4] removes the
backup instance after consuming all data via trace_pipe.
With this improvements, even if we makes a backup instance (using
the same amount of memory of the persistent ring buffer), it will
be removed after reading the data automatically.

---

Masami Hiramatsu (Google) (4):
tracing: Reset last_boot_info if ring buffer is reset
tracing: Make the backup instance non-reusable
tracing: Remove the backup instance automatically after read
tracing/Documentation: Add a section about backup instance


Documentation/trace/debugging.rst | 19 ++++
kernel/trace/trace.c | 161 ++++++++++++++++++++++++++++++-------
kernel/trace/trace.h | 13 +++
kernel/trace/trace_boot.c | 5 +
kernel/trace/trace_events.c | 76 ++++++++++-------
5 files changed, 208 insertions(+), 66 deletions(-)

--
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>