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

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

 



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@xxxxxxxxxx>
> 
> LGTM, thanks!
> 
> Reviewed-by: Alan Maguire <alan.maguire@xxxxxxxxxx>
> Tested-by: Alan Maguire <alan.maguire@xxxxxxxxxx>

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
14be4e3d3fe56ce9 pahole: Only warn about multithreading not being available with older versions of elfutils in verbose mode
ee933f35484ac934 dwarf_loader: Simplify the tag__alloc() routine
cbecc3785266f0c5 (x1/master) dwarf_loader: Do just one alloc for 'struct dwarf_tag + struct tag'
⬢[acme@toolbox pahole]$ git show
commit fbcca0f6c2fbeb52349e28f03093a7efafb040ea (HEAD -> master)
Author: Matthew Maurer <mmaurer@xxxxxxxxxx>
Date:   Thu Aug 1 18:50:54 2024 +0000

    pahole: Do --languages_exclude CU filtering earlier
    
    With this, we can avoid warnings for unsupported DWARF tags like:
    
      die__process_function: tag not supported 0x2f (template_type_parameter)!
    
    when processing object files generated from languages such as Rust, for
    instance when building the Linux kernel with `CONFIG_RUST`, after
    appltying the next patch in this series.
    
    As an added bonus, this should speed up processing of large objects with
    filtered CUs, as their details will no longer be walked.
    
    Reviewed-by: Alan Maguire <alan.maguire@xxxxxxxxxx>
    Signed-off-by: Matthew Maurer <mmaurer@xxxxxxxxxx>
    Tested-by: Alan Maguire <alan.maguire@xxxxxxxxxx>
    Cc: Alice Ryhl <aliceryhl@xxxxxxxxxx>
    Cc: rust-for-linux@xxxxxxxxxxxxxxx
    Link: https://lore.kernel.org/r/20240801185054.2518383-1-mmaurer@xxxxxxxxxx
    [ Split from a larger patch ]
    Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

diff --git a/pahole.c b/pahole.c
index 4db51071b97d5f09..42ef6c262384a8e0 100644
--- a/pahole.c
+++ b/pahole.c
@@ -3766,6 +3766,10 @@ int main(int argc, char *argv[])
        memset(tab, ' ', sizeof(tab) - 1);
 
        conf_load.steal = pahole_stealer;
+
+       if (languages.exclude)
+               conf_load.early_cu_filter = cu__filter;
+
        conf_load.thread_exit = pahole_thread_exit;
 
        if (conf_load.reproducible_build) {
⬢[acme@toolbox pahole]$




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

  Powered by Linux