BPF List
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Viktor Malik <vmalik@redhat.com>, 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>,
	"Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Subject: Re: [PATCH RFC bpf-next 2/4] bpf: Add return prog to kprobe multi
Date: Sat, 10 Feb 2024 16:29:32 +0100	[thread overview]
Message-ID: <ZceWXBXGum-tF3sV@krava> (raw)
In-Reply-To: <CAADnVQKi+o5LE+oLCvpL5PmVX2BjJdt9a2HEQiXmTgXRLYV+zA@mail.gmail.com>

On Thu, Feb 08, 2024 at 11:05:06AM -0800, Alexei Starovoitov wrote:
> On Wed, Feb 7, 2024 at 7:36 AM Jiri Olsa <jolsa@kernel.org> wrote:
> >
> >
> > In addition it's possible to control the execution of the return probe
> > with the return value of the entry bpf program. If the entry program
> > returns 0 the return probe is installed and executed, otherwise it's
> > skip.
> 
> Let's not sneak in a big change in behavior like this.
> 
> > @@ -2828,8 +2832,8 @@ kprobe_multi_link_handler(struct fprobe *fp, unsigned long fentry_ip,
> >         struct bpf_kprobe_multi_link *link;
> >
> >         link = container_of(fp, struct bpf_kprobe_multi_link, fp);
> > -       kprobe_multi_link_prog_run(link, get_entry_ip(fentry_ip), regs);
> > -       return 0;
> > +       return kprobe_multi_link_prog_run(link, link->link.prog,
> > +                                         get_entry_ip(fentry_ip), regs);
> 
> This is big.
> What motivates this change?

hm, this makes the difference only when the new interface is used, so I
thought about it as part of the new interface.. but right, if existing
programs are attached with new interface and un-aware of this, that might
cause issues

in tetragon we use logic where the entry probe does some filtering and
related return probe either gathers other data or quit based on that
filter result

with this change we can eliminate return probe being triggered completely
when the entry filter does not pass

jirka

  reply	other threads:[~2024-02-10 15:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07 15:35 [PATCH RFC bpf-next 0/4] bpf: Add support to attach return prog in kprobe multi Jiri Olsa
2024-02-07 15:35 ` [PATCH RFC bpf-next 1/4] fprobe: Add entry/exit callbacks types Jiri Olsa
2024-02-13 15:35   ` Masami Hiramatsu
2024-02-15  9:08     ` Jiri Olsa
2024-02-07 15:35 ` [PATCH RFC bpf-next 2/4] bpf: Add return prog to kprobe multi Jiri Olsa
2024-02-08 19:05   ` Alexei Starovoitov
2024-02-10 15:29     ` Jiri Olsa [this message]
2024-02-07 15:35 ` [PATCH RFC bpf-next 3/4] libbpf: Add return_prog_fd to kprobe multi opts Jiri Olsa
2024-02-07 15:35 ` [PATCH RFC bpf-next 4/4] selftests/bpf: Add kprobe multi return prog test Jiri Olsa
2024-02-08 19:35 ` [PATCH RFC bpf-next 0/4] bpf: Add support to attach return prog in kprobe multi Andrii Nakryiko
2024-02-10 15:31   ` Jiri Olsa
2024-02-13  4:06     ` Andrii Nakryiko
2024-02-13 12:09       ` Jiri Olsa
2024-02-13 18:20         ` Andrii Nakryiko
2024-02-13 21:09           ` Jiri Olsa
2024-02-14 20:55             ` Jiri Olsa
2024-02-15 16:27               ` Steven Rostedt
2024-02-16 15:03                 ` Jiri Olsa
2024-02-19 11:20             ` Viktor Malik
2024-02-19 12:43               ` Jiri Olsa
2024-02-23  9:32         ` Jiri Olsa
2024-02-29  0:43           ` Andrii Nakryiko
2024-02-29  1:25             ` Andrii Nakryiko

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=ZceWXBXGum-tF3sV@krava \
    --to=olsajiri@gmail.com \
    --cc=alexei.starovoitov@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=mhiramat@kernel.org \
    --cc=sdf@google.com \
    --cc=songliubraving@fb.com \
    --cc=vmalik@redhat.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