Re: [RESEND][PATCH bpf 2/2] selftests/bpf: Add more test case for field flattening

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

 



On Thu, 2024-09-12 at 09:05 +0800, Hou Tao wrote:

[...]

> > progs/cpumask_failure.c:19:33: error: use of undeclared identifier 'BTF_FIELDS_MAX'; did you mean 'BTF_KIND_MAX'?
> >    19 |         struct kptr_nested_array_2 d_2[BTF_FIELDS_MAX + 1];
> >       |                                        ^~~~~~~~~~~~~~
> >       |                                        BTF_KIND_MAX
> > 
> > [...]
> 
> BTF_FIELDS_MAX should be defined in vmlinux.h. Could you please check
> whether or not it is present ? It seems that BPF CI reports the same
> problem for  build-x86_64-llvm-17/build-x86_64-llvm-18 [1], but others

(did you mean to specify a ling for [1] ?)

> build are OK.  Do you know  is there anything special about
> build-x86_64-llvm-17/18 ?
> 

Hm, this is interesting. I use LLVM 20.0.0git.
For BTF_FIELDS_MAX to be present in vmlinux.h it first has to be
present in vmlinux DWARF. However, the following output is empty:

  $ llvm-dwarfdump vmlinux | grep BTF_FIELDS_MAX

While picking some other enum literal:

  $ llvm-dwarfdump vmlinux | grep BTF_KIND_INT
                  DW_AT_name	("BTF_KIND_INT")
                  DW_AT_name	("BTF_KIND_INT")
                  ...

Produce output.

Looks like LLVM20 drops info about BTF_FIELDS_MAX for some reason.
I will take a look at compiler internals, but you would need some
workaround for the test, unfortunately.






[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