Re: [PATCH 1/5] core: Add method to get the vmlinux BTF filename, allow overriding it via env var

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 19, 2024 at 10:24:14AM -0800, Eduard Zingerman wrote:
> On Mon, 2024-11-18 at 17:41 -0300, Arnaldo Carvalho de Melo wrote:
> > From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> > 
> > In systems where BTF isn't available there were reports that the
> > simplest pahole call, without any args, segfaults.
> > 
> > To have a proper test before fixing this problem, allow overriding the
> > /sys/kernel/btf/vmlinux filename, so that even in systems with BTF we an
> > point it to a invalid location, making pahole think that there is no BTF
> > available and thus fallback to something that currently segfaults.
> > 
> > Using it:
> > 
> >   $ pahole list_head
> >   struct list_head {
> >   	struct list_head *         next;                 /*     0     8 */
> >   	struct list_head *         prev;                 /*     8     8 */
> > 
> >   	/* size: 16, cachelines: 1, members: 2 */
> >   	/* last cacheline: 16 bytes */
> >   };
> >   $
> >   $ PAHOLE_VMLINUX_BTF_FILENAME=foobar pahole list_head
> >   Segmentation fault (core dumped)
> >   $
> > 
> > Reported-by: Matthias Schwarzott <zzam@xxxxxxxxxx>
> > Cc: Alan Maguire <alan.maguire@xxxxxxxxxx>
> > Cc: Andrii Nakryiko <andrii@xxxxxxxxxx>
> > Cc: Eduard Zingerman <eddyz87@xxxxxxxxx>
> > Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
> > Cc: Song Liu <song@xxxxxxxxxx>
> > Cc: Yonghong Song <yonghong.song@xxxxxxxxx>
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> > ---
> 
> Lgtm, tried setting PAHOLE_VMLINUX_BTF_FILENAME to unrelated selftests
> with some BTF, pahole works as expected (prints structures defined in
> the selftest).
> 
> Tested-by: Eduard Zingerman <eddyz87@xxxxxxxxx>

Thanks a lot, added to the cset!

- Arnaldo
 
> [...]




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux