Re: [PATCH v2 03/12] dump_stack: Add vmlinux build ID to stack traces

From: Stephen Boyd
Date: Wed Mar 24 2021 - 15:02:43 EST


Quoting Andy Shevchenko (2021-03-24 04:22:58)
> On Tue, Mar 23, 2021 at 07:04:34PM -0700, Stephen Boyd wrote:
> > Add the running kernel's build ID[1] to the stacktrace information
> > header. This makes it simpler for developers to locate the vmlinux with
> > full debuginfo for a particular kernel stacktrace. Combined with
> > scripts/decode_stracktrace.sh, a developer can download the correct
> > vmlinux from a debuginfod[2] server and find the exact file and line
> > number for the functions plus offsets in a stacktrace.
> >
> > This is especially useful for pstore crash debugging where the kernel
> > crashes are recorded in the pstore logs and the recovery kernel is
> > different or the debuginfo doesn't exist on the device due to space
> > concerns (the data can be large and a security concern). The stacktrace
> > can be analyzed after the crash by using the build ID to find the
> > matching vmlinux and understand where in the function something went
> > wrong.
> >
> > Example stacktrace from lkdtm:
>
> Can we drop the noise from the example and leave only important part(s)?

Do you mean cut after the CPU line?

>
> > WARNING: CPU: 4 PID: 3255 at drivers/misc/lkdtm/bugs.c:83 lkdtm_WARNING+0x28/0x30 [lkdtm]
> > Modules linked in: lkdtm rfcomm algif_hash algif_skcipher af_alg xt_cgroup uinput xt_MASQUERADE
> > CPU: 4 PID: 3255 Comm: bash Not tainted 5.11 #3 aa23f7a1231c229de205662d5a9e0d4c580f19a1