selftests/bpf: Fix test_attach_probe for powerpc uprobes
authorJiri Olsa <jolsa@kernel.org>
Fri, 5 Mar 2021 13:40:50 +0000 (14:40 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 8 Mar 2021 16:43:20 +0000 (08:43 -0800)
commit299194a91451263020c73dd2a3b7e0218c88dbd0
tree8b719213f0543bc2f202f6650362fdfe23c6ab8a
parent256becd450172eec74566f1aa7819ce80181d7e1
selftests/bpf: Fix test_attach_probe for powerpc uprobes

When testing uprobes we the test gets GEP (Global Entry Point)
address from kallsyms, but then the function is called locally
so the uprobe is not triggered.

Fixing this by adjusting the address to LEP (Local Entry Point)
for powerpc arch plus instruction check stolen from ppc_function_entry
function pointed out and explained by Michael and Naveen.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Link: https://lore.kernel.org/bpf/20210305134050.139840-1-jolsa@kernel.org
tools/testing/selftests/bpf/prog_tests/attach_probe.c