From: Jiri Olsa <jolsa@kernel.org> Date: 2021-03-05 13:42:06
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.
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Naveen N. Rao <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
.../selftests/bpf/prog_tests/attach_probe.c | 40 ++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
@@ -36,7 +74,7 @@ void test_attach_probe(void)if(CHECK(base_addr<0,"get_base_addr","failed to find base addr: %zd",base_addr))return;-uprobe_offset=(size_t)&get_base_addr-base_addr;+uprobe_offset=get_offset((size_t)&get_base_addr,base_addr);skel=test_attach_probe__open_and_load();if(CHECK(!skel,"skel_open","failed to open skeleton\n"))
On Fri, Mar 5, 2021 at 5:42 AM Jiri Olsa [off-list ref] wrote:
quoted hunk
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.
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Naveen N. Rao <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
.../selftests/bpf/prog_tests/attach_probe.c | 40 ++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
From: Jiri Olsa <hidden> Date: 2021-03-07 11:15:31
On Sat, Mar 06, 2021 at 07:13:17PM -0800, Andrii Nakryiko wrote:
On Fri, Mar 5, 2021 at 5:42 AM Jiri Olsa [off-list ref] wrote:
quoted
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.
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Naveen N. Rao <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
.../selftests/bpf/prog_tests/attach_probe.c | 40 ++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
From: Naveen N . Rao <hidden> Date: 2021-03-08 10:46:05
On 2021/03/05 02:40PM, Jiri Olsa wrote:
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.
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Naveen N. Rao <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
.../selftests/bpf/prog_tests/attach_probe.c | 40 ++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
LGTM. FWIW:
Acked-by: Naveen N. Rao <redacted>
Thanks,
- Naveen