rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Maguire <alan.maguire@oracle.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Matthew Maurer <mmaurer@google.com>,
	rust-for-linux@vger.kernel.org, dwarves@vger.kernel.org,
	aliceryhl@google.com
Subject: Re: [PATCH] pahole: Apply CU-level filters early in loading
Date: Thu, 1 Aug 2024 10:20:03 +0100	[thread overview]
Message-ID: <db2a5178-2df3-4caf-955b-525cdbae7002@oracle.com> (raw)
In-Reply-To: <Zqp-cqZcOOCzQMEg@x1>



On 31/07/2024 19:12, Arnaldo Carvalho de Melo wrote:
> On Wed, Jul 31, 2024 at 06:43:51PM +0100, Alan Maguire wrote:
>>
>>
>> On 31/07/2024 14:26, Arnaldo Carvalho de Melo wrote:
>>> On Wed, Jul 31, 2024 at 09:57:25AM +0100, Alan Maguire wrote:
>>>> On 30/07/2024 23:43, 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.
>>>>>
>>>>
>>>> One question on this; if we are always doing early filtering like this,
>>>> should the explicit cu__filter() call be removed from pahole_stealer()?
>>>
>>> When I saw the introduction of an extra callback to be used inside the
>>> dwarf_loader I thought that it would be used only for this specific
>>> language filtering feature, i.e. a defensive approach at implementing
>>> this to avoid unintended side effects of doing all filtering at that
>>> point, maybe some other feature somehow depends on the cu__filter()
>>> being called where it was so far.
>>>
>>> But then it is being used for all filtering, so it seems just a way to
>>> reduce the patch size...
>>>
>>> So I'd keep the cu->early_cu_filter() but would use it only for the
>>> language filtering feature, wdyt?
>>
>> So if I understand correctly,
>>
>> 	if (languages.exclude)
>> 		conf_load.early_cu_filter = cu__filter;
>>
>> ? Seems reasonable to me. Thanks!
> 
> yeah, you got it. So this new early filtering is done for the feature we
> have at hand and if other uses of cu__filter() already in place need, we
> can transition to this new mechanism that reuses the cu__filter()
> function signature/semantics.
>

Sounds good! Matthew, can you send a v2 with the above change? It should
still cover us for BTF generation in the kernel case since we always
--lang_exclude rust as long as pahole is recent enough.

      reply	other threads:[~2024-08-01  9:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30 22:43 [PATCH] pahole: Apply CU-level filters early in loading Matthew Maurer
2024-07-31  8:57 ` Alan Maguire
2024-07-31 13:26   ` Arnaldo Carvalho de Melo
2024-07-31 17:43     ` Alan Maguire
2024-07-31 18:12       ` Arnaldo Carvalho de Melo
2024-08-01  9:20         ` Alan Maguire [this message]

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=db2a5178-2df3-4caf-955b-525cdbae7002@oracle.com \
    --to=alan.maguire@oracle.com \
    --cc=acme@kernel.org \
    --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).