public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Song Liu <song@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>, bpf <bpf@vger.kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@chromium.org>,
	Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>
Subject: Re: [RFC PATCH bpf-next 00/17] bpf: Add tracing multi link
Date: Mon, 8 Aug 2022 22:35:48 +0200	[thread overview]
Message-ID: <YvFzpK00k+F2FGwt@krava> (raw)
In-Reply-To: <CAPhsuW79BmASh7M79DG7O2AT60op5unujeHKe33BUhZdr+wd9A@mail.gmail.com>

On Mon, Aug 08, 2022 at 10:50:28AM -0700, Song Liu wrote:
> 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?

yes

> 
> >
> >  -  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.

I think it'd be possible to allow adding single trampoline on top of
multi trampoline by removing that single id from it and creating single
trampoline for that

I also thought of possibility to convert intersection IDs of two
multi trampolines into single trampolines.. but that might get slow 
if the common set is too big

the difficulty for the common solution was that if you allow to
split trampolines then bpf link can't carry pointers to trampolines
because they can be split into multiple new trampolines, so link
would need to store just array of IDs and use it to attach a program

then un/linking program and doing intersections with stored trampolines
and handling all the split cases turned out to be nightmare

but perhaps there's another solution

jirka

      reply	other threads:[~2022-08-08 20:35 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-08 14:06 [RFC PATCH bpf-next 00/17] bpf: Add tracing multi link Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 01/17] bpf: Link shimlink directly in trampoline Jiri Olsa
2022-08-08 17:40   ` Song Liu
2022-08-08 17:58     ` Stanislav Fomichev
2022-08-09 15:36       ` Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 02/17] bpf: Replace bpf_tramp_links with bpf_tramp_progs Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 03/17] bpf: Store trampoline progs in arrays Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 04/17] bpf: Add multi tracing attach types Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 05/17] bpf: Add bpf_tramp_id object Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 06/17] bpf: Pass image struct to reg/unreg/modify fentry functions Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 07/17] bpf: Add support to postpone trampoline update Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 08/17] bpf: Factor bpf_trampoline_lookup function Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 09/17] bpf: Factor bpf_trampoline_put function Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 10/17] bpf: Add support to attach program to multiple trampolines Jiri Olsa
2022-08-24  1:22   ` Alexei Starovoitov
2022-08-25 16:08     ` Jiri Olsa
2022-08-25 17:43       ` Alexei Starovoitov
2022-08-26  2:35         ` Andrii Nakryiko
2022-08-26 14:20           ` Jiri Olsa
2022-08-27  5:15             ` Andrii Nakryiko
2022-08-27 12:16               ` Jiri Olsa
2022-08-26  4:37         ` Song Liu
2022-08-08 14:06 ` [RFC PATCH bpf-next 11/17] bpf: Add support to create tracing multi link Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 12/17] libbpf: Add btf__find_by_glob_kind function Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 13/17] libbpf: Add support to create tracing multi link Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 14/17] selftests/bpf: Add fentry tracing multi func test Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 15/17] selftests/bpf: Add fexit " Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 16/17] selftests/bpf: Add fentry/fexit " Jiri Olsa
2022-08-08 14:06 ` [RFC PATCH bpf-next 17/17] selftests/bpf: Add mixed " Jiri Olsa
2022-08-08 17:50 ` [RFC PATCH bpf-next 00/17] bpf: Add tracing multi link Song Liu
2022-08-08 20:35   ` Jiri Olsa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YvFzpK00k+F2FGwt@krava \
    --to=olsajiri@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox