From: Hoyeon Lee <hoyeon.lee@suse.com>
To: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>
Cc: Eduard Zingerman <eddyz87@gmail.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
Jiri Olsa <jolsa@kernel.org>, Shuah Khan <shuah@kernel.org>,
Feng Yang <yangfeng@kylinos.cn>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH bpf-next v2 0/2] libbpf: allow address-based single kprobe attach
Date: Sun, 29 Mar 2026 21:43:37 +0900 [thread overview]
Message-ID: <20260329124429.689912-1-hoyeon.lee@suse.com> (raw)
Today libbpf can attach a single kprobe only by function name, with an
optional offset. But the kernel also supports attaching a single kprobe
directly by raw kernel address, through both legacy tracefs/debugfs
kprobes and PMU-based non-legacy kprobes. Since libbpf doesn't support
this yet, callers that already have a target IP still have to drop down
to perf_event_open() or direct tracefs writes.
This patchset adds address-based single-kprobe attach support to
bpf_program__attach_kprobe_opts() and covers it in selftests/bpf. The
first commit adds bpf_kprobe_opts.addr so that libbpf can attach single
kprobes by raw address through both legacy tracefs/debugfs and PMU-based
non-legacy paths. The second commit extends attach_probe selftests/bpf
with address-based kprobe attach subtests for these paths.
---
Changes in v2:
- Fix line wrapping and indentation
Hoyeon Lee (2):
libbpf: allow address-based single kprobe attach
selftests/bpf: add test for address-based single kprobe attach
tools/lib/bpf/libbpf.c | 88 +++++++++++++------
tools/lib/bpf/libbpf.h | 5 +-
.../selftests/bpf/prog_tests/attach_probe.c | 49 +++++++++++
3 files changed, 114 insertions(+), 28 deletions(-)
--
2.52.0
next reply other threads:[~2026-03-29 12:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-29 12:43 Hoyeon Lee [this message]
2026-03-29 12:43 ` [PATCH bpf-next v2 1/2] " Hoyeon Lee
2026-03-30 10:08 ` Jiri Olsa
2026-03-31 1:47 ` Hoyeon Lee
2026-03-31 0:33 ` Andrii Nakryiko
2026-03-31 1:48 ` Hoyeon Lee
2026-03-31 2:15 ` Alexei Starovoitov
2026-03-31 5:55 ` Hoyeon Lee
2026-03-29 12:43 ` [PATCH bpf-next v2 2/2] selftests/bpf: add test for " Hoyeon Lee
2026-03-30 10:08 ` Jiri Olsa
2026-03-31 2:01 ` Hoyeon Lee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260329124429.689912-1-hoyeon.lee@suse.com \
--to=hoyeon.lee@suse.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=yangfeng@kylinos.cn \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®