selftests: sched_ext: Add sched_ext as proper selftest target
authorBjörn Töpel <bjorn@rivosinc.com>
Tue, 8 Oct 2024 15:35:18 +0000 (17:35 +0200)
committerTejun Heo <tj@kernel.org>
Wed, 9 Oct 2024 16:42:51 +0000 (06:42 -1000)
commit7941b83bceb374c7e81061e0ebb45cd45f3e3517
treef12c9e57f8a5c6463843ffdf7c7a672613b4d0b9
parente0ed52154e866a1e9e9b97ded50b164698f0a222
selftests: sched_ext: Add sched_ext as proper selftest target

The sched_ext selftests is missing proper cross-compilation support, a
proper target entry, and out-of-tree build support.

When building the kselftest suite, e.g.:

  make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu-  \
    TARGETS=sched_ext SKIP_TARGETS="" O=/output/foo \
    -C tools/testing/selftests install

or:

  make ARCH=arm64 LLVM=1 TARGETS=sched_ext SKIP_TARGETS="" \
    O=/output/foo -C tools/testing/selftests install

The expectation is that the sched_ext is included, cross-built, the
correct toolchain is picked up, and placed into /output/foo.

In contrast to the BPF selftests, the sched_ext suite does not use
bpftool at test run-time, so it is sufficient to build bpftool for the
build host only.

Add ARCH, CROSS_COMPILE, OUTPUT, and TARGETS support to the sched_ext
selftest. Also, remove some variables that were unused by the
Makefile.

Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Acked-by: David Vernet <void@manifault.com>
Tested-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/testing/selftests/Makefile
tools/testing/selftests/sched_ext/Makefile