• Steven Rostedt (Google)'s avatar
    tracing: Handle old buffer mappings for event strings and functions · 07714b4b
    Steven Rostedt (Google) authored
    Use the saved text_delta and data_delta of a persistent memory mapped ring
    buffer that was saved from a previous boot, and use the delta in the trace
    event print output so that strings and functions show up normally.
    
    That is, for an event like trace_kmalloc() that prints the callsite via
    "%pS", if it used the address saved in the ring buffer it will not match
    the function that was saved in the previous boot if the kernel remaps
    itself between boots.
    
    For RCU events that point to saved static strings where only the address
    of the string is saved in the ring buffer, it too will be adjusted to
    point to where the string is on the current boot.
    
    Link: https://lkml.kernel.org/r/20240612232026.821020753@goodmis.org
    
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Vincent Donnefort <vdonnefort@google.com>
    Cc: Joel Fernandes <joel@joelfernandes.org>
    Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Vineeth Pillai <vineeth@bitbyteword.org>
    Cc: Youssef Esmat <youssefesmat@google.com>
    Cc: Beau Belgrave <beaub@linux.microsoft.com>
    Cc: Alexander Graf <graf@amazon.com>
    Cc: Baoquan He <bhe@redhat.com>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: "Paul E. McKenney" <paulmck@kernel.org>
    Cc: David Howells <dhowells@redhat.com>
    Cc: Mike Rapoport <rppt@kernel.org>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: Tony Luck <tony.luck@intel.com>
    Cc: Guenter Roeck <linux@roeck-us.net>
    Cc: Ross Zwisler <zwisler@google.com>
    Cc: Kees Cook <keescook@chromium.org>
    Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
    07714b4b
trace.c 263 KB