From: "Alexis Lothoré" <alexis.lothore@bootlin.com>
To: "Alan Maguire" <alan.maguire@oracle.com>, <dwarves@vger.kernel.org>
Cc: <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>,
<ebpf@linuxfoundation.org>
Subject: Re: [PATCH v3 2/3] tests: add some tests validating skipped functions due to uncertain arg location
Date: Tue, 05 Aug 2025 21:06:23 +0200 [thread overview]
Message-ID: <DBUQ9HK08HSW.182155MPSBZJM@bootlin.com> (raw)
In-Reply-To: <7201b814-aeb1-4f1d-b5f8-3178be1e29bd@oracle.com>
Hi Alan,
On Tue Aug 5, 2025 at 5:09 PM CEST, Alan Maguire wrote:
> On 07/07/2025 15:02, Alexis Lothoré (eBPF Foundation) wrote:
>> Add a small binary representing specific cases likely absent from
>> standard vmlinux or kernel modules files. As a starter, the introduced
>> binary exposes a few functions consuming structs passed by value, some
>> passed by register, some passed on the stack:
>>
>> int main(void);
>> int test_bin_func_struct_on_stack_ko(int, void *, char, short int, int, \
>> void *, char, short int, struct test_bin_struct_packed);
>> int test_bin_func_struct_on_stack_ok(int, void *, char, short int, int, \
>> void *, char, short int, struct test_bin_struct);
>> int test_bin_func_struct_ok(int, void *, char, struct test_bin_struct);
>> int test_bin_func_ok(int, void *, char, short int);
>>
>> Then enrich btf_functions.sh to make it perform the following steps:
>> - build the binary
>> - generate BTF info and pfunct listing, both with dwarf and the
>> generated BTF
>> - check that any function encoded in BTF is found in DWARF
>> - check that any function announced as skipped is indeed absent from BTF
>> - check that any skipped function has been skipped due to uncertain
>> parameter location
>>
>> Example of the new test execution:
>> Encoding...Matched 4 functions exactly.
>> Ok
>> Validation of skipped function logic...
>> Skipped encoding 1 functions in BTF.
>> Ok
>> Validating skipped functions have uncertain parameter location...
>> pahole: /home/alexis/src/pahole/tests/bin/test_bin: Invalid argument
>> Found 1 legitimately skipped function due to uncertain loc
>> Ok
>>
>> Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
>
> Thanks for the updated changes+test. I think it'd be good to have this
> be less verbose in successful case. Currently I see:
>
> 1: Validation of BTF encoding of functions; this may take some time: Ok
> Validation of BTF encoding corner cases with test_bin functions; this
> may take some time: make: Entering directory
> '/home/almagui/src/github/dwarves/tests/bin'
> gcc test_bin.c -Wall -Wextra -Werror -g -o test_bin
> make: Leaving directory '/home/almagui/src/github/dwarves/tests/bin'
> No skipped functions. Done.
>
> Ideally we just want the "Ok" for success in non-vebose mode. I'd
> propose making the following changes in order to support that; if these
> are okay by you there's no need to send another revision.
I'm perfeclty fine with the idea, thanks for handling it. Just a
comment/question below
> diff --git a/tests/btf_functions.sh b/tests/btf_functions.sh
> index f97bdf5..a4ab67e 100755
> --- a/tests/btf_functions.sh
> +++ b/tests/btf_functions.sh
> @@ -110,7 +110,6 @@ skipped_cnt=$(wc -l ${outdir}/skipped_fns | awk '{
> print $1}')
>
> if [[ "$skipped_cnt" == "0" ]]; then
> echo "No skipped functions. Done."
> - exit 0
> fi
Shouldn't we get rid of this whole if block then, similarly to what you
have done with the other one below ?
Thanks,
Alexis
--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2025-08-05 19:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-07 14:02 [PATCH v3 0/3] btf_encoder: do not encode functions consuming packed structs on stack Alexis Lothoré (eBPF Foundation)
2025-07-07 14:02 ` [PATCH v3 1/3] btf_encoder: skip functions consuming packed structs passed by value " Alexis Lothoré (eBPF Foundation)
2025-07-07 17:05 ` Alexei Starovoitov
2025-07-07 17:45 ` Ihor Solodrai
2025-08-04 7:13 ` Alexis Lothoré
2025-08-04 9:58 ` Jiri Olsa
2025-07-07 14:02 ` [PATCH v3 2/3] tests: add some tests validating skipped functions due to uncertain arg location Alexis Lothoré (eBPF Foundation)
2025-07-07 14:14 ` Alexis Lothoré
2025-07-07 19:36 ` Ihor Solodrai
2025-07-09 16:21 ` Alan Maguire
2025-07-15 8:04 ` Alexis Lothoré
2025-07-15 15:36 ` Ihor Solodrai
2025-08-05 15:09 ` Alan Maguire
2025-08-05 19:06 ` Alexis Lothoré [this message]
2025-08-06 11:14 ` Alan Maguire
2025-07-07 14:02 ` [PATCH v3 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=DBUQ9HK08HSW.182155MPSBZJM@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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.