aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/btf_dump_test_case_padding.c
diff options
context:
space:
mode:
authorEduard Zingerman <eddyz87@gmail.com>2022-10-01 13:44:24 +0300
committerAndrii Nakryiko <andrii@kernel.org>2022-10-05 15:27:08 -0700
commit44a726c3f23cf762ef4ce3c1709aefbcbe97f62c (patch)
treed794e11b70a042232f3230b68210edb187169e5b /tools/testing/selftests/bpf/progs/btf_dump_test_case_padding.c
parentMerge tag 'net-next-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/net... (diff)
downloadlinux-44a726c3f23cf762ef4ce3c1709aefbcbe97f62c.tar.gz
linux-44a726c3f23cf762ef4ce3c1709aefbcbe97f62c.zip
bpftool: Print newline before '}' for struct with padding only fields
btf_dump_emit_struct_def attempts to print empty structures at a single line, e.g. `struct empty {}`. However, it has to account for a case when there are no regular but some padding fields in the struct. In such case `vlen` would be zero, but size would be non-zero. E.g. here is struct bpf_timer from vmlinux.h before this patch: struct bpf_timer { long: 64; long: 64;}; And after this patch: struct bpf_dynptr { long: 64; long: 64; }; Signed-off-by: Eduard Zingerman <eddyz87@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20221001104425.415768-1-eddyz87@gmail.com
Diffstat (limited to 'tools/testing/selftests/bpf/progs/btf_dump_test_case_padding.c')
0 files changed, 0 insertions, 0 deletions