Re: latest pahole breaks libbpf CI and let's talk about staging

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

 



On Wed, Jun 16, 2021 at 1:41 PM Arnaldo Carvalho de Melo
<arnaldo.melo@xxxxxxxxx> wrote:
>
> Em Wed, Jun 16, 2021 at 01:40:03PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Wed, Jun 16, 2021 at 11:56:06AM -0300, Arnaldo Carvalho de Melo escreveu:
> > > Em Tue, Jun 15, 2021 at 04:30:03PM -0700, Andrii Nakryiko escreveu:
> > > > Hey Arnaldo,
>
> > > > Seems like de3a7f912559 ("btf_encoder: Reduce the size of encode_cu()
> > > > by moving function encoding to separate method") break two selftests
> > > > in libbpf CI (see [0]). Please take a look. I suspect some bad BTF,
> > > > because both tests rely on kernel BTF info.
>
> > > > You've previously asked about staging pahole changes. Did you make up
> > > > your mind about branch names and the process overall? Seems like a
> > > > good chance to bring this up ;-P
>
> > > >   [0] https://travis-ci.com/github/libbpf/libbpf/jobs/514329152
>
> > > Ok, please add tmp.master as the staging branch, I'll move things to
> > > master only after it passing thru CI.
>
> > > Now looking at that code, must be something subtle...
>
> > Running selftests I'm getting a failure at:
>
> >   GEN-SKEL [test_progs] bpf_cubic.skel.h
> > libbpf: failed to find BTF for extern 'tcp_cong_avoid_ai' [27] section: -2
> > Error: failed to open BPF object file: No such file or directory
> > make: *** [Makefile:460: /mnt/linux/tools/testing/selftests/bpf/bpf_cubic.skel.h] Error 255
> > make: *** Deleting file '/mnt/linux/tools/testing/selftests/bpf/bpf_cubic.skel.h'
> > make: Leaving directory '/mnt/linux/tools/testing/selftests/bpf'
> > [acme@seventh linux]$
>
> > I'll try to reproduce what you reported, i.e. revert that patch, and
> > rebuild the kernel.
>
> I tried with 1.21 plus that ftrace fix but I still get:
>
> [acme@seventh linux]$ uname -a
> Linux seventh 5.13.0-rc6.pahole-58a98f76ac95b1bb+ #1 SMP Wed Jun 16 15:47:50 -03 2021 x86_64 x86_64 x86_64 GNU/Linux
>
> Which is pahole build up to:
>
> ⬢[acme@toolbox pahole]$ git log --oneline -4 58a98f76ac95b1bb
> 58a98f76ac95b1bb btf: Remove ftrace filter
> 7c60b0443cb01795 pahole: Fix error message when --header couldn't be read
> 7eea706c14997b4f pahole: Introduce --with_flexible_array option to show just types ending in a flexible array
> 25ad41e7b52e3ad6 (tag: v1.21) pahole: Prep 1.21
> ⬢[acme@toolbox pahole]$
>
> But selftests is still failing at:
>
> [acme@seventh linux]$ sudo make -C tools/testing/selftests/bpf/ clean > /dev/null 2>&1
> [sudo] password for acme:
> [acme@seventh linux]$ sudo make -C tools/testing/selftests/bpf/ clean > /dev/null 2>&1
> [acme@seventh linux]$ sudo make -C tools/testing/selftests/bpf/ | tail
> Warning: Kernel ABI header at 'tools/include/uapi/linux/netlink.h' differs from latest version at 'include/uapi/linux/netlink.h'
> Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h'
> libbpf: elf: skipping unrecognized data section(5) .rodata.str1.1
> libbpf: elf: skipping unrecognized data section(5) .rodata.str1.1
> libbpf: failed to find BTF for extern 'tcp_cong_avoid_ai' [27] section: -2
> Error: failed to open BPF object file: No such file or directory
> make: *** [Makefile:460: /mnt/linux/tools/testing/selftests/bpf/bpf_cubic.skel.h] Error 255
> make: *** Deleting file '/mnt/linux/tools/testing/selftests/bpf/bpf_cubic.skel.h'
>   CLNG-BPF [test_maps] xdping_kern.o
>   CLNG-BPF [test_maps] xdp_redirect_map.o
>   CLNG-BPF [test_maps] xdp_tx.o
>   GEN-SKEL [test_progs] atomic_bounds.skel.h
>   GEN-SKEL [test_progs] atomics.skel.h
>   GEN-SKEL [test_progs] bind4_prog.skel.h
>   GEN-SKEL [test_progs] bind6_prog.skel.h
>   GEN-SKEL [test_progs] bind_perm.skel.h
>   GEN-SKEL [test_progs] bpf_cubic.skel.h
> make: Leaving directory '/mnt/linux/tools/testing/selftests/bpf'
> [acme@seventh linux]$
>
> And if I use pahole's BTF loader I find the info about that function:
>
> [acme@seventh linux]$ strace -e openat -o /tmp/bla pfunct -F btf tcp_cong_avoid_ai  ; grep vmlinux /tmp/bla
> void tcp_cong_avoid_ai(struct tcp_sock * tp, u32 w, u32 acked);
> openat(AT_FDCWD, "/sys/kernel/btf/vmlinux", O_RDONLY) = 3
>
> So this should be unrelated to the breakage you noticed in the CI.
>
> I'm trying to to reproduce the CI breakage by building the kernel and
> running selftests after a reboot.
>
> I suspect I'm missing something, can you see what it is?

Oh, I didn't realize initially what it is. This is not kernel-related,
you are right. You just need newer Clang. Can you please use nightly
version or build from sources? Basically, your Clang is too old and it
doesn't generate BTF information for extern functions in BPF code.

>
> - Arnaldo
>
> > [acme@seventh linux]$ uname -a
> > Linux seventh 5.13.0-rc6+ #1 SMP Wed Jun 16 11:59:35 -03 2021 x86_64 x86_64 x86_64 GNU/Linux
> >
> > [acme@seventh linux]$ sudo make -C tools/testing/selftests/bpf/

[...]

>
> --
>
> - Arnaldo




[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