On Mon, Apr 24, 2023 at 9:06 AM Jiri Olsa <jolsa@xxxxxxxxxx> wrote: > > Adding uprobe_multi bool to struct bpf_usdt_opts. If it's true > the usdt_manager_attach_usdt will use uprobe_multi link to attach > to usdt probes. > > The bpf program for usdt probe needs to have BPF_TRACE_UPROBE_MULTI > set as expected_attach_type. > > Because current uprobe is implemented through perf event interface, > it allows the pid filter for uprobes. This is not the case for > uprobe_multi link, so the pid filter is not allowed for that. Ok, yep, let's fix that at kernel UAPI level and use multi-uprobe transparently, if kernel supports it. This seems like a big UX problem currently with uprobe.multi (and consequently with USDT programs) > > Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx> > --- > tools/lib/bpf/libbpf.c | 9 ++- > tools/lib/bpf/libbpf.h | 2 + > tools/lib/bpf/libbpf_internal.h | 2 +- > tools/lib/bpf/usdt.c | 127 ++++++++++++++++++++++++-------- > 4 files changed, 105 insertions(+), 35 deletions(-) > [...]