Commit 5f28123
selftests/bpf: Add parallelism to test_progs
This patch adds "-j" mode to test_progs, executing tests in multiple process.
"-j" mode is optional, and works with all existing test selection mechanism, as
well as "-v", "-l" etc.
In "-j" mode, main process use UDS/DGRAM to communicate to each forked worker,
commanding it to run tests and collect logs. After all tests are finished, a
summary is printed. main process use multiple competing threads to dispatch
work to worker, trying to keep them all busy.
Example output:
> ./test_progs -n 15-20 -j
[ 8.584709] bpf_testmod: loading out-of-tree module taints kernel.
Launching 2 workers.
[0]: Running test 15.
[1]: Running test 16.
[1]: Running test 17.
[1]: Running test 18.
[1]: Running test 19.
[1]: Running test 20.
[1]: worker exit.
[0]: worker exit.
#15 btf_dump:OK
#16 btf_endian:OK
#17 btf_map_in_map:OK
#18 btf_module:OK
#19 btf_skc_cls_ingress:OK
#20 btf_split:OK
Summary: 6/20 PASSED, 0 SKIPPED, 0 FAILED
Know issue:
Some tests fail when running concurrently, later patch will either
fix the test or pin them to worker 0.
Signed-off-by: Yucong Sun <sunyucong@gmail.com>
V4 -> V3: address style warnings.
V3 -> V2: fix missing outputs in commit messages.
V2 -> V1: switch to UDS client/server model.1 parent 1975213 commit 5f28123
2 files changed
+480
-14
lines changed
0 commit comments