On Tue, Sep 2, 2025 at 7:36 AM Jiri Olsa <jo...@kernel.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 <jo...@kernel.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. [...]