[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <161786512790.3790633.16827318365663068135@swboyd.mtv.corp.google.com>
Date: Wed, 07 Apr 2021 23:58:47 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: Petr Mladek <pmladek@...e.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Jiri Olsa <jolsa@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Jessica Yu <jeyu@...nel.org>,
Evan Green <evgreen@...omium.org>,
Hsin-Yi Wang <hsinyi@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
linux-doc@...r.kernel.org, Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH v3 04/12] module: Add printk format to add module build ID to stacktraces
Quoting Petr Mladek (2021-04-07 08:03:47)
> On Tue 2021-03-30 20:05:12, Stephen Boyd wrote:
> > Let's make kernel stacktraces easier to identify by including the build
> > ID[1] of a module if the stacktrace is printing a symbol from a module.
> > This makes it simpler for developers to locate a kernel module's full
> > debuginfo for a particular stacktrace. Combined with
> > scripts/decode_stracktrace.sh, a developer can download the matching
> > debuginfo from a debuginfod[2] server and find the exact file and line
> > number for the functions plus offsets in a stacktrace that match the
> > module. This is especially useful for pstore crash debugging where the
> > kernel crashes are recorded in something like console-ramoops and the
> > recovery kernel/modules are different or the debuginfo doesn't exist on
> > the device due to space concerns (the debuginfo can be too large for
> > space limited devices).
> >
> > @@ -359,15 +369,17 @@ int lookup_symbol_attrs(unsigned long addr, unsigned long *size,
> >
> > /* Look up a kernel symbol and return it in a text buffer. */
> > static int __sprint_symbol(char *buffer, unsigned long address,
> > - int symbol_offset, int add_offset)
> > + int symbol_offset, int add_offset, int add_buildid)
> > {
> > char *modname;
> > + const unsigned char *buildid;
> > const char *name;
> > unsigned long offset, size;
> > int len;
> >
> > address += symbol_offset;
> > - name = kallsyms_lookup(address, &size, &offset, &modname, buffer);
> > + name = kallsyms_lookup_buildid(address, &size, &offset, &modname, &buildid,
> > + buffer);
> > if (!name)
> > return sprintf(buffer, "0x%lx", address - symbol_offset);
> >
> > @@ -379,8 +391,12 @@ static int __sprint_symbol(char *buffer, unsigned long address,
> > if (add_offset)
> > len += sprintf(buffer + len, "+%#lx/%#lx", offset, size);
>
> Please add something like:
>
> /* Keep BUILD_ID_SIZE_MAX in sync with the below used %20phN */
> BUILD_BUG_ON(BUILD_ID_SIZE_MAX != 20)
>
Done. Hopefully the "GNU" string check also fixes this module problem
you're seeing.
Powered by blists - more mailing lists