aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2024-02-01 17:20:27 +0000
committerDaniel Borkmann <[email protected]>2024-02-01 21:16:12 +0000
commit943b043aeecce9accb6d367af47791c633e95e4d (patch)
tree97a7fbc05a135c421de0685dceeb38ee74693da4 /tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
parentlibbpf: Add missed btf_ext__raw_data() API (diff)
downloadkernel-943b043aeecce9accb6d367af47791c633e95e4d.tar.gz
kernel-943b043aeecce9accb6d367af47791c633e95e4d.zip
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 <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Eduard Zingerman <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/sockmap_basic.c')
0 files changed, 0 insertions, 0 deletions