mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH bpf-next v3 0/2] libbpf: clarify raw-address single kprobe attach behavior
@ 2026-03-31  9:37 Hoyeon Lee
  2026-03-31  9:37 ` [PATCH bpf-next v3 1/2] " Hoyeon Lee
  2026-03-31  9:37 ` [PATCH bpf-next v3 2/2] selftests/bpf: add test for raw-address single kprobe attach Hoyeon Lee
  0 siblings, 2 replies; 3+ messages in thread
From: Hoyeon Lee @ 2026-03-31  9:37 UTC (permalink / raw)
  To: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau
  Cc: Eduard Zingerman, Kumar Kartikeya Dwivedi, Song Liu,
	Yonghong Song, Jiri Olsa, Shuah Khan, Feng Yang, linux-kselftest,
	linux-kernel

Today libbpf documents single-kprobe attach through func_name, with an
optional offset. For the PMU-based non-legacy path, func_name = NULL
with an absolute address in offset already works as well, but that is
not described in the API.

This patchset clarifies this behavior. The first commit clarifies that,
for the PMU-based path, callers can use func_name = NULL with an
absolute address in offset for raw-address attach, and makes legacy
tracefs/debugfs kprobes reject that form. The second commit adds PERF
and LINK selftests for the raw-address form, and checks that LEGACY
rejects it.

---
Changes in v3:
- Drop bpf_kprobe_opts.addr and reuse offset when func_name is NULL
- Make legacy tracefs/debugfs kprobes reject the raw-address form
- Update selftests to cover PERF/LINK raw-address attach and LEGACY reject

Changes in v2:
- Fix line wrapping and indentation

Hoyeon Lee (2):
  libbpf: clarify raw-address single kprobe attach behavior
  selftests/bpf: add test for raw-address single kprobe attach

 tools/lib/bpf/libbpf.c                        | 33 ++++++--
 tools/lib/bpf/libbpf.h                        |  3 +-
 .../selftests/bpf/prog_tests/attach_probe.c   | 82 +++++++++++++++++++
 3 files changed, 108 insertions(+), 10 deletions(-)

-- 
2.52.0

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

end of thread, other threads:[~2026-03-31  9:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-31  9:37 [PATCH bpf-next v3 0/2] libbpf: clarify raw-address single kprobe attach behavior Hoyeon Lee
2026-03-31  9:37 ` [PATCH bpf-next v3 1/2] " Hoyeon Lee
2026-03-31  9:37 ` [PATCH bpf-next v3 2/2] selftests/bpf: add test for raw-address single kprobe attach Hoyeon Lee

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

all inboxes | Powered by JetHome®