show_trace_log_lvl() provides x86 platform-specific way to unwind backtrace with a given log level. Unfortunately, registers dump(s) are not printed with the same log level - instead, KERN_DEFAULT is always used.
Arista's switches uses quite common setup with rsyslog, where only urgent messages goes to console (console_log_level=KERN_ERR), everything else goes into /var/log/ as the console baud-rate often is indecently slow (9600 bps). Backtrace dumps without registers printed have proven to be as useful as morning standups. Furthermore, in order to introduce KERN_UNSUPPRESSED (which I believe is still the most elegant way to fix raciness of sysrq[1]) the log level should be passed down the stack to register dumping functions. Besides, I have a potential use-case for printing traces with KERN_DEBUG level [2] (where registers dump shouldn't appear with higher log level than the backtrace). Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jann Horn <[email protected]> Cc: Petr Mladek <[email protected]> Cc: Sergey Senozhatsky <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Tetsuo Handa <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] [1]: https://lore.kernel.org/lkml/[email protected]/ [2]: https://lore.kernel.org/linux-doc/[email protected]/ Dmitry Safonov (3): x86/dumpstack: Add log_lvl to show_iret_regs() x86/dumpstack: Add log_lvl to __show_regs() x86/dumpstack: Show registers dump with trace's log level arch/x86/include/asm/kdebug.h | 5 ++-- arch/x86/kernel/dumpstack.c | 23 +++++++++------- arch/x86/kernel/process_32.c | 29 ++++++++++---------- arch/x86/kernel/process_64.c | 51 ++++++++++++++++++----------------- 4 files changed, 57 insertions(+), 51 deletions(-) -- 2.27.0

