From: sashiko-bot@kernel.org
To: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v4 1/3] bpf: Show more useful info in stack depth stats
Date: Mon, 03 Aug 2026 07:34:37 +0000 [thread overview]
Message-ID: <20260803073437.D7DA51F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260803072733.191502-2-memxor@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch changes the verifier stack depth log format but misses updating tools/testing/selftests/bpf/veristat.c, breaking its ability to report stack depth statistics.
--
--- Patch [1]: [PATCH bpf-next v4 1/3] bpf: Show more useful info in stack depth stats ---
commit 5ac25e38dad528d9d2648231f63d507a8cd63820
Author: Kumar Kartikeya Dwivedi <memxor@gmail.com>
bpf: Show more useful info in stack depth stats
This commit changes the format of the verifier's stack depth statistics
to display the maximum depth and each subprogram's depth on separate lines
with their names, instead of a single string of depths.
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -18777,10 +18777,15 @@ static void print_verification_stats(struct bpf_verifier_env *env)
> if (env->log.level & BPF_LOG_STATS) {
> verbose(env, "verification time %lld usec\n",
> div_u64(env->verification_time, 1000));
> - verbose(env, "stack depth %d", env->subprog_info[0].stack_depth);
> - for (i = 1; i < subprog_cnt; i++)
> - verbose(env, "+%d", env->subprog_info[i].stack_depth);
> - verbose(env, " max %d\n", env->max_stack_depth);
> + verbose(env, "stack depth max %d\n", env->max_stack_depth);
[Severity: Medium]
Does this change in the verifier log output also require an update to the
veristat tool?
Looking at tools/testing/selftests/bpf/veristat.c in parse_verif_log(), it
currently parses the log like this:
if (2 == sscanf(cur, "stack depth %511s max %ld", stack, &s->stats[MAX_STACK])) {
Since the patch removes the "stack depth %d...+%d max %d" format and splits
it into multiple lines ("stack depth max %d" and "stack depth subprog ..."),
it looks like veristat's sscanf will no longer match.
Could this cause veristat to silently fail to parse the statistics and report 0
for both the MAX_STACK and STACK metrics?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260803072733.191502-1-memxor@gmail.com?part=1
next prev parent reply other threads:[~2026-08-03 7:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 7:27 [PATCH bpf-next v4 0/3] Improve stack depth verification stats output Kumar Kartikeya Dwivedi
2026-08-03 7:27 ` [PATCH bpf-next v4 1/3] bpf: Show more useful info in stack depth stats Kumar Kartikeya Dwivedi
2026-08-03 7:34 ` sashiko-bot [this message]
2026-08-03 19:48 ` Andrii Nakryiko
2026-08-04 7:21 ` Kumar Kartikeya Dwivedi
2026-08-03 7:27 ` [PATCH bpf-next v4 2/3] selftests/bpf: Adjust veristat stack depth parsing Kumar Kartikeya Dwivedi
2026-08-03 8:49 ` bot+bpf-ci
2026-08-03 7:27 ` [PATCH bpf-next v4 3/3] selftests/bpf: Test stack depth stats without BTF subprog names Kumar Kartikeya Dwivedi
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=20260803073437.D7DA51F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=memxor@gmail.com \
--cc=sashiko-reviews@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 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.