dwarves.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, dwarves@vger.kernel.org, siudin@fb.com
Subject: Re: latest pahole breaks libbpf CI and let's talk about staging
Date: Wed, 16 Jun 2021 15:36:54 -0700	[thread overview]
Message-ID: <CAEf4BzZmBbkU1WWLEsZG1yVMdt7CDcuHhRF8uoLqeamhef3bVQ@mail.gmail.com> (raw)
In-Reply-To: <YMph3VeKA1Met65X@kernel.org>

On Wed, Jun 16, 2021 at 1:41 PM Arnaldo Carvalho de Melo
<arnaldo.melo@gmail.com> 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

  reply	other threads:[~2021-06-16 22:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15 23:30 Andrii Nakryiko
2021-06-16 14:56 ` Arnaldo Carvalho de Melo
2021-06-16 16:40   ` Arnaldo Carvalho de Melo
2021-06-16 20:41     ` Arnaldo Carvalho de Melo
2021-06-16 22:36       ` Andrii Nakryiko [this message]
2021-06-17 14:48         ` Arnaldo Carvalho de Melo
2021-06-17 19:53           ` Arnaldo Carvalho de Melo
2021-06-17 20:03             ` Andrii Nakryiko
2021-06-17 20:41               ` Arnaldo Carvalho de Melo
2021-06-17 21:56                 ` Andrii Nakryiko
2021-06-17 20:00           ` Andrii Nakryiko
2021-06-17 20:39             ` Arnaldo Carvalho de Melo
2021-06-17 21:52               ` Andrii Nakryiko
2021-06-18 17:21                 ` Arnaldo Carvalho de Melo
2021-06-16 17:40   ` Andrii Nakryiko
2021-06-16 18:25     ` Arnaldo Carvalho de Melo
2021-06-16 22:38       ` Andrii Nakryiko
2021-06-17  0:16         ` Arnaldo Carvalho de Melo
2021-06-17  4:26           ` Andrii Nakryiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEf4BzZmBbkU1WWLEsZG1yVMdt7CDcuHhRF8uoLqeamhef3bVQ@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=arnaldo.melo@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=dwarves@vger.kernel.org \
    --cc=siudin@fb.com \
    --subject='Re: latest pahole breaks libbpf CI and let'\''s talk about staging' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).