Re: [PATCH v5 04/13] dump_stack: Add vmlinux build ID to stack traces
From: Stephen Boyd
Date: Mon Apr 26 2021 - 19:41:02 EST
Quoting Petr Mladek (2021-04-26 04:04:28)
> On Tue 2021-04-20 14:49:54, 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.
> >
> > diff --git a/include/linux/buildid.h b/include/linux/buildid.h
> > index f375900cf9ed..3b7a0ff4642f 100644
> > --- a/include/linux/buildid.h
> > +++ b/include/linux/buildid.h
> > @@ -10,7 +10,11 @@ int build_id_parse(struct vm_area_struct *vma, unsigned char *build_id,
> > __u32 *size);
> > int build_id_parse_buf(const void *buf, unsigned char *build_id, u32 buf_size);
> >
> > +#if IS_ENABLED(CONFIG_STACKTRACE_BUILD_ID) || IS_ENABLED(CONFIG_CRASH_CORE)
>
> Why is this enabled for CONFIG_CRASH_CORE, please?
>
> Is some crash_core code going to printk it id even when
> CONFIG_STACKTRACE_BUILD_ID is disabled?
>
> Anyway, this condition should be added in the patch when a code is
> really going to depend on it. Or the intention should be explained
> in the commit message at least.
Sure I'll move the latter condition to the crash patch at the end.
>
>
> > extern unsigned char vmlinux_build_id[BUILD_ID_SIZE_MAX];
> > void init_vmlinux_build_id(void);
> > +#else
> > +static inline void init_vmlinux_build_id(void) { }
> > +#endif
>
> Otherwise, the patch looks good to me.
>
Thanks.