On Mon, Nov 7, 2022 at 3:11 PM Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx> wrote: > > Preparing the metadata for bpf_list_head involves a complicated parsing > step and type resolution for the contained value. Ensure that corner > cases are tested against and invalid specifications in source are duly > rejected. Also include tests for incorrect ownership relationships in > the BTF. > > Signed-off-by: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx> > --- > .../selftests/bpf/prog_tests/linked_list.c | 271 ++++++++++++++++++ > 1 file changed, 271 insertions(+) > Have you considered using BTW write API to construct BTFs? btf__new_empty() + btf__add_xxx()? > diff --git a/tools/testing/selftests/bpf/prog_tests/linked_list.c b/tools/testing/selftests/bpf/prog_tests/linked_list.c > index 669ef4bb9b87..40070e2d22f2 100644 > --- a/tools/testing/selftests/bpf/prog_tests/linked_list.c > +++ b/tools/testing/selftests/bpf/prog_tests/linked_list.c > @@ -1,4 +1,7 @@ > // SPDX-License-Identifier: GPL-2.0 > +#include <bpf/btf.h> > +#include <test_btf.h> > +#include <linux/btf.h> > #include <test_progs.h> > #include <network_helpers.h> > [...]