selftests/bpf: Fix btf_dump test cases on 32-bit arches
authorAndrii Nakryiko <andriin@fb.com>
Thu, 13 Aug 2020 20:49:41 +0000 (13:49 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:29:33 +0000 (11:29 +0200)
commit751799b3b2ef690273e919a0f3348c0db7c61f96
tree03dc6e0da43cef1f9139052d6b9ba3fbefcc402d
parentdaca0c13cb123dcbd51d8fcbb1f07cd79d676faf
selftests/bpf: Fix btf_dump test cases on 32-bit arches

[ Upstream commit eed7818adf03e874994b966aa33bc00204dd275a ]

Fix btf_dump test cases by hard-coding BPF's pointer size of 8 bytes for cases
where it's impossible to deterimne the pointer size (no long type in BTF). In
cases where it's known, validate libbpf correctly determines it as 8.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200813204945.1020225-6-andriin@fb.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/prog_tests/btf_dump.c