Re: [PATCH v2] pahole: Apply CU-level filters early in loading

Arnaldo Carvalho de Melo
2024-08-09T13:51:09Z

On Fri, Aug 09, 2024 at 09:45:13AM -0300, Arnaldo Carvalho de Melo wrote:
> On Tue, Aug 06, 2024 at 01:10:03PM +0100, Alan Maguire wrote:
> > On 01/08/2024 19:50, Matthew Maurer wrote:
> > > Without this, even with `--lang_exclude=rust` set, running on `vmlinux`
> > > with `CONFIG_RUST` enabled will lead to errors like:
> > > die__process_function: tag not supported 0x2f (template_type_parameter)!
> > > because the filtering doesn't happen until finalization, but unsupported
> > > tags are reported during loading.
> > >
> > > As an added bonus, this should speed up processing of large objects with
> > > filtered CUs, as their details will no longer be walked.
> > >
> > > Signed-off-by: Matthew Maurer <mmaurer@google.com>
> >
> > LGTM, thanks!
> >
> > Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
> > Tested-by: Alan Maguire <alan.maguire@oracle.com>
>
> Thanks, I just split it into two patches, one adding the new early
> filtering facility and with the second making then use of this new
> facility in pahole:
>
> ⬢[acme@toolbox pahole]$ git log --oneline -5
> fbcca0f6c2fbeb52 (HEAD -> master) pahole: Do --languages_exclude CU filtering earlier
> 1f8d83d16d6d6dfa dwarf_loader: Allow filtering CUs early in loading

Tested building a kernel with CONFIG_RUST, no warnings (that
template_type_param wouldn't appear anyway as I added initial support
for it, at least for creating some structs out of its DWARF info, so no
more warnings), but:

⬢[acme@toolbox linux]$ pahole -C '<kernel::str::RawFormatter as core::fmt::Write>::{vtable_type}' ../build/rust-kernel/rust/kernel.o
die__process_class: tag not supported 0x33 (variant_part) at <14f43>!
struct <kernel::str::RawFormatter as core::fmt::Write>::{vtable_type} {
() * drop_in_place __attribute__((__aligned__(8))); /* 0 8 */
usize size __attribute__((__aligned__(8))); /* 8 8 */
usize align __attribute__((__aligned__(8))); /* 16 8 */
() * __method3 __attribute__((__aligned__(8))); /* 24 8 */
() * __method4 __attribute__((__aligned__(8))); /* 32 8 */
() * __method5 __attribute__((__aligned__(8))); /* 40 8 */

/* size: 48, cachelines: 1, members: 6 */
/* forced alignments: 6 */
/* last cacheline: 48 bytes */
} __attribute__((__aligned__(8)));

⬢[acme@toolbox linux]$

That DW_TAG_variant_part warning would show up without this series, so
seems to be working as expected :-)

- Arnaldo