From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: <sashiko@lists.linux.dev>, "Paul Chaignon" <paul.chaignon@gmail.com>
Cc: <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next v2 2/2] selftests/bpf: Test insns processed breakdown
Date: Wed, 29 Apr 2026 02:30:35 -0700 [thread overview]
Message-ID: <DI5J82SMQFQL.2O53NRWH4QSH8@gmail.com> (raw)
In-Reply-To: <20260429023623.73482C2BCB7@smtp.kernel.org>
On Tue Apr 28, 2026 at 7:36 PM PDT, sashiko-bot wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> - [Medium] Asserting exact verifier instruction counts in C-based BPF selftests causes test flakiness.
> - [Low] Unused test configuration from blindly elevating log levels to 6 without corresponding assertions.
> --
>
> commit c4e03a953efa7cd8cf2e1a288a0c55c4f73cace2
> Author: Paul Chaignon <paul.chaignon@gmail.com>
>
> selftests/bpf: Test insns processed breakdown
>
> This patch updates global subprog selftests to verify the new verifier
> log breakdown of instructions processed by global subprogs. It does this
> by increasing log levels and adding new message assertions.
>
>> diff --git a/tools/testing/selftests/bpf/progs/verifier_global_subprogs.c b/tools/testing/selftests/bpf/progs/verifier_global_subprogs.c
>> index 1e08aff7532e..7092a046c018 100644
>> --- a/tools/testing/selftests/bpf/progs/verifier_global_subprogs.c
>> +++ b/tools/testing/selftests/bpf/progs/verifier_global_subprogs.c
>
> [ ... ]
>
>> @@ -186,21 +187,24 @@ __weak int raw_tp_u64_array(u64 *ctx __arg_ctx)
>> }
>>
>> SEC("?raw_tp")
>> -__success __log_level(2)
>> +__success __log_level(6)
>> +__msg("insns processed 12+5+2+2")
>> int arg_tag_ctx_raw_tp(void *ctx)
>
> Will hardcoding exact instruction counts cause the tests to become flaky across
> different LLVM/Clang versions or optimization levels?
>
> Since test_loader.c natively supports regex matching within __msg using the
> {{...}} syntax, would it be more reliable to use a pattern to validate the
> log format?
>
> For example, __msg("insns processed {{[0-9]+(\+[0-9]+)*}}") might prevent
> failures when the compiler generates slightly different assembly.
I have to agree with sashk here.
It's way too many tests with hard coded insn counts.
Just one test with above regex is plenty.
pw-bot: cr
next prev parent reply other threads:[~2026-04-29 9:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 21:39 [PATCH bpf-next v2 1/2] bpf: Print breakdown of insns processed by subprogs Paul Chaignon
2026-04-28 21:40 ` [PATCH bpf-next v2 2/2] selftests/bpf: Test insns processed breakdown Paul Chaignon
2026-04-29 2:36 ` sashiko-bot
2026-04-29 9:30 ` Alexei Starovoitov [this message]
2026-04-29 2:26 ` [PATCH bpf-next v2 1/2] bpf: Print breakdown of insns processed by subprogs sashiko-bot
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=DI5J82SMQFQL.2O53NRWH4QSH8@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=paul.chaignon@gmail.com \
--cc=sashiko@lists.linux.dev \
/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