On Mon, Feb 21, 2022 at 11:41 PM Xu Kuohai <xukuohai@xxxxxxxxxx> wrote: > > If a FWD appears in the BTF before a STRUCT with the same name, the > STRUCT is dumped with a conflicted name: > > $ bpftool btf dump file vmlinux format raw | grep "'unix_sock'" > [81287] FWD 'unix_sock' fwd_kind=struct > [89336] STRUCT 'unix_sock' size=1024 vlen=14 > > $ bpftool btf dump file vmlinux format c | grep "struct unix_sock" > struct unix_sock; > struct unix_sock___2 { <--- conflict, the "___2" is unexpected > struct unix_sock___2 *unix_sk; > > Fixes: 351131b51c7a ("libbpf: add btf_dump API for BTF-to-C conversion") > Signed-off-by: Xu Kuohai <xukuohai@xxxxxxxxxx> Acked-by: Song Liu <songliubraving@xxxxxx>