On Tue, Jun 23, 2020 at 11:58:33AM -0700, Andrii Nakryiko wrote: > On Tue, Jun 23, 2020 at 3:02 AM Jiri Olsa <jolsa@xxxxxxxxxx> wrote: > > > > On Mon, Jun 22, 2020 at 12:18:19PM -0700, Andrii Nakryiko wrote: > > > On Mon, Jun 22, 2020 at 2:02 AM Jiri Olsa <jolsa@xxxxxxxxxx> wrote: > > > > > > > > On Fri, Jun 19, 2020 at 11:25:27AM -0700, Andrii Nakryiko wrote: > > > > > > > > SNIP > > > > > > > > > > > > /* integer value in 'imm' field of BPF_CALL instruction selects which helper > > > > > > > > * function eBPF program intends to call > > > > > > > > diff --git a/kernel/bpf/btf_ids.c b/kernel/bpf/btf_ids.c > > > > > > > > index d8d0df162f04..853c8fd59b06 100644 > > > > > > > > --- a/kernel/bpf/btf_ids.c > > > > > > > > +++ b/kernel/bpf/btf_ids.c > > > > > > > > @@ -13,3 +13,14 @@ BTF_ID(struct, seq_file) > > > > > > > > > > > > > > > > BTF_ID_LIST(bpf_xdp_output_btf_ids) > > > > > > > > BTF_ID(struct, xdp_buff) > > > > > > > > + > > > > > > > > +BTF_ID_LIST(bpf_d_path_btf_ids) > > > > > > > > +BTF_ID(struct, path) > > > > > > > > + > > > > > > > > +BTF_WHITELIST_ENTRY(btf_whitelist_d_path) > > > > > > > > +BTF_ID(func, vfs_truncate) > > > > > > > > +BTF_ID(func, vfs_fallocate) > > > > > > > > +BTF_ID(func, dentry_open) > > > > > > > > +BTF_ID(func, vfs_getattr) > > > > > > > > +BTF_ID(func, filp_close) > > > > > > > > +BTF_WHITELIST_END(btf_whitelist_d_path) > > > > > > > > > > > > > > Oh, so that's why you added btf_ids.c. Do you think centralizing all > > > > > > > those BTF ID lists in one file is going to be more convenient? I lean > > > > > > > towards keeping them closer to where they are used, as it was with all > > > > > > > those helper BTF IDS. But I wonder what others think... > > > > > > > > > > > > either way works for me, but then BTF_ID_* macros needs to go > > > > > > to include/linux/btf_ids.h header right? > > > > > > > > > > > > > > > > given it's internal API, I'd probably just put it in > > > > > include/linux/btf.h or include/linux/bpf.h, don't think we need extra > > > > > header just for these > > > > > > > > actually, I might end up with extra header, so it's possible > > > > to add selftest for this > > > > > > > > > > How does extra header help with selftest? > > > > to create binary with various lists defined like we do in kernel > > using the same macros.. and check they are properly made/sorted > > > > So the problem here is that selftests don't have access to internal > (non-UAPI) linux/bpf.h header, right? Ok, that's a fair point. hm, how about we keep tools/include/linux/btf_ids.h copy like we do for other kernel headers jirka