Re: [PATCH bpf-next v3 0/2] Fix btf dump error caused by declaration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 24, 2022 at 3:59 AM Xu Kuohai <xukuohai@xxxxxxxxxx> wrote:
>
> This series fixes a btf dump error caused by forward declaration.
>
> Currently if a declaration appears in the BTF before the definition,
> the definition is dumped as a conflicting name, eg:
>
>     $ 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;
>
> This causes a "definition not found" compilation error if the dump output
> is used as a header file.
>

seems like I replied about test failures on v2 instead of v3 (there
are test failures for v3, though), please check the link in that
reply. But I wanted to also mention that it would be great to keep a
succinct version log in the cover letter with what was changed or
fixed between versions (see other submissions on the mailing list).

> Xu Kuohai (2):
>   libbpf: Skip forward declaration when counting duplicated type names
>   selftests/bpf: Update btf_dump case for conflicting names
>
>  tools/lib/bpf/btf_dump.c                      |  5 ++
>  .../selftests/bpf/prog_tests/btf_dump.c       | 54 ++++++++++++++-----
>  2 files changed, 46 insertions(+), 13 deletions(-)
>
> --
> 2.30.2
>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux