selftests/bpf: Add test for legacy/perf kprobe/uprobe attach mode
authorMenglong Dong <imagedong@tencent.com>
Mon, 6 Mar 2023 06:48:33 +0000 (14:48 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 6 Mar 2023 17:38:08 +0000 (09:38 -0800)
commitc7aec81b31e43a0aa94ee55d9bb33d70b1046f76
treeeefa1e4ee7a49976b875da1efd3a2fc422366cc1
parent7391ec6391e2b129aeaee5462487c404f61157aa
selftests/bpf: Add test for legacy/perf kprobe/uprobe attach mode

Add the testing for kprobe/uprobe attaching in default, legacy, perf and
link mode. And the testing passed:

./test_progs -t attach_probe
$5/1     attach_probe/manual-default:OK
$5/2     attach_probe/manual-legacy:OK
$5/3     attach_probe/manual-perf:OK
$5/4     attach_probe/manual-link:OK
$5/5     attach_probe/auto:OK
$5/6     attach_probe/kprobe-sleepable:OK
$5/7     attach_probe/uprobe-lib:OK
$5/8     attach_probe/uprobe-sleepable:OK
$5/9     attach_probe/uprobe-ref_ctr:OK
$5       attach_probe:OK
Summary: 1/9 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Menglong Dong <imagedong@tencent.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Biao Jiang <benbjiang@tencent.com>
Link: https://lore.kernel.org/bpf/20230306064833.7932-4-imagedong@tencent.com
tools/testing/selftests/bpf/prog_tests/attach_probe.c
tools/testing/selftests/bpf/progs/test_attach_probe.c
tools/testing/selftests/bpf/progs/test_attach_probe_manual.c [new file with mode: 0644]