Re: [PATCH bpf-next 3/3] selftests/bpf: add veristat tool for mass-verifying BPF object files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 27, 2022 at 4:53 PM KP Singh <kpsingh@xxxxxxxxxx> wrote:
>
> On Sat, Aug 27, 2022 at 1:15 AM Andrii Nakryiko <andrii@xxxxxxxxxx> wrote:
> >
> > Add a small tool, veristat, that allows mass-verification of
> > a set of *libbpf-compatible* BPF ELF object files. For each such object
> > file, veristat will attempt to verify each BPF program *individually*.
> > Regardless of success or failure, it parses BPF verifier stats and
> > outputs them in human-readable table format. In the future we can also
> > add CSV and JSON output for more scriptable post-processing, if necessary.
> >
> > veristat allows to specify a set of stats that should be output and
> > ordering between multiple objects and files (e.g., so that one can
> > easily order by total instructions processed, instead of default file
> > name, prog name, verdict, total instructions order).
> >
> > This tool should be useful for validating various BPF verifier changes
> > or even validating different kernel versions for regressions.
>
> Cool stuff!
>
> I think this would be useful for cases beyond these (i.e. for users to get
> stats about the verifier in general) and it's worth thinking if this should
> be built into bpftool?

I think it's a bit premature to put this into bpftool (IMO, I don't
like kitchen sink approach to libraries and tools), let's see how this
is used in practice first.

But yes, my plan was to expose more internal stats from verifier
through using attached BPF program. I even have BPF skeleton wired
locally, but right now just for test grab duration (which we already
get throuhg verifier log, so it's useless right now). But with BPF
program we can fetch internal BPF verifier state during verification.

I also plan to add a bit more customizability as to which subsets of
programs to run, similar to how test_progs allow to filter tests and
subtests, but here we'll have objects and progs. So anyway, this is a
very first version that I got time to clean up a bit and post. I plan
at least few more,  so let's hold off on putting this into bpftool (at
least yet).

>
> >
> > Here's an example for some of the heaviest selftests/bpf BPF object
> > files:
> >
> >   $ sudo ./veristat -s insns,file,prog {pyperf,loop,test_verif_scale,strobemeta,test_cls_redirect,profiler}*.linked3.o
> >   File                                  Program                               Verdict  Duration, us  Total insns  Total states  Peak states
> >   ------------------------------------  ------------------------------------  -------  ------------  -----------  ------------  -----------
> >   loop3.linked3.o                       while_true                            failure        350990      1000001          9663         9663
>
> [...]
>
> > --
> > 2.30.2
> >



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux