Re: [PATCH RFC bpf-next 00/31] bpf: Attach kprobe multi link to inlined functions
From: Alexei Starovoitov
Date: Fri Dec 04 2026 - 23:50:21 EST
On Thu, Dec 03, 2026 at 06:20 AM Jiri Olsa <olsajiri@xxxxxxxxx> wrote:
> I think we need the skip flag. kprobes refuse some of the inlined
> sites (jump label, static call, bug table, NOKPROBE_SYMBOL, noinstr)
> and finding those in user space would need vmlinux and a copy of
> the kprobe checks, which seems too much
>
> I changed the bench test to print out the stats:
>
> inlined instances 20695
> attached 19947
> skipped, notrace function 563
> skipped, refused by kprobes 185
>
> it's the worst case, normal attach with just a few functions would
> hit much less, but it's still inconvenient, because user space has
> to retry the attach for each address the log names
I feel all or none is a better default, but flag makes sense.
>> Two functions inlined at one address share one cookie.
>
> I think we can still allow same addresses having their own cookie,
> if we keep the cookie in the kprobe struct and pass it through the
> run context instead of looking it up by the address
>
> it's probably needed for the arg specs too, two inline functions
> on the same address would otherwise end up with the same spec
yep. Even better. bpf_uprobe_multi_cookie() works that way.
The prog runs once per entry in addrs[], each time with its own cookie.
kprobes don't need the bsearch then.