[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4BzaT+fAMqFXDMFV1tiRSu0vTy3btcx1TS8FyawSe0TQ95g@mail.gmail.com>
Date: Wed, 3 Sep 2025 11:26:47 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Jiri Olsa <jolsa@...nel.org>
Cc: Oleg Nesterov <oleg@...hat.com>, Masami Hiramatsu <mhiramat@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, Andrii Nakryiko <andrii@...nel.org>, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
x86@...nel.org, Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>, Hao Luo <haoluo@...gle.com>,
Steven Rostedt <rostedt@...dmis.org>, Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH perf/core 07/11] libbpf: Add support to attach generic
unique uprobe
On Tue, Sep 2, 2025 at 7:36 AM Jiri Olsa <jolsa@...nel.org> wrote:
>
> Adding support to attach unique generic uprobe by adding the 'unique'
> bool flag to struct bpf_uprobe_opts.
>
> Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> ---
> tools/lib/bpf/libbpf.c | 29 ++++++++++++++++++++++++-----
> tools/lib/bpf/libbpf.h | 4 +++-
> 2 files changed, 27 insertions(+), 6 deletions(-)
>
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index 1f613a5f95b6..aac2bd4fb95e 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -11045,11 +11045,19 @@ static int determine_uprobe_retprobe_bit(void)
> return parse_uint_from_file(file, "config:%d\n");
> }
>
> +static int determine_uprobe_unique_bit(void)
> +{
> + const char *file = "/sys/bus/event_source/devices/uprobe/format/unique";
> +
> + return parse_uint_from_file(file, "config:%d\n");
> +}
perf event-based attachment is legacy and libbpf will automatically
try to use BPF_LINK_CREATE, so I don't think we need to add this at
all.
But I also feel like we don't really need any special thing for
"exclusive uprobe", because ultimately we just want to let uprobe
override user registers, which we can allow for normal uprobes, as I
mentioned in the other email.
[...]
Powered by blists - more mailing lists