• Steven Rostedt's avatar
    tracing: Have trace_printk not use binary prints if boot buffer · 9b7bdf6f
    Steven Rostedt authored
    If the persistent boot mapped ring buffer is used for trace_printk(),
    force it to not use the binary versions. trace_printk() by default uses
    bin_printf() that only saves the pointer to the format and not the format
    itself inside the ring buffer. But for a persistent buffer that is read
    after reboot, the pointers to the format strings may not be the same, or
    worse, not even exist! Instead, just force the more robust, but slower,
    version that does the formatting before saving into the ring buffer.
    
    The boot mapped buffer can now be used for trace_printk and friends!
    
    Using the trace_printk() and the persistent buffer was used to debug the
    issue with the osnoise tracer:
    
    Link: https://lore.kernel.org/all/20240822103443.6a6ae051@gandalf.local.home/
    
    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: Ingo Molnar <mingo@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Vineeth Pillai <vineeth@bitbyteword.org>
    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>
    Cc: Alexander Aring <aahringo@redhat.com>
    Cc: "Luis Claudio R. Goncalves" <lgoncalv@redhat.com>
    Cc: Tomas Glozar <tglozar@redhat.com>
    Cc: John Kacur <jkacur@redhat.com>
    Cc: Clark Williams <williams@redhat.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: "Jonathan Corbet" <corbet@lwn.net>
    Link: https://lore.kernel.org/20240823014019.386925800@goodmis.orgSigned-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
    9b7bdf6f
trace_output.c 39.1 KB