Re: [PATCHv5 bpf-next 18/28] libbpf: Add bpf_link_create support for tracing_multi link

Jiri Olsa <[email protected]>
Newsgroups dev.linux.lists.sashiko,org.kernel.vger.bpf
Message-ID <aec7yX-RdKmzBZuo@krava>
On Sat, Apr 18, 2026 at 03:50:10AM +0000, [email protected] wrote:
> Sashiko AI review found 1 potential issue(s):
> - [Low] The patch relies on UAPI identifiers (`BPF_TRACE_FENTRY_MULTI`, `BPF_TRACE_FEXIT_MULTI`, `BPF_TRACE_FSESSION_MULTI` and `attr.link_create.tracing_multi`) that are missing from the kernel's UAPI headers.
> --
> 
> commit c0f93aeff516311471202b8e10f7e659acca62b7
> Author: Jiri Olsa <[email protected]>
> 
> libbpf: Add bpf_link_create support for tracing_multi link
> 
> This commit adds bpf_link_create support for the tracing_multi link,
> introducing a new tracing_multi record in struct bpf_link_create_opts.
> 
> > diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
> > index 5846de3642090..ad4c94b6758d3 100644
> > --- a/tools/lib/bpf/bpf.c
> > +++ b/tools/lib/bpf/bpf.c
> > @@ -790,6 +790,15 @@ int bpf_link_create(int prog_fd, int target_fd,
> >  		if (!OPTS_ZEROED(opts, uprobe_multi))
> >  			return libbpf_err(-EINVAL);
> >  		break;
> > +	case BPF_TRACE_FENTRY_MULTI:
> > +	case BPF_TRACE_FEXIT_MULTI:
> > +	case BPF_TRACE_FSESSION_MULTI:
> > +		attr.link_create.tracing_multi.ids = ptr_to_u64(OPTS_GET(opts, tracing_multi.ids, 0));
> 
> Are BPF_TRACE_FENTRY_MULTI, BPF_TRACE_FEXIT_MULTI, BPF_TRACE_FSESSION_MULTI,
> and attr.link_create.tracing_multi defined in the kernel's UAPI headers?

it part of the related kernel patches:
  bpf: Add multi tracing attach types
  bpf: Add support for tracing multi link

jirka


> 
> It looks like these enum variants and the tracing_multi structure within the
> link_create union of union bpf_attr are missing from include/uapi/linux/bpf.h
> and tools/include/uapi/linux/bpf.h. Attempting to use these undeclared
> identifiers breaks compilation. Is there a missing patch in this series that
> updates the UAPI headers?
> 
> > +		attr.link_create.tracing_multi.cookies = ptr_to_u64(OPTS_GET(opts, tracing_multi.cookies, 0));
> > +		attr.link_create.tracing_multi.cnt = OPTS_GET(opts, tracing_multi.cnt, 0);
> > +		if (!OPTS_ZEROED(opts, tracing_multi))
> > +			return libbpf_err(-EINVAL);
> > +		break;
> >  	case BPF_TRACE_RAW_TP:
> 
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.