On Fri, 2024-01-19 at 16:04 +0800, Shung-Hsi Yu wrote: [...] > Final goal would be have BPF selftests compiled and test against our own > kernel, without having to come up with a specific kernel flavor that is > used to build and run the selftest. For v5.14 and v5.19-based kernel it > works: compilation is successful and I was able to run the verifier > tests. (Did not try running the other tests though) You mean ./test_verifier binary, right? A lot of tests had been moved from ./test_verifier to ./test_progs since. > > As far as I understand, selftests are supposed to be built and run > > using specific configuration, here is how config for x86 CI is prepared: > > > > ./scripts/kconfig/merge_config.sh \ > > ./tools/testing/selftests/bpf/config \ > > ./tools/testing/selftests/bpf/config.vm \ > > ./tools/testing/selftests/bpf/config.x86_64 > > > > (root is kernel source). > > I'm not sure if other configurations are supposed to be supported. > > Would it make sense to have makefile target that builds/runs a smaller > subset of general, config-agnostic selftests that tests the core feature > (e.g. verifier + instruction set)? In ideal world I'd say that ./test_progs should include/exclude tests conditioned on current configuration, but I don't know how much work would it be to adapt build system for this.