]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: Add test for raw-address single kprobe attach
authorHoyeon Lee <hoyeon.lee@suse.com>
Wed, 1 Apr 2026 14:29:31 +0000 (23:29 +0900)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 2 Apr 2026 20:23:19 +0000 (13:23 -0700)
commit9d77cefe8fcd4bd1c0bcfd4073fe6cd4325c8d9e
treedb8aa70bb6ed814b79c44634c9caf018e8669a41
parente1621c752865dcd682d9f52c3566ba3c6b9ee589
selftests/bpf: Add test for raw-address single kprobe attach

Currently, attach_probe covers manual single-kprobe attaches by
func_name, but not the raw-address form that the PMU-based
single-kprobe path can accept.

This commit adds PERF and LINK raw-address coverage. It resolves
SYS_NANOSLEEP_KPROBE_NAME through kallsyms, passes the absolute address
in bpf_kprobe_opts.offset with func_name = NULL, and verifies that
kprobe and kretprobe are still triggered. It also verifies that LEGACY
rejects the same form.

Signed-off-by: Hoyeon Lee <hoyeon.lee@suse.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20260401143116.185049-4-hoyeon.lee@suse.com
tools/testing/selftests/bpf/prog_tests/attach_probe.c