selftests/bpf: Test btf dump for struct with padding only fields
authorEduard Zingerman <eddyz87@gmail.com>
Sat, 1 Oct 2022 10:44:25 +0000 (13:44 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Apr 2023 10:10:57 +0000 (12:10 +0200)
commit2e35b08b66b0b2558216b3764df729d9fe2012ed
treece44773acc2a4a7ec65ebc02f4563b35dd46c2ec
parent0f9e728e1a6c83dfebb367f9dec6fc6ef1dc6cbb
selftests/bpf: Test btf dump for struct with padding only fields

[ Upstream commit d503f1176b14f722a40ea5110312614982f9a80b ]

Structures with zero regular fields but some padding constitute a
special case in btf_dump.c:btf_dump_emit_struct_def with regards to
newline before closing '}'.

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20221001104425.415768-2-eddyz87@gmail.com
Stable-dep-of: ea2ce1ba99aa ("libbpf: Fix BTF-to-C converter's padding logic")
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/progs/btf_dump_test_case_padding.c