On Sat, Mar 5, 2022 at 6:49 PM Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote: > > On Sat, Mar 05, 2022 at 01:20:42PM -0800, Yonghong Song wrote: > > > > On 3/4/22 11:16 AM, Hao Luo wrote: [...] > > > --- > > > .../selftests/bpf/bpf_testmod/bpf_testmod.c | 17 ++ > > > .../selftests/bpf/prog_tests/btf_tag.c | 164 ++++++++++++++---- > > > .../selftests/bpf/progs/btf_type_tag_percpu.c | 66 +++++++ > > > 3 files changed, 218 insertions(+), 29 deletions(-) > > > create mode 100644 tools/testing/selftests/bpf/progs/btf_type_tag_percpu.c [...] > > > +noinline int > > > +bpf_testmod_test_btf_type_tag_percpu_1(struct bpf_testmod_btf_type_tag_1 __percpu *arg) { > > > + BTF_TYPE_EMIT(func_proto_typedef); > > > + BTF_TYPE_EMIT(func_proto_typedef_nested1); > > > + BTF_TYPE_EMIT(func_proto_typedef_nested2); > > > > Are these necessary? They have been defined in > > bpf_testmod_test_btf_type_tag_user_1(). > > Yonghong, > Thanks. Good catch. I've removed those while applying. > Thanks Yonghong and Alexei. I wasn't sure their purpose and not sure whether I should include them, so copy-pasted it. > Hao, > Great work. > I really liked how patch 3 discovers MEM_PERCPU flag from > two sources: percpu_datasec and clang tag. Thanks Alexei! The BTF infrastructure together with clang tag is really amazing! [thumbs up]