]> git.dujemihanovic.xyz Git - linux.git/commit
selftests/bpf: extend multi-uprobe tests with child thread case
authorAndrii Nakryiko <andrii@kernel.org>
Tue, 21 May 2024 16:34:00 +0000 (09:34 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 25 May 2024 17:46:02 +0000 (10:46 -0700)
commit70342420a1cf1173bdec456e5fa574a804e422db
tree4636693b5cc3ec019e1c1e69b420f136b41b0ee1
parent04d939a2ab229a3821f04fc81f7c027842f501f1
selftests/bpf: extend multi-uprobe tests with child thread case

Extend existing multi-uprobe tests to test that PID filtering works
correctly. We already have child *process* tests, but we need also child
*thread* tests. This patch adds spawn_thread() helper to start child
thread, wait for it to be ready, and then instruct it to trigger desired
uprobes.

Additionally, we extend BPF-side code to track thread ID, not just
process ID. Also we detect whether extraneous triggerings with
unexpected process IDs happened, and validate that none of that happened
in practice.

These changes prove that fixed PID filtering logic for multi-uprobe
works as expected. These tests fail on old kernels.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20240521163401.3005045-5-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c
tools/testing/selftests/bpf/progs/uprobe_multi.c