From: "Alexis Lothoré" <alexis.lothore@bootlin.com>
To: "Ihor Solodrai" <ihor.solodrai@linux.dev>, <dwarves@vger.kernel.org>
Cc: <bpf@vger.kernel.org>, "Alan Maguire" <alan.maguire@oracle.com>,
"Arnaldo Carvalho de Melo" <acme@kernel.org>,
"Alexei Starovoitov" <ast@fb.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Bastien Curutchet" <bastien.curutchet@bootlin.com>,
<ebpf@linuxfoundation.org>
Subject: Re: [PATCH v2 1/3] btf_encoder: skip functions consuming packed structs passed by value on stack
Date: Fri, 04 Jul 2025 23:12:08 +0200 [thread overview]
Message-ID: <DB3KWBZ9BGN3.2DLBD6KHJ6ZZC@bootlin.com> (raw)
In-Reply-To: <5aadf682-3b1f-4769-a2c1-523085026ac8@linux.dev>
On Fri Jul 4, 2025 at 10:05 PM CEST, Ihor Solodrai wrote:
> On 7/3/25 2:02 AM, Alexis Lothoré (eBPF Foundation) wrote:
[...]
>> +static bool ftype__has_uncertain_arg_loc(struct cu *cu, struct ftype *ftype)
>> +{
>> + struct parameter *param;
>> + int param_idx = 0;
>> +
>> + if (ftype->nr_parms < cu->nr_register_params)
>> + return false;
>> +
>> + ftype__for_each_parameter(ftype, param) {
>> + if (param_idx++ < cu->nr_register_params)
>> + continue;
>> +
>> + struct tag *type = cu__type(cu, param->tag.type);
>> +
>> + if (type == NULL || !tag__is_struct(type))
>> + continue;
>> +
>> + struct type *ctype = tag__type(type);
>> + if (ctype->namespace.name == 0)
>> + continue;
>> +
>> + struct class *class = tag__class(type);
>> +
>> + class__find_holes(class);
>> + class__infer_packed_attributes(class, cu);
>
> I just noticed that class__infer_packed_attributes() already does call
> class__find_holes() [1], so calling it here is unnecessary. Although
> there is already a flag to detect repeated calls [2].
>
> [1] https://github.com/acmel/dwarves/blob/master/dwarves.c#L1859
> [2] https://github.com/acmel/dwarves/blob/master/dwarves.c#L1604-L1605
ACK, I'll remove the duplicate class__find_holes then.
next prev parent reply other threads:[~2025-07-04 21:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-03 9:02 [PATCH v2 0/3] btf_encoder: do not encode functions consuming packed structs on stack Alexis Lothoré (eBPF Foundation)
2025-07-03 9:02 ` [PATCH v2 1/3] btf_encoder: skip functions consuming packed structs passed by value " Alexis Lothoré (eBPF Foundation)
2025-07-03 18:17 ` Ihor Solodrai
2025-07-04 9:01 ` Alexis Lothoré
2025-07-04 19:59 ` Ihor Solodrai
2025-07-04 21:10 ` Alexis Lothoré
2025-07-04 20:05 ` Ihor Solodrai
2025-07-04 21:12 ` Alexis Lothoré [this message]
2025-07-03 9:02 ` [PATCH v2 2/3] tests: add some tests validating skipped functions due to uncertain arg location Alexis Lothoré (eBPF Foundation)
2025-07-03 18:31 ` Ihor Solodrai
2025-07-04 9:06 ` Alexis Lothoré
2025-07-03 9:02 ` [PATCH v2 3/3] gitignore: ignore all the test kmod build-related files Alexis Lothoré (eBPF Foundation)
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=DB3KWBZ9BGN3.2DLBD6KHJ6ZZC@bootlin.com \
--to=alexis.lothore@bootlin.com \
--cc=acme@kernel.org \
--cc=alan.maguire@oracle.com \
--cc=ast@fb.com \
--cc=bastien.curutchet@bootlin.com \
--cc=bpf@vger.kernel.org \
--cc=dwarves@vger.kernel.org \
--cc=ebpf@linuxfoundation.org \
--cc=ihor.solodrai@linux.dev \
--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