Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 8/8] perf tests make: Only run shellcheck, mypy and pylint in pure builds
Date: Sun, 06 Dec 2026 02:22:27 +0000	[thread overview]
Message-ID: <sashiko-outbox-252059@kernel.org> (raw)
In-Reply-To: <20261206021147.3036701-9-irogers@google.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] perf tests: disabling linters in make_kernelsrc leaves broken
  pure checks
- [Low] perf tests: clean and auxiliary sub-makes omit NO_LINT_OPT
  version bypass
--

commit 748bfa2fc848f5e6768659f6b773e357691e78b1
Author: Ian Rogers <irogers@google.com>

perf tests make: Only run shellcheck, mypy and pylint in pure builds

This commit passes 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 so the
linters only run once in-tree and once out-of-tree.

> diff --git a/tools/perf/tests/make b/tools/perf/tests/make
> index 491a0813b6307..dbb6407d0506f 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))

[Severity: Low]
Should clean, python_perf_target, and feature-dump also pass
$(NO_LINT_OPT)?

In tools/perf/Makefile.perf, the SHELLCHECK probe is unguarded and the
MYPY and PYLINT probes only check ifneq ($(force_fixdep),1), which is
still true for clean.  Every $(call clean) invocation therefore still
runs the linter version probes (including pylint --version) on each
build configuration.

Defining NO_LINT_OPT earlier and passing it to those sub-makes, or gating
the probes on config=1 in Makefile.perf, would eliminate the remaining
probing.

>  $(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; \

[ ... ]

> @@ -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)

[Severity: Medium]
Does disabling the linters in make_kernelsrc and make_kernelsrc_tools
leave build-test silently passing on shellcheck, mypy, and pylint
failures?

Both make_kernelsrc and make_kernelsrc_tools chain && directly from
$(MAKE) into test -x, so they previously failed on linter errors.  In
contrast, $(run) terminates ( eval $$cmd ) with a semicolon, and $(run_O)
ends its && chain with a semicolon after echo before $(call test_O,$@),
so both discard a non-zero exit status from make.

In tools/perf/Makefile.perf, the shellcheck, mypy, and pylint targets are
independent prerequisites of all: listed after $(OUTPUT)perf.  When perf
links before a linter target fails, test -x .../perf still succeeds,
rm -rf removes the log, and make_pure or make_pure_O exits 0.

Chaining && from ( eval $$cmd ) through echo into $(call test,$@) and
$(call test_O,$@) in $(run) and $(run_O) would preserve linter failures.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261206021147.3036701-1-irogers@google.com?part=8

  reply	other threads:[~2026-12-06  2:22 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 ` [PATCH 8/8] perf tests make: Only run shellcheck, mypy and pylint in pure builds Ian Rogers
2026-12-06  2:22   ` sashiko-bot [this message]
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=sashiko-outbox-252059@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=irogers@google.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox