lkml.org 
[lkml]   [2021]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v4 07/13] x86/dumpstack: Use %pSb/%pBb for backtrace printing
    Date
    Let's use the new printk formats to print the stacktrace entries when
    printing a backtrace to the kernel logs. This will include any module's
    build ID[1] in it so that offline/crash debugging can easily locate the
    debuginfo for a module via something like debuginfod[2].

    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: <x86@kernel.org>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Alexei Starovoitov <ast@kernel.org>
    Cc: Jessica Yu <jeyu@kernel.org>
    Cc: Evan Green <evgreen@chromium.org>
    Cc: Hsin-Yi Wang <hsinyi@chromium.org>
    Cc: Petr Mladek <pmladek@suse.com>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Link: https://fedoraproject.org/wiki/Releases/FeatureBuildId [1]
    Link: https://sourceware.org/elfutils/Debuginfod.html [2]
    Signed-off-by: Stephen Boyd <swboyd@chromium.org>
    ---
    arch/x86/kernel/dumpstack.c | 6 +++---
    1 file changed, 3 insertions(+), 3 deletions(-)

    diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
    index 299c20f0a38b..be2de39bf16f 100644
    --- a/arch/x86/kernel/dumpstack.c
    +++ b/arch/x86/kernel/dumpstack.c
    @@ -69,7 +69,7 @@ static void printk_stack_address(unsigned long address, int reliable,
    const char *log_lvl)
    {
    touch_nmi_watchdog();
    - printk("%s %s%pB\n", log_lvl, reliable ? "" : "? ", (void *)address);
    + printk("%s %s%pBb\n", log_lvl, reliable ? "" : "? ", (void *)address);
    }

    static int copy_code(struct pt_regs *regs, u8 *buf, unsigned long src,
    @@ -143,9 +143,9 @@ void show_opcodes(struct pt_regs *regs, const char *loglvl)
    void show_ip(struct pt_regs *regs, const char *loglvl)
    {
    #ifdef CONFIG_X86_32
    - printk("%sEIP: %pS\n", loglvl, (void *)regs->ip);
    + printk("%sEIP: %pSb\n", loglvl, (void *)regs->ip);
    #else
    - printk("%sRIP: %04x:%pS\n", loglvl, (int)regs->cs, (void *)regs->ip);
    + printk("%sRIP: %04x:%pSb\n", loglvl, (int)regs->cs, (void *)regs->ip);
    #endif
    show_opcodes(regs, loglvl);
    }
    --
    https://chromeos.dev
    \
     
     \ /
      Last update: 2021-04-10 03:53    [W:2.781 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site