From: sashiko-bot@kernel.org
To: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v8 3/6] bpf: Show more useful info in stack depth stats
Date: Wed, 12 Aug 2026 22:29:10 +0000 [thread overview]
Message-ID: <20260812222911.3BA441F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812221925.3358041-4-memxor@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch breaks `veristat`'s ability to parse and track the BPF verifier's stack depth statistics (both STACK and MAX_STACK metrics).
--
--- Patch [3]: [PATCH bpf-next v8 3/6] bpf: Show more useful info in stack depth stats ---
commit de454cf9ad70eafec58298c609cb8cd8aea82368
Author: Kumar Kartikeya Dwivedi <memxor@gmail.com>
bpf: Show more useful info in stack depth stats
This commit updates the BPF verifier statistics to report stack depth and
instruction counts separately per subprogram. It changes the log output format
to display subprogram-specific metrics more clearly, rather than appending
depths in a single line.
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index fced21ec23040..73d6cd563cdf8 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -18693,15 +18693,20 @@ 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, "insns processed %d", env->subprog_info[0].insns_total);
> - for (i = 1; i < subprog_cnt; i++)
> - if (bpf_subprog_is_global(env, i))
> - verbose(env, "+%d", env->subprog_info[i].insns_total);
> - verbose(env, "\n");
> + verbose(env, "stack depth max %d\n", env->max_stack_depth);
[Severity: Medium]
Does this change in output format break the veristat tool's parsing logic?
Looking at tools/testing/selftests/bpf/veristat.c:parse_verif_log():
if (2 == sscanf(cur, "stack depth %511s max %ld", stack, &s->stats[MAX_STACK])) {
...
}
Because the output format changed from "stack depth %d+%d... max %d\n" to
"stack depth max %d\n", sscanf() will match "%511s" to the literal string
"max". The expected literal " max " then fails to match the remainder of the
string.
This causes sscanf to return 1, leaving s->stats[MAX_STACK] untouched and
breaking the stack calculator which tries to parse "max" for integers. Should
veristat be updated alongside this change to parse the new output format?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260812221925.3358041-1-memxor@gmail.com?part=3
next prev parent reply other threads:[~2026-08-12 22:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 22:19 [PATCH bpf-next v8 0/6] Improve stack depth verification stats output Kumar Kartikeya Dwivedi
2026-08-12 22:19 ` [PATCH bpf-next v8 1/6] bpf: Track verifier instruction stats for each subprogram Kumar Kartikeya Dwivedi
2026-08-12 22:19 ` [PATCH bpf-next v8 2/6] bpf: Attribute async callback instructions to verification roots Kumar Kartikeya Dwivedi
2026-08-13 0:39 ` Eduard Zingerman
2026-08-12 22:19 ` [PATCH bpf-next v8 3/6] bpf: Show more useful info in stack depth stats Kumar Kartikeya Dwivedi
2026-08-12 22:29 ` sashiko-bot [this message]
2026-08-12 23:14 ` bot+bpf-ci
2026-08-12 22:19 ` [PATCH bpf-next v8 4/6] selftests/bpf: Adjust veristat stack depth parsing Kumar Kartikeya Dwivedi
2026-08-12 23:14 ` bot+bpf-ci
2026-08-12 22:19 ` [PATCH bpf-next v8 5/6] selftests/bpf: Test stack depth stats without BTF subprog names Kumar Kartikeya Dwivedi
2026-08-12 23:14 ` bot+bpf-ci
2026-08-12 22:19 ` [PATCH bpf-next v8 6/6] selftests/bpf: Test subprogram instruction statistics Kumar Kartikeya Dwivedi
2026-08-13 0:50 ` [PATCH bpf-next v8 0/6] Improve stack depth verification stats output patchwork-bot+netdevbpf
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=20260812222911.3BA441F000E9@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.