]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Ensure snprintf_btf/bpf_iter tests compatibility with old vmlinux.h
authorAlan Maguire <alan.maguire@oracle.com>
Tue, 29 Sep 2020 11:32:31 +0000 (04:32 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 29 Sep 2020 18:10:48 +0000 (11:10 -0700)
commit8be5d1baf9cd51f65057f43e333ed332c2063c0e
tree3f29be202a46a6602d3ff5c65a02ed9cbdb4d5b4
parent37306a9e7143512cfac1000b55cfcb031c760636
selftests/bpf: Ensure snprintf_btf/bpf_iter tests compatibility with old vmlinux.h

Andrii reports that bpf selftests relying on "struct btf_ptr" and BTF_F_*
values will not build as vmlinux.h for older kernels will not include
"struct btf_ptr" or the BTF_F_* enum values.  Undefine and redefine
them to work around this.

Fixes: 7597b3a384bd ("selftests/bpf: Add test for bpf_seq_printf_btf helper")
Fixes: 193d30b95961 ("selftests/bpf: Add bpf_snprintf_btf helper tests")
Reported-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/1601379151-21449-3-git-send-email-alan.maguire@oracle.com
tools/testing/selftests/bpf/progs/bpf_iter.h
tools/testing/selftests/bpf/progs/btf_ptr.h [new file with mode: 0644]
tools/testing/selftests/bpf/progs/netif_receive_skb.c