]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/bpf: Add BPF program dump in veristat
authorMykyta Yatsenko <yatsenko@meta.com>
Fri, 5 Sep 2025 14:08:35 +0000 (15:08 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 5 Sep 2025 19:12:09 +0000 (12:12 -0700)
commite12873ee856ffa6f104869b8ea10c0f741606f13
tree0490779d8d2f45c115112dc2c3cdd51645faa7ed
parent9621eb635ba96514edd0fbfaeeec1fffea294abb
selftests/bpf: Add BPF program dump in veristat

Add the ability to dump BPF program instructions directly from veristat.
Previously, inspecting a program required separate bpftool invocations:
one to load and another to dump it, which meant running multiple
commands.
During active development, it's common for developers to use veristat
for testing verification. Integrating instruction dumping into veristat
reduces the need to switch tools and simplifies the workflow.
By making this information more readily accessible, this change aims
to streamline the BPF development cycle and improve usability for
developers.
This implementation leverages bpftool, by running it directly via popen
to avoid any code duplication and keep veristat simple.

Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250905140835.1416179-1-mykyta.yatsenko5@gmail.com
tools/testing/selftests/bpf/veristat.c