rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: Matthew Maurer <mmaurer@google.com>,
	rust-for-linux@vger.kernel.org, dwarves@vger.kernel.org,
	aliceryhl@google.com
Subject: Re: [PATCH v2] pahole: Apply CU-level filters early in loading
Date: Fri, 9 Aug 2024 09:45:09 -0300	[thread overview]
Message-ID: <ZrYPVQwJePB-nyO2@x1> (raw)
In-Reply-To: <25bc65c9-e28e-48cd-b5a9-f603d846ae51@oracle.com>

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
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@google.com>
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@oracle.com>
    Signed-off-by: Matthew Maurer <mmaurer@google.com>
    Tested-by: Alan Maguire <alan.maguire@oracle.com>
    Cc: Alice Ryhl <aliceryhl@google.com>
    Cc: rust-for-linux@vger.kernel.org
    Link: https://lore.kernel.org/r/20240801185054.2518383-1-mmaurer@google.com
    [ Split from a larger patch ]
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

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]$

  reply	other threads:[~2024-08-09 12:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-01 18:50 [PATCH v2] pahole: Apply CU-level filters early in loading Matthew Maurer
2024-08-06 12:10 ` Alan Maguire
2024-08-09 12:45   ` Arnaldo Carvalho de Melo [this message]
2024-08-09 13:51     ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZrYPVQwJePB-nyO2@x1 \
    --to=acme@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=aliceryhl@google.com \
    --cc=dwarves@vger.kernel.org \
    --cc=mmaurer@google.com \
    --cc=rust-for-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).