From nobody Thu Oct 15 03:30:20 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57E523B841B; Wed, 14 Oct 2026 20:01:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792008081; cv=none; b=SPoY4DMCou5V+ajq/tXvuaYGQGlXBskdy4n8wE5X7aaNJYwstNo1CSSKk+ECNAy69dkHsEzh0T0+QGmF21aWL3qp+TZZk++56wFemi2Fuxerz31abx5b3B6j75pP+oy3GDNS9owhBsNf9O76/5LNrgc/Fso3ivFcxDt7S5OE7+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792008081; c=relaxed/simple; bh=Br3i4PjZrw4EnEhv4YobGgIzVp24lxyAJqkBUQrmBWU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T0k03Hiut7SIio4h8yavKmc15rQHqqGnZu82km4c36zE2XkLfqTLmoGiJClmH5ZFbZbxT03wAgwwZ/JdBzZjybgQU3gfb6WG3nggqhAmyBWYYNyr1Cy7hkUkOJ5ggsAAZWNkDlP8+yFpGmFBC/sgjetGFFXkQKLRS1Qa9evsoGE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=G7XLT8hz; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="G7XLT8hz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F0E41F000C4; Wed, 14 Oct 2026 20:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792008079; bh=qLnh4Hy34iBlkE6qCYvkyeWqQCS3LTCQKonxGWsxSMc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=G7XLT8hze7D88bdDdOuG/X/bRFXetpPRrkCgCsKaplCwVCbQEv/kTvHRvEksYMZsy uU0wDv308gByGvuAdPFZoxBQc57Dl814ruFHHcDsyvsPsRho7A7o81E0sx6in0wsOl PzBc2aXIn2y2UtIRgpepPWGFke08EHEwOwyMqIOPlso4xBGcwvkUhLv+I/7CZPwuW4 Dh64LNv/vGsVJMS21RalvxRCHlQEYG/8/wlIJghMxSK8db69VhJMVSPx7VOuszDglf B7tVdB+JhZ7Gfg9PCrrhwqZqO4MB/3V1bPz+CA5HQontpbKH2cX0E30RM7QHLbrC43 qNxSTJ+enbOtw== From: Sasha Levin To: Shuah Khan Cc: Sasha Levin , Mark Brown , =?UTF-8?q?Ricardo=20B=2E=20Marli=C3=A8re?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/7] selftests: keep the build status from wrapping to success Date: Wed, 14 Oct 2026 16:01:09 -0400 Message-ID: <20261014200115.1363363-2-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261014200115.1363363-1-sashal@kernel.org> References: <20261014200115.1363363-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The top-level all and install rules return failure only when every selected target fails, which commit cad6f32665cb ("selftests: Deescalate error reporting") deliberately kept as the default. They implement this by multiplying the exit statuses of the targets: ret=3D$$((ret * $$?)) A failing recursive make exits with status 2, so eight failing targets produce 256, and "exit 256" reports success. Building eight or more targets that all fail therefore succeeds, and install goes on to package an empty installation. Record a successful target instead of multiplying statuses. The rules still fail only when no target succeeds, and FORCE_TARGETS still stops at the first failure. Fixes: 5f70bde26a48 ("selftests: fix build behaviour on targets' failures") Signed-off-by: Sasha Levin --- tools/testing/selftests/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Mak= efile index 04cf073114318..a442b239f0610 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -236,7 +236,7 @@ all: $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$TARGET \ O=3D$(abs_objtree) \ $(if $(FORCE_TARGETS),|| exit); \ - ret=3D$$((ret * $$?)); \ + [ $$? -eq 0 ] && ret=3D0; \ done; exit $$ret; =20 run_tests: all @@ -303,7 +303,7 @@ ifdef INSTALL_PATH OBJ_PATH=3D$(INSTALL_PATH) \ O=3D$(abs_objtree) \ $(if $(FORCE_TARGETS),|| exit); \ - ret=3D$$((ret * $$?)); \ + [ $$? -eq 0 ] && ret=3D0; \ done; exit $$ret; =20 =20 --=20 2.53.0 From nobody Thu Oct 15 03:30:20 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 446BA385D75; Wed, 14 Oct 2026 20:01:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792008082; cv=none; b=ZXXQjp+dEx6v/pTEY9XMO79Cs2o7sLh3a5S9l3TXI4MMwLPw3suZZ95pZNH20iRJ97uM9fLoO+7oIPu6glc3oxwPtqPYSD06onSWwyBhGxxvHInMn1KMTGegTK7q9jjsO+7VBku7tut03vNbcxIAAcfyktitKgTzb84fPOjj9aE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792008082; c=relaxed/simple; bh=F8Io4wrMH5qEwkinlAkgOpNnMfKvLhnA2ldp5UPWSLY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LnwJ3nlHmy0EMgBYTo7et8RouqWEDhlyzHCtmTeJjFPjkaAcPer0yWyu/W3YeAGflE6zA1rP7eTf/JzmNZnJasaw1yXM2682CyNtc1YhtQpIMjVimjmwrrDvW9X0CGRLL9FaUwx/tpdtVB1qjA3DFnHvOTSh5mxy0rHjVjkYR6Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=e+phRhfh; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="e+phRhfh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 272E21F000C8; Wed, 14 Oct 2026 20:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792008081; bh=OR6QIYgjzi9W5ngPDakiyBdLmzWuTESeAzlQDSQm0Cg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=e+phRhfhb/yS+gwzYmM0yTvHZdmnWASACHQZAygWO84S3W0fZXEgMaKSRtF6sTZ39 fU0y3xIYr44gksklZbjSrdU3zwJvFzCM+xoG/6gYGoYnvqagq5df15cC8ug1vXfH5Q AnIC81aXq1AMn/lS2q4bAg8XKNROJnN66wJhBMbcEHe2nLftI6zUkLNEGAd7koo9jo Cpt1aBlJhO4jFIM9tom/RTSOm2qBXbBAQtDvuaR7MlaW7I8FZpatnzHiLq83T6XVQR R2HSzWoaz3JbS820B0Xw+MAj5yCfIAqZEanuyjWslnPJfMt+Nmp19O6zluGCi6m08/ 2WTWoAgDq0RNQ== From: Sasha Levin To: Shuah Khan Cc: Sasha Levin , Jonathan Corbet , linux-doc@vger.kernel.org, Mark Brown , =?UTF-8?q?Ricardo=20B=2E=20Marli=C3=A8re?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/7] selftests: optionally record per-suite build and install results Date: Wed, 14 Oct 2026 16:01:10 -0400 Message-ID: <20261014200115.1363363-3-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261014200115.1363363-1-sashal@kernel.org> References: <20261014200115.1363363-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" By default the selftests build and installation succeed as long as one target succeeds, so that a single broken suite does not cost CI systems the coverage of all others; commit cad6f32665cb ("selftests: Deescalate error reporting") restored that policy after it had been tightened. The exit status of make therefore cannot tell which suites failed, and inspecting the installation is not reliable either: a suite whose compilation failed can still install its scripts. Add an opt-in report. When KSFT_BUILD_REPORT names an absolute file, the all and install rules append one tab-separated record per target with the phase, the target name and the exit status of its recursive make. Generating the runlist is recorded as part of the install phase. The records are written without changing which targets are built or installed or the exit status of make, also with FORCE_TARGETS. Nothing is recorded by make -n, -t or -q, including when the selftests are built through the kernel's kselftest targets, which clear MAKEFLAGS. The recording helper lives in a small fragment so that suites built from subdirectories can add records for them, and the variable is exported to sub-makes. A relative path is rejected, since every recursive make runs in a different directory. Keep the exit status of the runlist generation loop as before, and create an empty runlist for installations in which no target emits tests. Document the format, version 1, and how to read it. Link: https://lore.kernel.org/r/20260416-selftests-deescalate-error-reporti= ng-v1-1-38e7c0536227@kernel.org Signed-off-by: Sasha Levin --- Documentation/dev-tools/kselftest.rst | 38 +++++++++++++++++++++++++ tools/testing/selftests/Makefile | 31 ++++++++++++++------ tools/testing/selftests/build_report.mk | 26 +++++++++++++++++ 3 files changed, 87 insertions(+), 8 deletions(-) create mode 100644 tools/testing/selftests/build_report.mk diff --git a/Documentation/dev-tools/kselftest.rst b/Documentation/dev-tool= s/kselftest.rst index fc4dc1f9dc931..0772525cbc627 100644 --- a/Documentation/dev-tools/kselftest.rst +++ b/Documentation/dev-tools/kselftest.rst @@ -133,6 +133,44 @@ build successfully; make will abort as soon as any tar= get fails:: This applies to both the ``all`` and ``install`` targets and is useful in CI environments where a silent partial build would be misleading. =20 +Recording suite build results +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D + +Since the build succeeds as long as one target builds, the exit status of +make does not show which targets failed. Set ``KSFT_BUILD_REPORT`` to the +absolute path of a file to have the ``all`` and ``install`` targets append +a tab-separated record for each target they process:: + + $ : > /tmp/ksft-build.tsv + $ make -C tools/testing/selftests O=3D/tmp/kernel-build \ + KSFT_BUILD_REPORT=3D/tmp/ksft-build.tsv install + +Each record holds the phase (``all`` or ``install``), a name and the exit +status of that step. Recording does not change which targets are built or +installed, or the exit status of make, also with ``FORCE_TARGETS=3D1``. The +caller creates or truncates the report before a build; the rules only +append to it. Nothing is recorded by ``make -n``, ``-t`` or ``-q``. + +The same name can appear several times: ``install`` builds the targets +again, and generating ``kselftest-list.txt`` is recorded as part of the +``install`` phase. Targets that are added automatically as installation +dependencies of other targets, such as ``net/lib``, are recorded too. +Suites that are built from several subdirectories may also record each +subdirectory under its path, for example ``arm64/tags``; a failure there +means that the suite was built or installed only partially. A record +belongs to the target with the longest name that is equal to the record +name or followed by ``/`` in it. + +A target was built and installed successfully only if all of its records +have a zero status. Missing records do not show that a target was built. +A successful target that installs no tests has no entries in +``kselftest-list.txt``. Install the kernel headers with ``make headers`` +before building: a suite that fails because the headers are missing is +recorded as failed even if a later step installs them. + +``KSFT_BUILD_REPORT_VERSION`` in tools/testing/selftests/Makefile gives the +version of this format, currently ``1``. + Running the full range hotplug selftests =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Mak= efile index a442b239f0610..abbb854886cfb 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -180,6 +180,10 @@ endif # of the targets gets built. FORCE_TARGETS ?=3D =20 +# Remember dry runs for the build report before MAKEFLAGS may be cleared. +KSFT_BUILD_REPORT_DRY_RUN :=3D $(strip $(foreach f,n t q,$(findstring $(f)= ,$(firstword -$(MAKEFLAGS))))) +export KSFT_BUILD_REPORT_DRY_RUN + # Clear LDFLAGS and MAKEFLAGS when implicit rules are missing. This provi= des # implicit rules to sub-test Makefiles which avoids build failures in test # Makefile that don't have explicit build rules. @@ -224,6 +228,10 @@ ARCH ?=3D $(SUBARCH) export BUILD export KHDR_INCLUDES =20 +# Version of the optional KSFT_BUILD_REPORT format written by these rules. +KSFT_BUILD_REPORT_VERSION :=3D 1 +include $(top_srcdir)/tools/testing/selftests/build_report.mk + # set default goal to all, so make without a target runs all, even when # all isn't the first target in the file. .DEFAULT_GOAL :=3D all @@ -232,11 +240,13 @@ all: @ret=3D1; \ for TARGET in $(TARGETS) $(INSTALL_DEP_TARGETS); do \ BUILD_TARGET=3D$$BUILD/$$TARGET; \ - mkdir $$BUILD_TARGET -p; \ + mkdir -p $$BUILD_TARGET && \ $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$TARGET \ - O=3D$(abs_objtree) \ - $(if $(FORCE_TARGETS),|| exit); \ - [ $$? -eq 0 ] && ret=3D0; \ + O=3D$(abs_objtree); \ + status=3D$$?; \ + $(call ksft_record_build_status,all,$$TARGET); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ done; exit $$ret; =20 run_tests: all @@ -293,7 +303,7 @@ ifdef INSTALL_PATH install -m 744 kselftest/ktap_helpers.sh $(INSTALL_PATH)/kselftest/ install -m 744 kselftest/ksft.py $(INSTALL_PATH)/kselftest/ install -m 744 run_kselftest.sh $(INSTALL_PATH)/ - rm -f $(TEST_LIST) + : > $(TEST_LIST) @ret=3D1; \ for TARGET in $(TARGETS) $(INSTALL_DEP_TARGETS); do \ BUILD_TARGET=3D$$BUILD/$$TARGET; \ @@ -301,9 +311,11 @@ ifdef INSTALL_PATH INSTALL_PATH=3D$(INSTALL_PATH)/$$TARGET \ SRC_PATH=3D$(shell readlink -e $$(pwd)) \ OBJ_PATH=3D$(INSTALL_PATH) \ - O=3D$(abs_objtree) \ - $(if $(FORCE_TARGETS),|| exit); \ - [ $$? -eq 0 ] && ret=3D0; \ + O=3D$(abs_objtree); \ + status=3D$$?; \ + $(call ksft_record_build_status,install,$$TARGET); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ done; exit $$ret; =20 =20 @@ -317,6 +329,9 @@ ifdef INSTALL_PATH printf "Emit Tests for $$TARGET\n"; \ $(MAKE) -s --no-print-directory OUTPUT=3D$$BUILD_TARGET COLLECTION=3D$$T= ARGET \ -C $$TARGET emit_tests >> $(TEST_LIST); \ + status=3D$$?; \ + $(call ksft_record_build_status,install,$$TARGET); \ + (exit $$status); \ done; @VERSION=3D$$(git describe HEAD 2>/dev/null); \ if [ -n "$$VERSION" ]; then \ diff --git a/tools/testing/selftests/build_report.mk b/tools/testing/selfte= sts/build_report.mk new file mode 100644 index 0000000000000..047c239925e16 --- /dev/null +++ b/tools/testing/selftests/build_report.mk @@ -0,0 +1,26 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Optional per-suite build report, see "Recording suite build results" in +# Documentation/dev-tools/kselftest.rst. Callers set KSFT_BUILD_REPORT to = an +# absolute filename and use ksft_record_build_status from a shell loop that +# has stored the exit status of the recorded step in $status. + +ifneq (x$(KSFT_BUILD_REPORT)x,xx) +ifeq ($(filter x/%,$(firstword x$(KSFT_BUILD_REPORT))),) +$(error KSFT_BUILD_REPORT must be an absolute path: '$(KSFT_BUILD_REPORT)') +endif +endif +export KSFT_BUILD_REPORT + +ksft_build_report_dry_run :=3D $(KSFT_BUILD_REPORT_DRY_RUN) \ + $(foreach f,n t q,$(findstring $(f),$(firstword -$(MAKEFLAGS)))) + +ifneq ($(strip $(ksft_build_report_dry_run)),) +ksft_record_build_status =3D : +else +define ksft_record_build_status +if [ -n "$$KSFT_BUILD_REPORT" ]; then \ + printf '%s\t%s\t%d\n' '$(1)' "$(2)" "$$status" >> "$$KSFT_BUILD_REPORT" |= | exit 1; \ +fi +endef +endif --=20 2.53.0 From nobody Thu Oct 15 03:30:20 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83FBD38F230; Wed, 14 Oct 2026 20:01:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792008090; cv=none; b=cW7giGMrR18J9Xhj97zPu4xpdl50i2NVWiM4wQEfgk0NgeuWE3oKJskML8YNa29hFdgeQ36PQLCRMEsdRWghuMBF2Rr/407ZsdX7sGGyo+sTW13EOFQr4ywXv0/I/H5TqZM8h3lUemxNfZqY8teydLjSnZpYVOiYEU32C4fx5HM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792008090; c=relaxed/simple; bh=3qD11HPFDagKzU1nuRAB1h462Tj/nX0V511tu8vCtRE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mhqnV+B25yg4BMAd85piGc7ueWc27wOZXl0MHwMX78h9hzoNWCVcHc3dnm4zRgeE9p0GkyV/FFmGZi/0tPXVWfAUtVERu0xmFoWxUELsZomNhJ/4V2ET1vdf/Ce2YYYrb/KVZAF7iGk0nxNtBZYkPS0j4uCgkdFM8ZxUArk14wM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QGJi8nD0; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QGJi8nD0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C60C1F000C5; Wed, 14 Oct 2026 20:01:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792008082; bh=mRexem4KV6KHScvbzz77XFjOE74k7LslCRLFHgVfnyc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QGJi8nD0vPoSQK0Trc2JLAFR6KIfisA6bKNAFgQdjKbhPdng/sPYcn1mfNZn4Lx4Q onBNeMJVT/Q00j278e+4Jkd5CJAzyUAKNelpUTS4XPylK8wsvCME3p9QHDSZg89n0T sX0FXeDlfCwSkLMvi+U7MIeAwuHaFyFWTwJdcaG0ADZQBAx1iyqjxfpuehQUaN8vrC 0b+XjluOw0cU4/h4efjrmm1N7v8mAG9ZvgWAdY1/OK8HtaQaqkwymhkM/PV0wUYDh+ A0pj1lcjeZt7UPrfROdHFuY6S/qwj7G76wdxyjJKvN/1heJEJs8XVJ3Eqc7zRKaPt5 3qWidvsJMpFuA== From: Sasha Levin To: Shuah Khan Cc: Sasha Levin , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , =?UTF-8?q?Andr=C3=A9=20Almeida?= , Mark Brown , =?UTF-8?q?Ricardo=20B=2E=20Marli=C3=A8re?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/7] selftests/futex: report failures of the functional subdirectory Date: Wed, 14 Oct 2026 16:01:11 -0400 Message-ID: <20261014200115.1363363-4-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261014200115.1363363-1-sashal@kernel.org> References: <20261014200115.1363363-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The futex suite builds its tests in the functional subdirectory and then copies run.sh into the output directory. The copy is the last command of the loop, so its status replaces that of the build, and "make all" succeeds even when the functional tests fail to compile. Fold the copy into the status of the subdirectory, count a failure to create the output directory as well, and let the build and installation loops return failure when no subdirectory succeeds, which matches how the top-level selftests Makefile treats its targets, or as soon as one fails when FORCE_TARGETS is set. When a build report is requested, record each subdirectory as futex/ so that a failure is visible even when make itself succeeds. Fixes: 9c3340ea7f5d ("selftests: futex: copy sub-dir test scripts for make = O=3Ddir run") Fixes: 9705315b7562 ("selftests/futex: Update Makefile to use lib.mk") Signed-off-by: Sasha Levin --- tools/testing/selftests/futex/Makefile | 32 +++++++++++++++++--------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/futex/Makefile b/tools/testing/selftes= ts/futex/Makefile index 78ab2cd111f60..d6923775b8d49 100644 --- a/tools/testing/selftests/futex/Makefile +++ b/tools/testing/selftests/futex/Makefile @@ -4,26 +4,36 @@ SUBDIRS :=3D functional TEST_PROGS :=3D run.sh =20 include ../lib.mk +include $(selfdir)/build_report.mk =20 all: - @for DIR in $(SUBDIRS); do \ - BUILD_TARGET=3D$(OUTPUT)/$$DIR; \ - mkdir $$BUILD_TARGET -p; \ - $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$DIR $@;\ - if [ -e $$DIR/$(TEST_PROGS) ]; then \ - rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/; \ - fi \ - done + @ret=3D$(if $(SUBDIRS),1,0); for DIR in $(SUBDIRS); do \ + BUILD_TARGET=3D$(OUTPUT)/$$DIR; \ + mkdir -p $$BUILD_TARGET && \ + $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ + status=3D$$?; \ + if [ -e $$DIR/$(TEST_PROGS) ]; then \ + rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/ || \ + [ $$status -ne 0 ] || status=3D1; \ + fi; \ + $(call ksft_record_build_status,all,futex/$$DIR); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ + done; exit $$ret =20 override define INSTALL_RULE mkdir -p $(INSTALL_PATH) install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FI= LES) =20 - @for SUBDIR in $(SUBDIRS); do \ + @ret=3D$(if $(SUBDIRS),1,0); for SUBDIR in $(SUBDIRS); do \ BUILD_TARGET=3D$(OUTPUT)/$$SUBDIR; \ - mkdir $$BUILD_TARGET -p; \ + mkdir -p $$BUILD_TARGET && \ $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=3D$(INSTALL_PAT= H)/$$SUBDIR install; \ - done; + status=3D$$?; \ + $(call ksft_record_build_status,install,futex/$$SUBDIR); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ + done; exit $$ret endef =20 override define CLEAN --=20 2.53.0 From nobody Thu Oct 15 03:30:20 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B154A418368; Wed, 14 Oct 2026 20:01:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792008086; cv=none; b=D4qexKjShdethqyYB6z9ORbAobsNQruhErhTMz67GvxOF5NjFDxLJUZi3zuiS+5TrbmOteF8n549EioZ29zkPIh32YBcAmb4DWPCtqF0AKkktkiExu4U/6yOxrXM0RV3n7/MJJDrtBKCRD4T1aVBgC/Rre72jlKV0vrpB4mfolw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792008086; c=relaxed/simple; bh=FfJa+D/XDk1R4OQzRAosPwG7PGjn6eHL6MAjz87AzZ0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r7eFzObnlLhDqt2hxwPsd/PhsEiRE0c3wFbXXc5Np+CY/5+KUp8lR0Jsmx8RVyhkXyTKgXCxmQPInNJeXzocHnhNlnHcULIj11UmH/EzKTqiIvGGXTp166vTQBPsLpuZ6lB8mrJsW7mgEvGMmqId2EskS8FgQwtJ1E9OR8n4UwY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=U6jHo78e; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="U6jHo78e" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB6511F000C9; Wed, 14 Oct 2026 20:01:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792008083; bh=rA58PSq59ct6hyQRhMEzlraWcFyA2/zxWUU6GgU+788=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=U6jHo78e72z2xYPYD5ffo2o4IhU2p9EYuHvk1szfldPP2qD5DbpzmUx77WUQYLT/x tHTEOgNDtKxDXMooe4WsZ1VxS/H7OpVDqsX3NmUts14zSNB+syl3VTjH4WexpLYGTk uWDkvCsyBSRWTuqcJupKDP236eN9O0IwqLakRjSY6evQZoNAytL80ugjyrKPmZn85w kHsrmB6VBuALEuyQFIKXmyKCZuHpsHfOpkARVtDrm9qe4+syOmXKVQy+VNk5tT8XsN zVIqi5TmF9H0giqEB3Pn70IijK5lXLVHSvThJfosysipf3VcfgZic6YcGmtw2WMWRn UxKg67QWUcDZw== From: Sasha Levin To: Shuah Khan Cc: Sasha Levin , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, Mark Brown , =?UTF-8?q?Ricardo=20B=2E=20Marli=C3=A8re?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/7] kselftest/arm64: keep building and installing after a subdirectory fails Date: Wed, 14 Oct 2026 16:01:12 -0400 Message-ID: <20261014200115.1363363-5-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261014200115.1363363-1-sashal@kernel.org> References: <20261014200115.1363363-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The arm64 suite builds and installs its subdirectories in shell loops whose status is that of the last subdirectory. A failure in an earlier subdirectory is therefore lost unless FORCE_TARGETS is set, while a failure in the last one fails "make all" and, through "install: all", drops the installation of every other arm64 test as well. Make each loop fail only when no subdirectory succeeds, which matches how the top-level selftests Makefile treats its targets, and keep stopping at the first failure when FORCE_TARGETS is set. When a build report is requested, record each subdirectory as arm64/ so that a partially built suite is visible even though make succeeds. Invoke the subdirectories with $(MAKE) rather than make. The command line variables already reach them through MAKEFLAGS either way, but $(MAKE) lets them use the parent's jobserver and makes -n, -t and -q apply to them. Fixes: 313a4db7f338 ("kselftest: arm64: extend toplevel skeleton Makefile") Signed-off-by: Sasha Levin --- tools/testing/selftests/arm64/Makefile | 43 +++++++++++++++++--------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/tools/testing/selftests/arm64/Makefile b/tools/testing/selftes= ts/arm64/Makefile index e456f3b62fa13..c787e848d4718 100644 --- a/tools/testing/selftests/arm64/Makefile +++ b/tools/testing/selftests/arm64/Makefile @@ -26,38 +26,53 @@ OUTPUT ?=3D $(CURDIR) export CFLAGS export top_srcdir =20 +include $(top_srcdir)/tools/testing/selftests/build_report.mk + all: - @for DIR in $(ARM64_SUBTARGETS); do \ + @ret=3D$(if $(ARM64_SUBTARGETS),1,0); \ + for DIR in $(ARM64_SUBTARGETS); do \ BUILD_TARGET=3D$(OUTPUT)/$$DIR; \ - mkdir -p $$BUILD_TARGET; \ - make OUTPUT=3D$$BUILD_TARGET -C $$DIR $@ \ - $(if $(FORCE_TARGETS),|| exit); \ - done + mkdir -p $$BUILD_TARGET && \ + $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ + status=3D$$?; \ + $(call ksft_record_build_status,all,arm64/$$DIR); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ + done; exit $$ret =20 install: all - @for DIR in $(ARM64_SUBTARGETS); do \ + @ret=3D$(if $(ARM64_SUBTARGETS),1,0); \ + for DIR in $(ARM64_SUBTARGETS); do \ BUILD_TARGET=3D$(OUTPUT)/$$DIR; \ - make OUTPUT=3D$$BUILD_TARGET -C $$DIR $@ \ - $(if $(FORCE_TARGETS),|| exit); \ - done + $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ + status=3D$$?; \ + $(call ksft_record_build_status,install,arm64/$$DIR); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ + done; exit $$ret =20 run_tests: all @for DIR in $(ARM64_SUBTARGETS); do \ BUILD_TARGET=3D$(OUTPUT)/$$DIR; \ - make OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ + $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ done =20 # Avoid any output on non arm64 on emit_tests emit_tests: - @for DIR in $(ARM64_SUBTARGETS); do \ + @ret=3D$(if $(ARM64_SUBTARGETS),1,0); \ + for DIR in $(ARM64_SUBTARGETS); do \ BUILD_TARGET=3D$(OUTPUT)/$$DIR; \ - make OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ - done + $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ + status=3D$$?; \ + $(call ksft_record_build_status,install,arm64/$$DIR); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ + done; exit $$ret =20 clean: @for DIR in $(ARM64_SUBTARGETS); do \ BUILD_TARGET=3D$(OUTPUT)/$$DIR; \ - make OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ + $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ done =20 .PHONY: all clean install run_tests emit_tests --=20 2.53.0 From nobody Thu Oct 15 03:30:20 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B39E3D1713; Wed, 14 Oct 2026 20:01:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792008086; cv=none; b=HF9X9j9noeURXWuzLhlGcUqNRjQvUnI1k50FMmSVd2JW6efVYE2pZqBgEpOgL88VFI3VoLHpmtBOLDbhZT33zO1SfNiQSpMXbkq+cdrL+YhKe+D1fzYPScgt85/502ZCCvhFdtB1ZMhGxWoXv6nXg9Vi9ClCSQTgcrAwkfqqz5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792008086; c=relaxed/simple; bh=BS6H1M3oTphls87vDbJhnd9QtrKEVx3/XuigcvFPVpw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fhs0/zggTglM1ANjzpWRLUwghS3WKrIKdF1JC/AUz4+PhwRLSmrwLY+LcC0QM79wQ/O8Yg0TE4uCMH9i/RrA7FzH0YpJmmJfisgE3H7ZSxtJEm7sipHdNtvLA8l8x9U9nSAhq6w7Uj4MKKWD4WJo6LTFuVjZagD3Naim9XYOtgI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PVjx+ehW; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PVjx+ehW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBACC1F000C4; Wed, 14 Oct 2026 20:01:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792008085; bh=cQ1kewUL52K9zpMDeh2ONUK6G+L48N3I/Lb6qZvfwLg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PVjx+ehWybamuJ4XnmVcra5Skw2WuFdP/it84zbL6FfZpOhMnPQtkGf41lQsU5Atq sdt20SlueVSNrpwjYIj+EYJ6/H44cdw97bb2Y5Hai9xyUlKdI9RePkFMB9nc0MLN8A oTgij/H838Zs9uB6Ged8wcj2Tv8NuHZUptrkI/jskH/IoF8YXPB2uFgGJMcZGN11tM pHqosn7dzbz9eG1eRDX/LaFha6VKG0wCNh1R/JH+boAKEfcGTQFcAVksppOy06l1Jq NhZ9WCvG2qY9TzJVBL8sE/3/7PMBFtVEi85kJMrX1+6TCNFMotiZIjygonDs2wzQy2 JzbwRjhsDgs9w== From: Sasha Levin To: Shuah Khan Cc: Sasha Levin , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , linux-riscv@lists.infradead.org, Mark Brown , =?UTF-8?q?Ricardo=20B=2E=20Marli=C3=A8re?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] selftests/riscv: keep building and installing after a subdirectory fails Date: Wed, 14 Oct 2026 16:01:13 -0400 Message-ID: <20261014200115.1363363-6-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261014200115.1363363-1-sashal@kernel.org> References: <20261014200115.1363363-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The RISC-V suite builds and installs its subdirectories in shell loops whose status is that of the last subdirectory. A failure in any other subdirectory is lost, while a failure in the last one fails "make all" and, through "install: all", drops the installation of every other RISC-V test as well. FORCE_TARGETS has no effect on the loops either. Make each loop fail only when no subdirectory succeeds, which matches how the top-level selftests Makefile treats its targets, and stop at the first failure when FORCE_TARGETS is set. When a build report is requested, record each subdirectory as riscv/ so that a partially built suite is visible even though make succeeds. Default OUTPUT to the current directory, as the arm64 suite does, so that the loops also work when the suite is built directly. Fixes: 287dcc2b0c83 ("selftests: Test the new RISC-V hwprobe interface") Signed-off-by: Sasha Levin --- tools/testing/selftests/riscv/Makefile | 39 +++++++++++++++++++------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/riscv/Makefile b/tools/testing/selftes= ts/riscv/Makefile index 5671b4405a129..52d1228be8d03 100644 --- a/tools/testing/selftests/riscv/Makefile +++ b/tools/testing/selftests/riscv/Makefile @@ -20,21 +20,35 @@ CFLAGS +=3D -I$(top_srcdir)/tools/testing/selftests/ =20 CFLAGS +=3D $(KHDR_INCLUDES) =20 +OUTPUT ?=3D $(CURDIR) + export CFLAGS export top_srcdir =20 +include $(top_srcdir)/tools/testing/selftests/build_report.mk + all: - @for DIR in $(RISCV_SUBTARGETS); do \ + @ret=3D$(if $(RISCV_SUBTARGETS),1,0); \ + for DIR in $(RISCV_SUBTARGETS); do \ BUILD_TARGET=3D$(OUTPUT)/$$DIR; \ - mkdir -p $$BUILD_TARGET; \ - $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ - done + mkdir -p $$BUILD_TARGET && \ + $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ + status=3D$$?; \ + $(call ksft_record_build_status,all,riscv/$$DIR); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ + done; exit $$ret =20 install: all - @for DIR in $(RISCV_SUBTARGETS); do \ + @ret=3D$(if $(RISCV_SUBTARGETS),1,0); \ + for DIR in $(RISCV_SUBTARGETS); do \ BUILD_TARGET=3D$(OUTPUT)/$$DIR; \ - $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ - done + $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ + status=3D$$?; \ + $(call ksft_record_build_status,install,riscv/$$DIR); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ + done; exit $$ret =20 run_tests: all @for DIR in $(RISCV_SUBTARGETS); do \ @@ -44,10 +58,15 @@ run_tests: all =20 # Avoid any output on non riscv on emit_tests emit_tests: - @for DIR in $(RISCV_SUBTARGETS); do \ + @ret=3D$(if $(RISCV_SUBTARGETS),1,0); \ + for DIR in $(RISCV_SUBTARGETS); do \ BUILD_TARGET=3D$(OUTPUT)/$$DIR; \ - $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ - done + $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ + status=3D$$?; \ + $(call ksft_record_build_status,install,riscv/$$DIR); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ + done; exit $$ret =20 clean: @for DIR in $(RISCV_SUBTARGETS); do \ --=20 2.53.0 From nobody Thu Oct 15 03:30:20 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C5AC385D75; Wed, 14 Oct 2026 20:01:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792008091; cv=none; b=UtMiQ8TmPFlX24ISCTaVxuyyyCmrgHB7i6qD4kfkgMR1dfeOXssNIgElO0V3vgubgftUU7zk14vkE5ZJTZgzAyjmOw3p1QCNmDqnQqsFO2MmyDiA/J0jIQN/0JXlXl65dXSN+nLhWbIGnlSdSyB05yJL4sdIfzbDPYogPyEeUJI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792008091; c=relaxed/simple; bh=ArcZQi3GV5i2s5T+FwHYuBpIizUOuke7BUhtttXRNjQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IYywTpdh2xHKNOhF7lTUOn2B6mPzzyOg38R3VLdjLRdAcQ3Txh5K/0CdZ2//neqdreiJXTUTbLxikJJhL3BfyjXrwN+TyWlED3NLu6I6FbMY/BZsiI4w8Uues9+YodFEh0odo512V0G3FhW0Z5L+W0/TWsuyiLHJ03zgaIdgk40= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NncGK1Cq; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NncGK1Cq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 404A91F000C7; Wed, 14 Oct 2026 20:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792008086; bh=OJJRzw35bezfBVy0Bke8Qe4M2f3C2NI3f1X/6Jbh83U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NncGK1CqR0+mAIK9AVAUBCGrocJSygrgvpKE25CvKZxnWSjZC/+GYxV5d06a3Rt6I VkgOTkq6fvaiHKIuLluO1YjYatNJd19PXvV4m2GSsUvQlOql44eUiOri45wVhwwKS5 zDkPFq6/3hKto5o7WOyUFro1pNCX6viZUB+ntyB7CFg7QiWQXmzEVjCtdDncbt3tAR FCBXvuLvjs25+TYMj/OedLfctCx583E/3uaz6pSGlS4MPMshOv/RnmGOKM63NTNk1m eYHOEa9HyS+ng18WP2J5MrQhSARGRUc7LkqFNyvOvoFqn6I3iRzvJZtpwKD1CrsUSw VkSislgVtq3XQ== From: Sasha Levin To: Shuah Khan Cc: Sasha Levin , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , linuxppc-dev@lists.ozlabs.org, Mark Brown , =?UTF-8?q?Ricardo=20B=2E=20Marli=C3=A8re?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] selftests/powerpc: report the outcome of each subdirectory Date: Wed, 14 Oct 2026 16:01:14 -0400 Message-ID: <20261014200115.1363363-7-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261014200115.1363363-1-sashal@kernel.org> References: <20261014200115.1363363-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The powerpc suite and its pmu subdirectory install and list their tests in shell loops whose status is that of the last subdirectory, so a failure in any other subdirectory is lost and FORCE_TARGETS has no effect on them. Make the installation and runlist loops fail only when no subdirectory succeeds, which matches how the top-level selftests Makefile treats its targets, and stop at the first failure when FORCE_TARGETS is set. When a build report is requested, record each subdirectory as powerpc/ or powerpc/pmu/, including the builds of the subdirectories, so that a failure is visible even when make itself succeeds. The subdirectories are still built as prerequisites of "all", so a subdirectory that fails to build still fails the build of the suite as before; only the reporting of that failure is added. Fixes: 6faeeea44b84 ("selftests: Add install support for the powerpc tests") Fixes: 822a04957cc5 ("selftests/powerpc: Convert pmu Makefile to for loop s= tyle") Signed-off-by: Sasha Levin --- tools/testing/selftests/powerpc/Makefile | 20 +++++++++++++++----- tools/testing/selftests/powerpc/pmu/Makefile | 20 +++++++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selft= ests/powerpc/Makefile index b175e94e1901d..8349196c934d5 100644 --- a/tools/testing/selftests/powerpc/Makefile +++ b/tools/testing/selftests/powerpc/Makefile @@ -37,9 +37,11 @@ endif all: $(SUB_DIRS) =20 $(SUB_DIRS): - BUILD_TARGET=3D$(OUTPUT)/$@; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=3D$$= BUILD_TARGET -k -C $@ all + BUILD_TARGET=3D$(OUTPUT)/$@; mkdir -p $$BUILD_TARGET && $(MAKE) OUTPUT=3D= $$BUILD_TARGET -k -C $@ all; \ + status=3D$$?; $(call ksft_record_build_status,all,powerpc/$@); exit $$sta= tus =20 include ../lib.mk +include $(selfdir)/build_report.mk include ./flags.mk =20 override define RUN_TESTS @@ -50,17 +52,25 @@ override define RUN_TESTS endef =20 override define INSTALL_RULE - +@for TARGET in $(SUB_DIRS); do \ + +@ret=3D$(if $(SUB_DIRS),1,0); for TARGET in $(SUB_DIRS); do \ BUILD_TARGET=3D$(OUTPUT)/$$TARGET; \ $(MAKE) OUTPUT=3D$$BUILD_TARGET INSTALL_PATH=3D$$INSTALL_PATH/$$TARGET -= C $$TARGET install;\ - done; + status=3D$$?; \ + $(call ksft_record_build_status,install,powerpc/$$TARGET); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ + done; exit $$ret endef =20 emit_tests: - +@for TARGET in $(SUB_DIRS); do \ + +@ret=3D$(if $(SUB_DIRS),1,0); for TARGET in $(SUB_DIRS); do \ BUILD_TARGET=3D$(OUTPUT)/$$TARGET; \ $(MAKE) OUTPUT=3D$$BUILD_TARGET COLLECTION=3D$(COLLECTION)/$$TARGET -s -= C $$TARGET $@;\ - done; + status=3D$$?; \ + $(call ksft_record_build_status,install,powerpc/$$TARGET); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ + done; exit $$ret =20 override define CLEAN +@for TARGET in $(SUB_DIRS); do \ diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/s= elftests/powerpc/pmu/Makefile index 7e9dbf3d0d092..7b3ef1decbfbb 100644 --- a/tools/testing/selftests/powerpc/pmu/Makefile +++ b/tools/testing/selftests/powerpc/pmu/Makefile @@ -7,6 +7,7 @@ EXTRA_SOURCES :=3D ../harness.c event.c lib.c ../utils.c =20 top_srcdir =3D ../../../../.. include ../../lib.mk +include $(selfdir)/build_report.mk include ../flags.mk =20 SUB_DIRS :=3D ebb sampling_tests event_code_tests @@ -26,7 +27,8 @@ $(OUTPUT)/count_stcx_fail: loop.S $(EXTRA_SOURCES) $(OUTPUT)/per_event_excludes: ../utils.c =20 $(SUB_DIRS): - BUILD_TARGET=3D$(OUTPUT)/$@; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=3D$$= BUILD_TARGET -k -C $@ all + BUILD_TARGET=3D$(OUTPUT)/$@; mkdir -p $$BUILD_TARGET && $(MAKE) OUTPUT=3D= $$BUILD_TARGET -k -C $@ all; \ + status=3D$$?; $(call ksft_record_build_status,all,powerpc/pmu/$@); exit $= $status =20 DEFAULT_RUN_TESTS :=3D $(RUN_TESTS) override define RUN_TESTS @@ -42,18 +44,26 @@ emit_tests: BASENAME_TEST=3D`basename $$TEST`; \ echo "$(COLLECTION):$$BASENAME_TEST"; \ done - +@for TARGET in $(SUB_DIRS); do \ + +@ret=3D$(if $(SUB_DIRS),1,0); for TARGET in $(SUB_DIRS); do \ BUILD_TARGET=3D$(OUTPUT)/$$TARGET; \ $(MAKE) OUTPUT=3D$$BUILD_TARGET COLLECTION=3D$(COLLECTION)/$$TARGET -s -= C $$TARGET emit_tests; \ - done; + status=3D$$?; \ + $(call ksft_record_build_status,install,powerpc/pmu/$$TARGET); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ + done; exit $$ret =20 DEFAULT_INSTALL_RULE :=3D $(INSTALL_RULE) override define INSTALL_RULE $(DEFAULT_INSTALL_RULE) - +@for TARGET in $(SUB_DIRS); do \ + +@ret=3D$(if $(SUB_DIRS),1,0); for TARGET in $(SUB_DIRS); do \ BUILD_TARGET=3D$(OUTPUT)/$$TARGET; \ $(MAKE) OUTPUT=3D$$BUILD_TARGET INSTALL_PATH=3D$$INSTALL_PATH/$$TARGET -= C $$TARGET install; \ - done; + status=3D$$?; \ + $(call ksft_record_build_status,install,powerpc/pmu/$$TARGET); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ + done; exit $$ret endef =20 DEFAULT_CLEAN :=3D $(CLEAN) --=20 2.53.0 From nobody Thu Oct 15 03:30:20 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 955713EF643; Wed, 14 Oct 2026 20:01:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792008093; cv=none; b=iPssJzUuejDDPSvS+d8bFJGu5PW08mTq/Lv2JdgY2X6z3wRwDrE5W2H6vzc3W0pEUyWSOd1NiJYkfqJW+uxwj0tf1f8ct8buF478/e/wB0C4e7OnEhTC5Tlz+f9KdHIRyF7KJTVrsfrTtfBydbTNgNd9DwKz8FqF923A2C8p984= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792008093; c=relaxed/simple; bh=RTUsSg4hhQPc38/w1iz3yzoGFQVaMkd6UXlpt7tdK98=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lWoXTNXlIrpDUxjYgKjlQIcIxKYQRhs2Tu0Ui710n3LmHerswoVRfTR9ZXTrKjimz6L1XhPVsDfHkuuETqemf+hkJ//VbV+NGrFbrVBjDWe5JMW+DI1EQHjNyEKFeYhp0I7ypQYVpJFaWpBhvfP7PJH3tILb1nqvX5z5gl++sHc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QSxhzYXi; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QSxhzYXi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93A1D1F000C4; Wed, 14 Oct 2026 20:01:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792008087; bh=c+ft7M9gKgyjjxQdn8nKo6ADdoM0gUbB/WYH4VwDknE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QSxhzYXiJ8N4EcMGFQRsasGL8rUlTSLqzBc78SADl01gOa5QzhdVa7V7GV/bfg2Lf egxxD6KobgHB5B+FNeTvAHKQlB+LCYvCdOmDnus8wi6zqcqRI8H/Iabfzn3tOqhcQs zow53yeJ9fLA+eyRj2ukSxeSmrCsTWDhErvTiTxNrighrTUGkSvIjDSho41KzRfigK s6ATXAbVUyRQqHlgsSbGBaQV8LSl5vsaNhGaFl01LjkpSjN/q7wRmMCGJAhLDVGB5L G4Zarc1O/MJHaGv0gTBUc6vvHzuEC672Da8LwxYIE27TIcXOGg6B7hRnMdpd9pkGcx nYt4hb6edfJxA== From: Sasha Levin To: Shuah Khan Cc: Sasha Levin , "David S. Miller" , Andreas Larsson , sparclinux@vger.kernel.org, Mark Brown , =?UTF-8?q?Ricardo=20B=2E=20Marli=C3=A8re?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/7] selftests/sparc64: report failures of the drivers subdirectory Date: Wed, 14 Oct 2026 16:01:15 -0400 Message-ID: <20261014200115.1363363-8-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261014200115.1363363-1-sashal@kernel.org> References: <20261014200115.1363363-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The sparc64 suite builds and installs its subdirectories in shell loops whose status is that of the last command. For the build that is the copy of the subdirectory's test script, so "make all" succeeds even when the drivers tests fail to compile, and FORCE_TARGETS has no effect. Fold the copy into the status of the subdirectory and let both loops return failure when no subdirectory succeeds, which matches how the top-level selftests Makefile treats its targets, or as soon as one fails when FORCE_TARGETS is set. When a build report is requested, record each subdirectory as sparc64/. Invoke the subdirectories with $(MAKE) so that they use the parent's jobserver. Fixes: 3c545084130c ("selftests: sparc64: char: Selftest for privileged ADI= driver") Signed-off-by: Sasha Levin --- tools/testing/selftests/sparc64/Makefile | 33 ++++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/sparc64/Makefile b/tools/testing/selft= ests/sparc64/Makefile index 88f7be76f962d..a979c819348a0 100644 --- a/tools/testing/selftests/sparc64/Makefile +++ b/tools/testing/selftests/sparc64/Makefile @@ -2,6 +2,8 @@ ARCH ?=3D $(shell uname -m 2>/dev/null || echo not) override ARCH :=3D $(shell echo $(ARCH) | sed -e s/x86_64/x86/) =20 +include ../build_report.mk + ifneq ($(ARCH),sparc64) nothing: .PHONY: all clean run_tests install @@ -18,33 +20,42 @@ TEST_PROGS :=3D run.sh include ../lib.mk =20 all: - @for DIR in $(SUBDIRS); do \ - BUILD_TARGET=3D$(OUTPUT)/$$DIR; \ - mkdir $$BUILD_TARGET -p; \ - make OUTPUT=3D$$BUILD_TARGET -C $$DIR $@;\ + @ret=3D$(if $(SUBDIRS),1,0); for DIR in $(SUBDIRS); do \ + BUILD_TARGET=3D$(OUTPUT)/$$DIR; \ + mkdir -p $$BUILD_TARGET && \ + $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$DIR $@; \ + status=3D$$?; \ #SUBDIR test prog name should be in the form: SUBDIR_test.sh \ TEST=3D$$DIR"_test.sh"; \ if [ -e $$DIR/$$TEST ]; then \ - rsync -a $$DIR/$$TEST $$BUILD_TARGET/; \ - fi \ - done + rsync -a $$DIR/$$TEST $$BUILD_TARGET/ || \ + [ $$status -ne 0 ] || status=3D1; \ + fi; \ + $(call ksft_record_build_status,all,sparc64/$$DIR); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ + done; exit $$ret =20 override define INSTALL_RULE mkdir -p $(INSTALL_PATH) install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FI= LES) =20 - @for SUBDIR in $(SUBDIRS); do \ + @ret=3D$(if $(SUBDIRS),1,0); for SUBDIR in $(SUBDIRS); do \ BUILD_TARGET=3D$(OUTPUT)/$$SUBDIR; \ - mkdir $$BUILD_TARGET -p; \ + mkdir -p $$BUILD_TARGET && \ $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=3D$(INSTALL_PAT= H)/$$SUBDIR install; \ - done; + status=3D$$?; \ + $(call ksft_record_build_status,install,sparc64/$$SUBDIR); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=3D0; \ + done; exit $$ret endef =20 override define CLEAN @for DIR in $(SUBDIRS); do \ BUILD_TARGET=3D$(OUTPUT)/$$DIR; \ mkdir $$BUILD_TARGET -p; \ - make OUTPUT=3D$$BUILD_TARGET -C $$DIR $@;\ + $(MAKE) OUTPUT=3D$$BUILD_TARGET -C $$DIR $@;\ done endef endif --=20 2.53.0