Commit a2e562a6 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by sanglipeng
Browse files

libbpf: Fix single-line struct definition output in btf_dump

stable inclusion
from stable-v5.10.178
commit 6de0d0699f5c732e94540b5af41ad841f3a7fe83
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8D927

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6de0d0699f5c732e94540b5af41ad841f3a7fe83



--------------------------------

[ Upstream commit 872aec4b ]

btf_dump APIs emit unnecessary tabs when emitting struct/union
definition that fits on the single line. Before this patch we'd get:

struct blah {<tab>};

This patch fixes this and makes sure that we get more natural:

struct blah {};

Fixes: 44a726c3 ("bpftool: Print newline before '}' for struct with padding only fields")
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20221212211505.558851-2-andrii@kernel.org


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 700aac77
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment