All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Eduard Zingerman <eddyz87@gmail.com>
Cc: Andrii Nakryiko <andrii@kernel.org>,
	bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	martin.lau@kernel.org, kernel-team@meta.com,
	Stanislav Fomichev <sdf@google.com>
Subject: Re: [PATCH v2 bpf-next 3/5] bpf: support BPF cookie in raw tracepoint (raw_tp, tp_btf) programs
Date: Tue, 19 Mar 2024 13:48:27 +0100	[thread overview]
Message-ID: <ZfmJm21mKaJN4vyh@krava> (raw)
In-Reply-To: <43eaaada2757048eed490ef2bc74d5d310889410.camel@gmail.com>

On Tue, Mar 19, 2024 at 11:19:08AM +0200, Eduard Zingerman wrote:
> On Mon, 2024-03-18 at 11:40 -0700, Andrii Nakryiko wrote:
> 
> [...]
> 
> > @@ -2373,15 +2378,23 @@ static __always_inline
> >  void __bpf_trace_run(struct bpf_raw_tp_link *link, u64 *args)
> >  {
> >  	struct bpf_prog *prog = link->link.prog;
> > +	struct bpf_run_ctx *old_run_ctx;
> > +	struct bpf_trace_run_ctx run_ctx;
> 
> The struct bpf_trace_run_ctx has two fields: bpf_cookie, is_uprobe
> (there is also run_ctx but it's size is zero).
> The is_uprobe field is not set by the code below.
> Is it necessary to zero-init `run_ctx` variable?
> 

I think it's ok because the is_uprobe is used by kprobes/uprobes helpers
while here it's used for tp programs, so it won't be used

OTOH it might be cleaner to add special run ctx struct for tp programs,
(like bpf_tp_run_ctx) to avoid confusion.. but then we'd need new helper
version for bpf_get_attach_cookie.. perhaps just adding some explaining
comment will be fine

jirka

  reply	other threads:[~2024-03-19 12:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18 18:40 [PATCH v2 bpf-next 0/5] BPF raw tracepoint support for BPF cookie Andrii Nakryiko
2024-03-18 18:40 ` [PATCH v2 bpf-next 1/5] bpf: flatten bpf_probe_register call chain Andrii Nakryiko
2024-03-18 18:40 ` [PATCH v2 bpf-next 2/5] bpf: pass whole link instead of prog when triggering raw tracepoint Andrii Nakryiko
2024-03-18 18:40 ` [PATCH v2 bpf-next 3/5] bpf: support BPF cookie in raw tracepoint (raw_tp, tp_btf) programs Andrii Nakryiko
2024-03-19  9:19   ` Eduard Zingerman
2024-03-19 12:48     ` Jiri Olsa [this message]
2024-03-19 16:09       ` Andrii Nakryiko
2024-03-19 16:23         ` Jiri Olsa
2024-03-19 16:26         ` Eduard Zingerman
2024-03-18 18:40 ` [PATCH v2 bpf-next 4/5] libbpf: add support for BPF cookie for raw_tp/tp_btf programs Andrii Nakryiko
2024-03-19  7:20   ` Alexei Starovoitov
2024-03-19 16:15     ` Andrii Nakryiko
2024-03-19 10:41   ` Eduard Zingerman
2024-03-19 16:16     ` Andrii Nakryiko
2024-03-19 16:24       ` Eduard Zingerman
2024-03-19 16:27         ` Andrii Nakryiko
2024-03-18 18:40 ` [PATCH v2 bpf-next 5/5] selftests/bpf: add raw_tp/tp_btf BPF cookie subtests 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=ZfmJm21mKaJN4vyh@krava \
    --to=olsajiri@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=martin.lau@kernel.org \
    --cc=sdf@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.