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