On Thu, May 21, 2026 at 5:45 AM Jiri Olsa <[email protected]> wrote:
>
> Optimized uprobes are now on top of 10-bytes nop instructions,
> reflect that in existing tests.
>
> Signed-off-by: Jiri Olsa <[email protected]>
> ---
>  .../selftests/bpf/benchs/bench_trigger.c      |  2 +-
>  .../selftests/bpf/prog_tests/uprobe_syscall.c | 28 ++++++++++---------
>  tools/testing/selftests/bpf/prog_tests/usdt.c | 25 ++++++++++-------
>  tools/testing/selftests/bpf/usdt_2.c          |  2 +-
>  4 files changed, 32 insertions(+), 25 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/benchs/bench_trigger.c 
> b/tools/testing/selftests/bpf/benchs/bench_trigger.c
> index 2f22ec61667b..a60b8173cdc4 100644
> --- a/tools/testing/selftests/bpf/benchs/bench_trigger.c
> +++ b/tools/testing/selftests/bpf/benchs/bench_trigger.c
> @@ -398,7 +398,7 @@ static void *uprobe_producer_ret(void *input)
>  #ifdef __x86_64__
>  __nocf_check __weak void uprobe_target_nop5(void)

heh, nop5 -> nop_a_lot ;)


>  {
> -       asm volatile (".byte 0x0f, 0x1f, 0x44, 0x00, 0x00");
> +       asm volatile (".byte 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 
> 0x00, 0x00");
>  }
>

[...]

> @@ -420,7 +421,8 @@ static void *check_attach(struct uprobe_syscall_executed 
> *skel, trigger_t trigge
>         ASSERT_EQ(skel->bss->executed, executed, "executed");
>
>         /* .. and check the trampoline is as expected. */
> -       call = (struct __arch_relative_insn *) addr;
> +       ASSERT_OK(memcmp(addr, lea_rsp, 5), "lea_rsp");
> +       call = (struct __arch_relative_insn *)(addr + 5);
>         tramp = (void *) (call + 1) + call->raddr;
>         ASSERT_EQ(call->op, 0xe8, "call");
>         ASSERT_OK(find_uprobes_trampoline(tramp), "uprobes_trampoline");
> @@ -432,7 +434,7 @@ static void check_detach(void *addr, void *tramp)
>  {
>         /* [uprobes_trampoline] stays after detach */
>         ASSERT_OK(find_uprobes_trampoline(tramp), "uprobes_trampoline");
> -       ASSERT_OK(memcmp(addr, nop5, 5), "nop5");
> +       ASSERT_OK(memcmp(addr, jmp2B, 2), "jmp2B");

yeah, not jump anymore?

>  }
>
>  static void check(struct uprobe_syscall_executed *skel, struct bpf_link 
> *link,

[...]

Reply via email to