On 2026-05-21 10:56, Masami Hiramatsu (Google) wrote:
> Hi,
>
> Here is an RFC series to expose the boot ID (random UUID for each
> boot) in the last_boot_info of the persistent ring buffer instance.
>
> The persistent ring buffer can hold trace data beyond reboot/crashes.
> This means the recorded data does not always come from the last boot.
> Currently we just assume that the data comes from the last boot.
>
> On the other hand, the kernel provides a random generated UUID for
> each boot time, called "boot ID". If you record the logs with the
> boot ID, it is easy to do cross-referencing it with other logs.
>
> Similarly, recording the Boot ID for persistent ring buffer
> instances would make it easier to determine which boot the read
> data came from.
>
> For example:
>
> # cat /proc/sys/kernel/random/boot_id
> df152e7a-c0a7-4d32-9f0b-7f5c39fb7b68
>
> (enable tracing on persistent instance and reboot)
>
> # cat /sys/kernel/tracing/instances/ptracingtest/last_boot_info
> # boot_id: df152e7a-c0a7-4d32-9f0b-7f5c39fb7b68
> ffffffff81000000 [kernel]
>
FWIW, we've used boot id to uniquely identify traces belonging
to a given kernel execution and allow validation that traces
can indeed be correlated across CPU and across kernel vs userspace
for years in LTTng.
Good to see this approach proposed for Ftrace as well.
Thanks,
Mathieu
>
> Thank you,
>
> ---
>
> Masami Hiramatsu (Google) (2):
> random: Expose boot ID to other subsystems
> tracing: Record and show boot ID in last_boot_info
>
>
> drivers/char/random.c | 27 +++++++++++++++++++++------
> include/linux/random.h | 9 +++++++++
> kernel/trace/trace.c | 14 ++++++++++++--
> 3 files changed, 42 insertions(+), 8 deletions(-)
>
> --
> Masami Hiramatsu (Google) <mhiramat@kernel.org>
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com