Skip to contentSkip to conversation

selftests: sched_ext: Add sched_ext as proper selftest target

PATCH Applied Björn Töpel 5 participants 5 messages Oct 8, 2024 – Oct 9, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 selftests: sched_ext: Add sched_ext as proper selftest target

From: Björn Töpel <[email protected]>

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.

---
v3: * Always build a build host version of bpftool (Mark)
* Make sure LLVM style "ARCH only" cross-build works (Mark)

v2: * Removed the duplicated LLVM prefix parsing (David)
* Made sure make clean didn't do a complete mess (David)
* Added sched_ext to default skip (Shuah)

---
 tools/testing/selftests/Makefile           |  9 +--
 tools/testing/selftests/sched_ext/Makefile | 73 ++++++++++------------
 2 files changed, 38 insertions(+), 44 deletions(-)
tools/testing/selftests/Makefile +5 -4
index b38199965f99..363d031a16f7 100644
@@ -88,6 +88,7 @@ TARGETS += rlimits
 TARGETS += rseq
 TARGETS += rtc
 TARGETS += rust
+TARGETS += sched_ext
 TARGETS += seccomp
 TARGETS += sgx
 TARGETS += sigaltstack
@@ -129,10 +130,10 @@ ifeq ($(filter net/lib,$(TARGETS)),)
 endif
 endif
 
-# User can optionally provide a TARGETS skiplist.  By default we skip
-# BPF since it has cutting edge build time dependencies which require
-# more effort to install.
-SKIP_TARGETS ?= bpf
+# User can optionally provide a TARGETS skiplist. By default we skip
+# targets using BPF since it has cutting edge build time dependencies
+# which require more effort to install.
+SKIP_TARGETS ?= bpf sched_ext
 ifneq ($(SKIP_TARGETS),)
 	TMP := $(filter-out $(SKIP_TARGETS), $(TARGETS))
 	override TARGETS := $(TMP)
tools/testing/selftests/sched_ext/Makefile +33 -40

147 lines not on this page · raw message

base-commit: 87d6aab2389e5ce0197d8257d5f8ee965a67c4cd

Signature · 1 line
2.43.0
maintainer Reviewed-by on v3 1/1
#1 lore raw
Quoted 19 lines · Björn Töpel

From: Björn Töpel <[email protected]>

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.

Quoted 7 lines

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.

Thank you for adding this to change log.
Maybe we need to add this to kselftest.rst at some point.

Quoted 9 lines

---
v3: * Always build a build host version of bpftool (Mark)
* Make sure LLVM style "ARCH only" cross-build works (Mark)

v2: * Removed the duplicated LLVM prefix parsing (David)
* Made sure make clean didn't do a complete mess (David)
* Added sched_ext to default skip (Shuah)

Thank you.

thanks,
-- Shuah

reviewer Acked-by on v3 1/1
#2 lore raw
In reply to Björn Töpel
Quoted 23 lines · Björn Töpel

From: Björn Töpel <[email protected]>

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.

Quoted 5 lines

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

Thanks for the improvements!

Tested-by Reviewed-by on v3 1/1
#3 lore raw
In reply to Björn Töpel
Quoted 2 lines · Björn Töpel

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

There's still the thing with picking up the host kernel if there's not a binary built, but that's a generic thing with all the BPF based stuff that should be addressed separately.

reviewer Applied
#4 lore raw
In reply to Björn Töpel
Quoted 23 lines · Björn Töpel

From: Björn Töpel <[email protected]>

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.

Quoted 5 lines

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

Applied to sched_ext/for-6.12-fixes.

Thanks.

Signature · 1 line
tejun