* [PATCH bpf-next] bpf: veristat: Document verifier log dumping capability
@ 2025-01-09 23:42 Daniel Xu
2025-01-10 22:40 ` Andrii Nakryiko
2025-01-10 22:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Xu @ 2025-01-09 23:42 UTC (permalink / raw)
To: eddyz87, andrii, daniel, shuah, ast
Cc: mykolal, martin.lau, song, yonghong.song, john.fastabend, kpsingh,
sdf, haoluo, jolsa, bpf, linux-kselftest, linux-kernel
`-l2 -v` is a useful combination of flags to dump the entire
verification log. This is helpful when making changes to the verifier,
as you can see what it thinks program one instruction at a time.
This was more or less a hidden feature before. Document it so others can
discover it.
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
---
tools/testing/selftests/bpf/veristat.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/bpf/veristat.c b/tools/testing/selftests/bpf/veristat.c
index 974c808f9321..7d0a9cb753e3 100644
--- a/tools/testing/selftests/bpf/veristat.c
+++ b/tools/testing/selftests/bpf/veristat.c
@@ -216,7 +216,8 @@ const char argp_program_doc[] =
"\n"
"USAGE: veristat <obj-file> [<obj-file>...]\n"
" OR: veristat -C <baseline.csv> <comparison.csv>\n"
-" OR: veristat -R <results.csv>\n";
+" OR: veristat -R <results.csv>\n"
+" OR: veristat -v -l2 <to_analyze.bpf.o>\n";
enum {
OPT_LOG_FIXED = 1000,
@@ -228,7 +229,7 @@ static const struct argp_option opts[] = {
{ "version", 'V', NULL, 0, "Print version" },
{ "verbose", 'v', NULL, 0, "Verbose mode" },
{ "debug", 'd', NULL, 0, "Debug mode (turns on libbpf debug logging)" },
- { "log-level", 'l', "LEVEL", 0, "Verifier log level (default 0 for normal mode, 1 for verbose mode)" },
+ { "log-level", 'l', "LEVEL", 0, "Verifier log level (default 0 for normal mode, 1 for verbose mode, 2 for full verification log)" },
{ "log-fixed", OPT_LOG_FIXED, NULL, 0, "Disable verifier log rotation" },
{ "log-size", OPT_LOG_SIZE, "BYTES", 0, "Customize verifier log size (default to 16MB)" },
{ "top-n", 'n', "N", 0, "Emit only up to first N results." },
--
2.47.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] bpf: veristat: Document verifier log dumping capability
2025-01-09 23:42 [PATCH bpf-next] bpf: veristat: Document verifier log dumping capability Daniel Xu
@ 2025-01-10 22:40 ` Andrii Nakryiko
2025-01-10 22:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Andrii Nakryiko @ 2025-01-10 22:40 UTC (permalink / raw)
To: Daniel Xu
Cc: eddyz87, andrii, daniel, shuah, ast, mykolal, martin.lau, song,
yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, bpf,
linux-kselftest, linux-kernel
On Thu, Jan 9, 2025 at 3:42 PM Daniel Xu <dxu@dxuuu.xyz> wrote:
>
> `-l2 -v` is a useful combination of flags to dump the entire
> verification log. This is helpful when making changes to the verifier,
> as you can see what it thinks program one instruction at a time.
>
> This was more or less a hidden feature before. Document it so others can
> discover it.
>
> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
> ---
> tools/testing/selftests/bpf/veristat.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/veristat.c b/tools/testing/selftests/bpf/veristat.c
> index 974c808f9321..7d0a9cb753e3 100644
> --- a/tools/testing/selftests/bpf/veristat.c
> +++ b/tools/testing/selftests/bpf/veristat.c
> @@ -216,7 +216,8 @@ const char argp_program_doc[] =
> "\n"
> "USAGE: veristat <obj-file> [<obj-file>...]\n"
> " OR: veristat -C <baseline.csv> <comparison.csv>\n"
> -" OR: veristat -R <results.csv>\n";
> +" OR: veristat -R <results.csv>\n"
> +" OR: veristat -v -l2 <to_analyze.bpf.o>\n";
let's be cute, '-vl2'? :) I adjusted while applying, but yell if you disagree
>
> enum {
> OPT_LOG_FIXED = 1000,
> @@ -228,7 +229,7 @@ static const struct argp_option opts[] = {
> { "version", 'V', NULL, 0, "Print version" },
> { "verbose", 'v', NULL, 0, "Verbose mode" },
> { "debug", 'd', NULL, 0, "Debug mode (turns on libbpf debug logging)" },
> - { "log-level", 'l', "LEVEL", 0, "Verifier log level (default 0 for normal mode, 1 for verbose mode)" },
> + { "log-level", 'l', "LEVEL", 0, "Verifier log level (default 0 for normal mode, 1 for verbose mode, 2 for full verification log)" },
> { "log-fixed", OPT_LOG_FIXED, NULL, 0, "Disable verifier log rotation" },
> { "log-size", OPT_LOG_SIZE, "BYTES", 0, "Customize verifier log size (default to 16MB)" },
> { "top-n", 'n', "N", 0, "Emit only up to first N results." },
> --
> 2.47.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] bpf: veristat: Document verifier log dumping capability
2025-01-09 23:42 [PATCH bpf-next] bpf: veristat: Document verifier log dumping capability Daniel Xu
2025-01-10 22:40 ` Andrii Nakryiko
@ 2025-01-10 22:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-01-10 22:50 UTC (permalink / raw)
To: Daniel Xu
Cc: eddyz87, andrii, daniel, shuah, ast, mykolal, martin.lau, song,
yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, bpf,
linux-kselftest, linux-kernel
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:
On Thu, 9 Jan 2025 16:42:29 -0700 you wrote:
> `-l2 -v` is a useful combination of flags to dump the entire
> verification log. This is helpful when making changes to the verifier,
> as you can see what it thinks program one instruction at a time.
>
> This was more or less a hidden feature before. Document it so others can
> discover it.
>
> [...]
Here is the summary with links:
- [bpf-next] bpf: veristat: Document verifier log dumping capability
https://git.kernel.org/bpf/bpf-next/c/95ad526edebc
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-10 22:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09 23:42 [PATCH bpf-next] bpf: veristat: Document verifier log dumping capability Daniel Xu
2025-01-10 22:40 ` Andrii Nakryiko
2025-01-10 22:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox