Re: [RFC PATCH bpf-next 00/17] bpf: Add tracing multi link

Song Liu
2022-08-08T17:51:01Z

On Mon, Aug 8, 2022 at 7:06 AM Jiri Olsa <jolsa@kernel.org> wrote:
>
[...]
>
> Maybe better explained on following example:
>
> - you want to attach program P to functions A,B,C,D,E,F
> via bpf_trampoline_multi_attach
>
> - D,E,F already have standard trampoline attached
>
> - the bpf_trampoline_multi_attach will create new 'multi' trampoline
> which spans over A,B,C functions and attach program P to single
> trampolines D,E,F

IIUC, we have 4 trampolines (1 multi, 3 singles) at this moment?

>
> - another program can be attached to A,B,C,D,E,F multi trampoline
>
> - A,B,C functions are now 'not attachable' by any trampoline
> until the above 'multi' trampoline is released

I guess the limitation here is, multi trampolines cannot be splitted after
attached. While multi trampoline is motivated by short term use cases
like retsnoop, it is allowed to run them for extended periods of time.
Then, this limitation might be a real issue in production.

Thanks,
Song

>
> - D,E,F functions are still attachable by any new trampoline
>