Re: [PATCH bpf-next v2] selftests/bpf: Use vmlinux.h for BPF programs

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

 



On Sun, Aug 17, 2025 at 11:31 PM Hengqi Chen <hengqi.chen@xxxxxxxxx> wrote:
>
> Some of the bpf test progs still use linux/libc headers.
> Let's use vmlinux.h instead like the rest of test progs.
> This will also ease cross compiling.
>
> Signed-off-by: Hengqi Chen <hengqi.chen@xxxxxxxxx>
> ---
>  tools/testing/selftests/bpf/progs/loop1.c         |  7 +------
>  tools/testing/selftests/bpf/progs/loop2.c         |  7 +------
>  tools/testing/selftests/bpf/progs/loop3.c         |  7 +------
>  tools/testing/selftests/bpf/progs/loop6.c         | 15 ++++-----------
>  tools/testing/selftests/bpf/progs/test_overhead.c |  5 +----
>  5 files changed, 8 insertions(+), 33 deletions(-)
>

I'm getting this:


progs/loop6.c:58:5: error: redefinition of 'config' as different kind of symbol
   58 | int config = 0;
      |   CLNG-BPF [test_progs] sock_addr_kern.bpf.o
    ^
/data/users/andriin/linux/tools/testing/selftests/bpf/tools/include/vmlinux.h:71906:25:
note: previous definition is here
 71906 | typedef struct config_s config;
       |                         ^
progs/loop6.c:69:6: error: unexpected type name 'config': expected expression
   69 |         if (config != 0)
      |             ^
  CLNG-BPF [test_progs] sock_destroy_prog.bpf.o
progs/loop6.c:92:9: error: expected identifier or '('
   92 |         config = 1;
      |                ^


So let's rename a too generically named variable?

pw-bot: cr


[...]





[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