From: "Alexis Lothoré" <alexis.lothore@bootlin.com>
To: "Alan Maguire" <alan.maguire@oracle.com>,
"Alexei Starovoitov" <alexei.starovoitov@gmail.com>
Cc: "dwarves" <dwarves@vger.kernel.org>, "bpf" <bpf@vger.kernel.org>,
"Arnaldo Carvalho de Melo" <acme@kernel.org>,
"Alexei Starovoitov" <ast@fb.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Bastien Curutchet" <bastien.curutchet@bootlin.com>
Subject: Re: [PATCH RFC] btf_encoder: skip functions consuming structs passed by value on stack
Date: Thu, 19 Jun 2025 18:06:05 +0200 [thread overview]
Message-ID: <DAQMZTVLO2QH.2YXXTMEU8BQ4M@bootlin.com> (raw)
In-Reply-To: <6fb578bd-8851-414e-bfea-dec2472c6ee4@oracle.com>
Hi Alan,
On Thu Jun 19, 2025 at 5:41 PM CEST, Alan Maguire wrote:
> On 19/06/2025 14:12, Alexis Lothoré wrote:
>> On Wed Jun 18, 2025 at 6:28 PM CEST, Alexei Starovoitov wrote:
>>> On Wed, Jun 18, 2025 at 8:02 AM Alexis Lothoré
>>> <alexis.lothore@bootlin.com> wrote:
[...]
>>> though it's passed on the stack it fits into normal calling convention.
>>> It doesn't have align or packed attributes, so no need to exclude it ?
>>
>> I went for the simplest solution, assuming that there were cases involving
>> packing/alignent customization that we would not be able to detect (eg: the
>> packed attr that does not change size but reduce alignment). But thinking
>> more about it, those cases need really specific conditions thay may not
>> exist currently in the kernel (eg: having some __int128 embedded in a
>> struct).
>>
>> I see that pahole already has some logic to check if a struct is
>> altered (eg class__infer_packed_attributes), I'll check if I can come with
>> something more selective.
>>
>
> sounds good; one additional suggestion is given that these sorts of
> functions are rare to nonexistent in vmlinux, perhaps we could add some
> tests to the tests/ directory that compile C code and generate BTF from
> the associated DWARF, verifying that functions are (or are not) encoded
> as expected?
>
> I'm working on adding automatic comparison of vmlinux BTF function
> encoding for candidate patch series to pahole's CI (so we can see if
> functions appear/disappear), but in a case like this a few explicit
> tests would be great to have. Thanks!
Yes, sure. I did not consider at all tests while the series is in RFC, but
I had it in mind for the next steps. I'll take into account the need to
add and build automatically some custom C code exposing those "exotic"
functions and structs.
Alexis.
--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2025-06-19 16:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-18 15:02 [PATCH RFC] btf_encoder: skip functions consuming structs passed by value on stack Alexis Lothoré
2025-06-18 16:28 ` Alexei Starovoitov
2025-06-19 13:12 ` Alexis Lothoré
2025-06-19 15:41 ` Alan Maguire
2025-06-19 16:06 ` Alexis Lothoré [this message]
2025-06-19 16:49 ` Alexei Starovoitov
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=DAQMZTVLO2QH.2YXXTMEU8BQ4M@bootlin.com \
--to=alexis.lothore@bootlin.com \
--cc=acme@kernel.org \
--cc=alan.maguire@oracle.com \
--cc=alexei.starovoitov@gmail.com \
--cc=ast@fb.com \
--cc=bastien.curutchet@bootlin.com \
--cc=bpf@vger.kernel.org \
--cc=dwarves@vger.kernel.org \
--cc=thomas.petazzoni@bootlin.com \
/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