public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/4] libbpf: Make optimized uprobes backward compatible
@ 2025-11-17  8:35 Jiri Olsa
  2025-11-17  8:35 ` [PATCH bpf-next 1/4] selftests/bpf: Emit nop,nop5 instructions for x86_64 usdt probe Jiri Olsa
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Jiri Olsa @ 2025-11-17  8:35 UTC (permalink / raw)
  To: Andrii Nakryiko
  Cc: bpf, linux-kernel, Song Liu, Yonghong Song, John Fastabend

hi,
we can currently optimize uprobes on top of nop5 instructions,
so application can define USDT_NOP to nop5 and use USDT macro
to define optimized usdt probes.

This works fine on new kernels, but could have performance penalty
on older kernels, that do not have the support to optimize and to
emulate nop5 instruction.

This patchset adds support to workaround the performance penalty
on older kernels that do not support uprobe optimization, please
see detailed description in patch 1.

Note patch 1 will need to get pushed to libbpf/usdt [1] as well.

thanks,
jirka


[1] https://github.com/libbpf/usdt
---
Jiri Olsa (4):
      selftests/bpf: Emit nop,nop5 instructions for x86_64 usdt probe
      libbpf: Add uprobe syscall feature detection
      libbpf: Add support to parse extra info in usdt note record
      selftests/bpf: Add test for checking correct nop of optimized usdt

 tools/lib/bpf/features.c                      | 22 ++++++++++++++++++++++
 tools/lib/bpf/libbpf_internal.h               |  2 ++
 tools/lib/bpf/usdt.c                          | 27 ++++++++++++++++++++++++++-
 tools/testing/selftests/bpf/.gitignore        |  2 ++
 tools/testing/selftests/bpf/Makefile          |  7 ++++++-
 tools/testing/selftests/bpf/prog_tests/usdt.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/testing/selftests/bpf/progs/test_usdt.c |  9 +++++++++
 tools/testing/selftests/bpf/usdt.h            | 17 +++++++++++++++++
 tools/testing/selftests/bpf/usdt_1.c          | 14 ++++++++++++++
 tools/testing/selftests/bpf/usdt_2.c          | 13 +++++++++++++
 10 files changed, 193 insertions(+), 2 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/usdt_1.c
 create mode 100644 tools/testing/selftests/bpf/usdt_2.c

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-11-26  8:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-17  8:35 [PATCH bpf-next 0/4] libbpf: Make optimized uprobes backward compatible Jiri Olsa
2025-11-17  8:35 ` [PATCH bpf-next 1/4] selftests/bpf: Emit nop,nop5 instructions for x86_64 usdt probe Jiri Olsa
2025-11-24 17:29   ` Andrii Nakryiko
2025-11-26  8:29     ` Jiri Olsa
2025-11-17  8:35 ` [PATCH bpf-next 2/4] libbpf: Add uprobe syscall feature detection Jiri Olsa
2025-11-24 17:29   ` Andrii Nakryiko
2025-11-26  8:29     ` Jiri Olsa
2025-11-17  8:35 ` [PATCH bpf-next 3/4] libbpf: Add support to parse extra info in usdt note record Jiri Olsa
2025-11-24 17:29   ` Andrii Nakryiko
2025-11-26  8:30     ` Jiri Olsa
2025-11-17  8:35 ` [PATCH bpf-next 4/4] selftests/bpf: Add test for checking correct nop of optimized usdt Jiri Olsa
2025-11-24 17:34   ` Andrii Nakryiko
2025-11-26  8:29     ` Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox