From mboxrd@z Thu Jan 1 00:00:00 1970 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-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 style") 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/selftests/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) $(SUB_DIRS): - BUILD_TARGET=$(OUTPUT)/$@; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $@ all + BUILD_TARGET=$(OUTPUT)/$@; mkdir -p $$BUILD_TARGET && $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $@ all; \ + status=$$?; $(call ksft_record_build_status,all,powerpc/$@); exit $$status include ../lib.mk +include $(selfdir)/build_report.mk include ./flags.mk override define RUN_TESTS @@ -50,17 +52,25 @@ override define RUN_TESTS endef override define INSTALL_RULE - +@for TARGET in $(SUB_DIRS); do \ + +@ret=$(if $(SUB_DIRS),1,0); for TARGET in $(SUB_DIRS); do \ BUILD_TARGET=$(OUTPUT)/$$TARGET; \ $(MAKE) OUTPUT=$$BUILD_TARGET INSTALL_PATH=$$INSTALL_PATH/$$TARGET -C $$TARGET install;\ - done; + status=$$?; \ + $(call ksft_record_build_status,install,powerpc/$$TARGET); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=0; \ + done; exit $$ret endef emit_tests: - +@for TARGET in $(SUB_DIRS); do \ + +@ret=$(if $(SUB_DIRS),1,0); for TARGET in $(SUB_DIRS); do \ BUILD_TARGET=$(OUTPUT)/$$TARGET; \ $(MAKE) OUTPUT=$$BUILD_TARGET COLLECTION=$(COLLECTION)/$$TARGET -s -C $$TARGET $@;\ - done; + status=$$?; \ + $(call ksft_record_build_status,install,powerpc/$$TARGET); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=0; \ + done; exit $$ret override define CLEAN +@for TARGET in $(SUB_DIRS); do \ diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/selftests/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 := ../harness.c event.c lib.c ../utils.c top_srcdir = ../../../../.. include ../../lib.mk +include $(selfdir)/build_report.mk include ../flags.mk SUB_DIRS := ebb sampling_tests event_code_tests @@ -26,7 +27,8 @@ $(OUTPUT)/count_stcx_fail: loop.S $(EXTRA_SOURCES) $(OUTPUT)/per_event_excludes: ../utils.c $(SUB_DIRS): - BUILD_TARGET=$(OUTPUT)/$@; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $@ all + BUILD_TARGET=$(OUTPUT)/$@; mkdir -p $$BUILD_TARGET && $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $@ all; \ + status=$$?; $(call ksft_record_build_status,all,powerpc/pmu/$@); exit $$status DEFAULT_RUN_TESTS := $(RUN_TESTS) override define RUN_TESTS @@ -42,18 +44,26 @@ emit_tests: BASENAME_TEST=`basename $$TEST`; \ echo "$(COLLECTION):$$BASENAME_TEST"; \ done - +@for TARGET in $(SUB_DIRS); do \ + +@ret=$(if $(SUB_DIRS),1,0); for TARGET in $(SUB_DIRS); do \ BUILD_TARGET=$(OUTPUT)/$$TARGET; \ $(MAKE) OUTPUT=$$BUILD_TARGET COLLECTION=$(COLLECTION)/$$TARGET -s -C $$TARGET emit_tests; \ - done; + status=$$?; \ + $(call ksft_record_build_status,install,powerpc/pmu/$$TARGET); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=0; \ + done; exit $$ret DEFAULT_INSTALL_RULE := $(INSTALL_RULE) override define INSTALL_RULE $(DEFAULT_INSTALL_RULE) - +@for TARGET in $(SUB_DIRS); do \ + +@ret=$(if $(SUB_DIRS),1,0); for TARGET in $(SUB_DIRS); do \ BUILD_TARGET=$(OUTPUT)/$$TARGET; \ $(MAKE) OUTPUT=$$BUILD_TARGET INSTALL_PATH=$$INSTALL_PATH/$$TARGET -C $$TARGET install; \ - done; + status=$$?; \ + $(call ksft_record_build_status,install,powerpc/pmu/$$TARGET); \ + $(if $(FORCE_TARGETS),[ $$status -eq 0 ] || exit $$status;) \ + [ $$status -eq 0 ] && ret=0; \ + done; exit $$ret endef DEFAULT_CLEAN := $(CLEAN) -- 2.53.0