Re: Kernel 5.5.4 build fail for BPF-selftests with latest LLVM

From: Alexei Starovoitov
Date: Wed Feb 19 2020 - 19:27:56 EST


On Wed, Feb 19, 2020 at 03:59:41PM -0600, Daniel Díaz wrote:
> >
> > When I download a specific kernel release, how can I know what LLVM
> > git-hash or version I need (to use BPF-selftests)?

as discussed we're going to add documentation-like file that will
list required commits in tools.
This will be enforced for future llvm/pahole commits.

> > Do you think it is reasonable to require end-users to compile their own
> > bleeding edge version of LLVM, to use BPF-selftests?

absolutely.
If a developer wants to send a patch they must run all selftests and
all of them must pass in their environment.
"but I'm adding a tracing feature and don't care about networking tests
failing"... is not acceptable.

> > I do hope that some end-users of BPF-selftests will be CI-systems.
> > That also implies that CI-system maintainers need to constantly do
> > "latest built from sources" of LLVM git-tree to keep up. Is that a
> > reasonable requirement when buying a CI-system in the cloud?

"buying CI-system in the cloud" ?
If I could buy such system I would pay for it out of my own pocket to save
maintainer's and developer's time.

> We [1] are end users of kselftests and many other test suites [2]. We
> run all of our testing on every git-push on linux-stable-rc, mainline,
> and linux-next -- approximately 1 million tests per week. We have a
> dedicated engineering team looking after this CI infrastructure and
> test results, and as such, I can wholeheartedly echo Jesper's
> sentiment here: We would really like to help kernel maintainers and
> developers by automatically testing their code in real hardware, but
> the BPF kselftests are difficult to work with from a CI perspective.
> We have caught and reported [3] many [4] build [5] failures [6] in the
> past for libbpf/Perf, but building is just one of the pieces. We are
> unable to run the entire BPF kselftests because only a part of the
> code builds, so our testing is very limited there.
>
> We hope that this situation can be improved and that our and everyone
> else's automated testing can help you guys too. For this to work out,
> we need some help.

I don't understand what kind of help you need. Just install the latest tools.
Both the latest llvm and the latest pahole are required.
If by 'help' you mean to tweak selftests to skip tests then it's a nack.
We have human driven CI. Every developer must run selftests/bpf before
emailing the patches. Myself and Daniel run them as well before applying.
These manual runs is the only thing that keeps bpf tree going.
If selftests get to skip tests humans will miss those errors.
When I don't see '0 SKIPPED, 0 FAILED' I go and investigate.
Anything but zero is a path to broken kernels.

Imagine the tests would get skipped when pahole is too old.
That would mean all of the kernel features from year 2019
would get skipped. Is there a point of running such selftests?
I think the value is not just zero. The value is negative.
Such selftests that run old stuff would give false believe
that they do something meaningful.
"but CI can do build only tests"... If 'helping' such CI means hurting the
key developer/maintainer workflow such CI is on its own.