All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	 Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	 James Clark <james.clark@linaro.org>,
	linux-perf-users@vger.kernel.org,  linux-kernel@vger.kernel.org,
	Ian Rogers <irogers@google.com>
Subject: [PATCH 8/8] perf tests make: Only run shellcheck, mypy and pylint in pure builds
Date: Sat,  5 Dec 2026 18:11:47 -0800	[thread overview]
Message-ID: <20261206021147.3036701-9-irogers@google.com> (raw)
In-Reply-To: <20261206021147.3036701-1-irogers@google.com>

tools/perf/Makefile.perf automatically enables SHELLCHECK, MYPY and
PYLINT whenever those tools are found on PATH and attaches all of their
check targets to 'all'. Because none of the other build configurations
in tools/perf/tests/make change the shell scripts or Python files being
checked (beyond NO_JEVENTS=1 skipping pmu-events/*.py, which is already
checked by the default build), build-test was repeating hundreds of
identical shellcheck, mypy and pylint invocations on every build target.

Pass NO_SHELLCHECK=1 NO_MYPY=1 NO_PYLINT=1 to every build target in
tools/perf/tests/make except make_pure and make_pure_O (including
make_with_gtk4, make_static, make_kernelsrc and make_kernelsrc_tools).
This keeps full linter coverage once in out-of-tree builds (make_pure_O,
exercised by build-test and build-test-tarball) and once in in-tree
builds (make_pure), while eliminating redundant linter runs and version
probing across all other configurations.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/tests/make | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index 491a0813b630..dbb6407d0506 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -394,11 +394,16 @@ MAKEFLAGS := --no-print-directory
 
 clean := @(cd $(PERF); $(MAKE_F) -s $(O_OPT) clean >/dev/null && $(MAKE) -s $(O_OPT) -C ../build clean >/dev/null)
 
+# Only run shellcheck, mypy and pylint in the pure build so build-test doesn't
+# repeat identical static checks on every build configuration.
+NO_LINT_OPT := NO_SHELLCHECK=1 NO_MYPY=1 NO_PYLINT=1
+lint_opt = $(if $(filter make_pure make_pure_O,$1),,$(NO_LINT_OPT))
+
 $(run):
 	$(call clean)
 	+@TMP_DEST=$$(mktemp -d); \
 	trap 'rm -rf $@ $$TMP_DEST; exit 130' INT TERM; \
-	cmd="cd $(PERF) && $(MAKE_F) $($@) $(PARALLEL_OPT) $(O_OPT) DESTDIR=$$TMP_DEST"; \
+	cmd="cd $(PERF) && $(MAKE_F) $($@) $(call lint_opt,$@) $(PARALLEL_OPT) $(O_OPT) DESTDIR=$$TMP_DEST"; \
 	printf "%*.*s: %s\n" $(max_width) $(max_width) "$@" "$$cmd" && echo $$cmd > $@ && \
 	( eval $$cmd ) >> $@ 2>&1; \
 	echo "  test: $(call test,$@)" >> $@ 2>&1; \
@@ -409,7 +414,7 @@ make_with_gtk4:
 	$(call clean)
 	+@TMP_DEST=$$(mktemp -d); \
 	trap 'rm -rf $@ $$TMP_DEST; exit 130' INT TERM; \
-	cmd="cd $(PERF) && $(MAKE_F) $($@) $(PARALLEL_OPT) $(O_OPT) DESTDIR=$$TMP_DEST"; \
+	cmd="cd $(PERF) && $(MAKE_F) $($@) $(NO_LINT_OPT) $(PARALLEL_OPT) $(O_OPT) DESTDIR=$$TMP_DEST"; \
 	printf "%*.*s: %s\n" $(max_width) $(max_width) "$@" "$$cmd" && echo $$cmd > $@ && \
 	( eval $$cmd ) >> $@ 2>&1; \
 	echo "  test: $(call test,$@)" >> $@ 2>&1; \
@@ -420,7 +425,7 @@ make_static:
 	$(call clean)
 	+@TMP_DEST=$$(mktemp -d); \
 	trap 'rm -rf $@ $$TMP_DEST; exit 130' INT TERM; \
-	cmd="cd $(PERF) && $(MAKE_F) $($@) $(PARALLEL_OPT) $(O_OPT) DESTDIR=$$TMP_DEST"; \
+	cmd="cd $(PERF) && $(MAKE_F) $($@) $(NO_LINT_OPT) $(PARALLEL_OPT) $(O_OPT) DESTDIR=$$TMP_DEST"; \
 	printf "%*.*s: %s\n" $(max_width) $(max_width) "$@" "$$cmd" && echo $$cmd > $@ && \
 	( eval $$cmd ) >> $@ 2>&1; \
 	echo "  test: $(call test,$@)" >> $@ 2>&1; \
@@ -434,7 +439,7 @@ endif
 	+@TMP_O=$$(mktemp -d); \
 	TMP_DEST=$$(mktemp -d); \
 	trap 'rm -rf $@ $$TMP_O $$TMP_DEST; exit 130' INT TERM; \
-	cmd="cd $(PERF) && $(MAKE_F) $($(patsubst %_O,%,$@)) $(PARALLEL_OPT) O=$$TMP_O DESTDIR=$$TMP_DEST"; \
+	cmd="cd $(PERF) && $(MAKE_F) $($(patsubst %_O,%,$@)) $(call lint_opt,$@) $(PARALLEL_OPT) O=$$TMP_O DESTDIR=$$TMP_DEST"; \
 	printf "%*.*s: %s\n" $(max_width) $(max_width) "$@" "$$cmd" && echo $$cmd > $@ && \
 	( eval $$cmd ) >> $@ 2>&1 && \
 	echo "  test: $(call test_O,$@)" >> $@ 2>&1; \
@@ -453,15 +458,15 @@ ifneq ($(O),)
 endif
 
 make_kernelsrc:
-	@echo "- make -C <kernelsrc> $(PARALLEL_OPT) $(K_O_OPT) tools/perf"
+	@echo "- make -C <kernelsrc> $(PARALLEL_OPT) $(K_O_OPT) $(NO_LINT_OPT) tools/perf"
 	$(call clean); \
-	($(MAKE) -C ../.. $(PARALLEL_OPT) $(K_O_OPT) tools/perf) > $@ 2>&1 && \
+	($(MAKE) -C ../.. $(PARALLEL_OPT) $(K_O_OPT) $(NO_LINT_OPT) tools/perf) > $@ 2>&1 && \
 	test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false)
 
 make_kernelsrc_tools:
-	@echo "- make -C <kernelsrc>/tools $(PARALLEL_OPT) $(K_O_OPT) perf"
+	@echo "- make -C <kernelsrc>/tools $(PARALLEL_OPT) $(K_O_OPT) $(NO_LINT_OPT) perf"
 	$(call clean); \
-	($(MAKE) -C ../../tools $(PARALLEL_OPT) $(K_O_OPT) perf) > $@ 2>&1 && \
+	($(MAKE) -C ../../tools $(PARALLEL_OPT) $(K_O_OPT) $(NO_LINT_OPT) perf) > $@ 2>&1 && \
 	test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false)
 
 make_libperf:
-- 
2.56.1.915.g69d5ec7298-goog


  parent reply	other threads:[~2026-12-06  2:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-06  2:11 [PATCH 0/8] perf build: Avoid pmu-events copies and improve build parallelism Ian Rogers
2026-12-06  2:11 ` [PATCH 1/8] perf pmu-events: Ignore backup and non-event JSON files in metric.py Ian Rogers
2026-12-06  2:22   ` sashiko-bot
2026-12-06  2:11 ` [PATCH 2/8] perf jevents: Support --gen-dir/--gen-manifest overlay and ignore backups Ian Rogers
2026-12-06  2:23   ` sashiko-bot
2026-12-06  2:11 ` [PATCH 3/8] perf build: Avoid copying pmu-events JSON files into OUTPUT Ian Rogers
2026-12-06  2:26   ` sashiko-bot
2026-12-06  2:11 ` [PATCH 4/8] perf pmu-events: Batch metric generation and scope via mapfile.csv Ian Rogers
2026-12-06  2:28   ` sashiko-bot
2026-12-06  2:11 ` [PATCH 5/8] perf build: Batch metric JSON generation in pmu-events/Build Ian Rogers
2026-12-06  2:26   ` sashiko-bot
2026-12-06  2:11 ` [PATCH 6/8] perf build: Run pmu-events tests in parallel with jevents.py Ian Rogers
2026-12-06  2:11 ` [PATCH 7/8] perf build: Depend on lib*-headers instead of archives in prepare Ian Rogers
2026-12-06  2:11 ` Ian Rogers [this message]
2026-12-06  2:22   ` [PATCH 8/8] perf tests make: Only run shellcheck, mypy and pylint in pure builds sashiko-bot
2026-12-06  2:28 ` [PATCH 0/8] perf build: Avoid pmu-events copies and improve build parallelism sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261206021147.3036701-9-irogers@google.com \
    --to=irogers@google.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.