selftests/bpf: Split out bpf_verif_scale selftests into multiple tests
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 22 Oct 2021 22:32:28 +0000 (15:32 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 25 Oct 2021 21:45:46 +0000 (14:45 -0700)
commit3762a39ce85feb07996f3f0390963da71874c651
tree1dded9713a8024aa450e55139d27b96822a7262a
parent2c0f51ac320649402a80a6228744eb54f42a5c21
selftests/bpf: Split out bpf_verif_scale selftests into multiple tests

Instead of using subtests in bpf_verif_scale selftest, turn each scale
sub-test into its own test. Each subtest is compltely independent and
just reuses a bit of common test running logic, so the conversion is
trivial. For convenience, keep all of BPF verifier scale tests in one
file.

This conversion shaves off a significant amount of time when running
test_progs in parallel mode. E.g., just running scale tests (-t verif_scale):

BEFORE
======
Summary: 24/0 PASSED, 0 SKIPPED, 0 FAILED

real    0m22.894s
user    0m0.012s
sys     0m22.797s

AFTER
=====
Summary: 24/0 PASSED, 0 SKIPPED, 0 FAILED

real    0m12.044s
user    0m0.024s
sys     0m27.869s

Ten second saving right there. test_progs -j is not yet ready to be
turned on by default, unfortunately, and some tests fail almost every
time, but this is a good improvement nevertheless. Ignoring few
failures, here is sequential vs parallel run times when running all
tests now:

SEQUENTIAL
==========
Summary: 206/953 PASSED, 4 SKIPPED, 0 FAILED

real    1m5.625s
user    0m4.211s
sys     0m31.650s

PARALLEL
========
Summary: 204/952 PASSED, 4 SKIPPED, 2 FAILED

real    0m35.550s
user    0m4.998s
sys     0m39.890s

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211022223228.99920-5-andrii@kernel.org
tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c