selftests/bpf: Add tests for u[ret]probe attach by name
authorAlan Maguire <alan.maguire@oracle.com>
Wed, 30 Mar 2022 15:26:39 +0000 (16:26 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 4 Apr 2022 02:56:00 +0000 (19:56 -0700)
commitba7499bc9d52f7ea93301a48c05caa370c68b213
tree4dc538d047e46b7e79ca6e050db6fd0b90d3be3f
parent39f8dc43b7a05ab0e352655a14a9d613c2308b92
selftests/bpf: Add tests for u[ret]probe attach by name

add tests that verify attaching by name for

1. local functions in a program
2. library functions in a shared object

...succeed for uprobe and uretprobes using new "func_name"
option for bpf_program__attach_uprobe_opts().  Also verify
auto-attach works where uprobe, path to binary and function
name are specified, but fails with -EOPNOTSUPP with a SEC
name that does not specify binary path/function.

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/1648654000-21758-5-git-send-email-alan.maguire@oracle.com
tools/testing/selftests/bpf/prog_tests/attach_probe.c
tools/testing/selftests/bpf/progs/test_attach_probe.c