diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2024-02-01 09:20:27 -0800 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2024-02-01 22:16:12 +0100 |
commit | 943b043aeecce9accb6d367af47791c633e95e4d (patch) | |
tree | 97a7fbc05a135c421de0685dceeb38ee74693da4 /tools/testing/selftests/bpf/prog_tests/skb_load_bytes.c | |
parent | b9551da8cf3ade01a50316df8a618fd945723ee0 (diff) |
selftests/bpf: Fix bench runner SIGSEGV
Some benchmarks don't have either "consumer" or "producer" sides. For
example, trig-tp and other BPF triggering benchmarks don't have
consumers, as they only do "producing" by calling into syscall or
predefined uproes. As such it's valid for some benchmarks to have zero
consumers or producers. So allows to specify `-c0` explicitly.
This triggers another problem. If benchmark doesn't support either
consumer or producer side, consumer_thread/producer_thread callback will
be NULL, but benchmark runner will attempt to use those NULL callback to
create threads anyways. So instead of crashing with SIGSEGV in case of
misconfigured benchmark, detect the condition and report error.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/bpf/20240201172027.604869-6-andrii@kernel.org
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/skb_load_bytes.c')
0 files changed, 0 insertions, 0 deletions