selftests: Fix Makefile to run targets even the ones in SKIP_TARGETS
PATCH 1/1 selftests: Fix Makefile to run targets even the ones in SKIP_TARGETS
With the current Makefile, if the user tries something like
make TARGETS="bpf mm"
only mm is run and bpf is skipped, which is not intentional.
bpf and sched_ext are always filtered out even when TARGETS is set explicitly due to how SKIP_TARGETS is implemented.
This default skip exists because these tests require newer LLVM/Clang versions that may not be available on all systems.
Fix the SKIP_TARGETS logic so that bpf and sched_ext remain skipped when TARGETS is taken from the Makefile but are included when the user specifies them explicitly.
---
make --silent summary=1 TARGETS="bpf size" kselftest
make[3]: Entering directory '/home/user/kernel-dev/linux-next/tools/testing/selftests/bpf'
Auto-detecting system features:
... llvm: [ OFF ]
Makefile:127: tools/build/Makefile.feature: No such file or directory
make[4]: *** No rule to make target 'tools/build/Makefile.feature'. Stop.
make[3]: *** [Makefile:344: /home/user/kernel-dev/linux-next/tools/testing/selftests/bpf/tools/sbin/bpftool] Error 2 make[3]: Leaving directory '/home/user/kernel-dev/linux-next/tools/testing/selftests/bpf' make[3]: Nothing to be done for 'all'.
make[3]: Entering directory '/home/user/kernel-dev/linux-next/tools/testing/selftests/bpf'
Auto-detecting system features:
... llvm: [ OFF ]
Makefile:127: tools/build/Makefile.feature: No such file or directory
make[4]: *** No rule to make target 'tools/build/Makefile.feature'. Stop.
make[3]: *** [Makefile:344: /home/user/kernel-dev/linux-next/tools/testing/selftests/bpf/tools/sbin/bpftool] Error 2 make[3]: Leaving directory '/home/user/kernel-dev/linux-next/tools/testing/selftests/bpf'
TAP version 13
1..1
# selftests: size: get_size
ok 1 selftests: size: get_size
make --silent summary=1 kselftest (bpf is between arm64 and breakpoints in TARGETS)
make[3]: Nothing to be done for 'all'.
make[3]: Entering directory '/home/user/kernel-dev/linux-next/tools/testing/selftests/alsa' make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/user/kernel-dev/linux-next/tools/testing/selftests/alsa' make[3]: Entering directory '/home/user/kernel-dev/linux-next/tools/testing/selftests/amd-pstate' make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/user/kernel-dev/linux-next/tools/testing/selftests/amd-pstate' make[3]: Entering directory '/home/user/kernel-dev/linux-next/tools/testing/selftests/arm64' make[3]: Leaving directory '/home/user/kernel-dev/linux-next/tools/testing/selftests/arm64' make[3]: Entering directory '/home/user/kernel-dev/linux-next/tools/testing/selftests/breakpoints' make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/user/kernel-dev/linux-next/tools/testing/selftests/breakpoints' make[3]: Nothing to be done for 'all'.
tools/testing/selftests/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
tools/testing/selftests/Makefile +4 -1
@@ -145,7 +145,10 @@ endif # 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 +ifeq ($(origin TARGETS), file) + SKIP_TARGETS ?= bpf sched_ext +endif + ifneq ($(SKIP_TARGETS),) TMP := $(filter-out $(SKIP_TARGETS), $(TARGETS)) override TARGETS := $(TMP)
Signature · 1 line
2.47.3
Quoted 9 lines · I Viswanath
Signed-off-by I Viswanath <[email protected]>---
make --silent summary=1 TARGETS="bpf size" kselftestmake[3]: Entering directory '
/home/user/kernel-dev/linux-next/tools/testing/selftests/bpf'Auto-detecting system features:
... llvm: [ OFF ]
Hi Viswaneth,
After the "---" usually the change log is placed. The change log contains the changes from version 1. Also if this is a version 2 patch, it is best to note it in the subject line. The v2 helps people keep up with which patch is the most recent.
Thanks,
David Hunter