Re: [PATCH perf/core 07/11] libbpf: Add support to attach generic unique uprobe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 2, 2025 at 7:36 AM Jiri Olsa <jolsa@xxxxxxxxxx> 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@xxxxxxxxxx>
> ---
>  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.

[...]





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux