From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796523995; b=Q+2acdF4uWFO83Xm5iuPL6qkWgaHVXJtGe5vW2DQRcJ6KCibQS2e2XXrbxxv4vgTQDgn HA8uKQRQB2Zg2r7lUYGYR0bO335mzfe6ysQzCEmhZDiW0fREBeWbeEq8KrWvUVEGuKmJQ wOvho8k3rtsqEtL72YHwCh2GbsEZHOCKBjFEGqkNgjHc7/SEysG7h304o/En/2OjUttLp eRhS17om1TUnDLWlH81536iXqf9A55/zc9tdBB4ktwGZsXL03SQbOwo9qJyNwtFt2rXaT +3PjROMtT1DEsJ1g0k1/HXxGGjPE5/QbVD6hVCzgabs/9ElP3+6FBvvhix6eWXwWJCw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796523995; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=z+mdtOW0xiNkk5j55oShWtsPeJZxI8GB93oEkxZt7l4=; b=I39Up+oGivpYEYnO24vJSogwY+BAkRGnf5NdkYhkYtAy43mQS1EJ5KYW7h3004MBXfFC 4UBnwCaj3gIn+2P0HC1rZo2X8BDTqh3RYVPEcqhK2uphXPdR/ZcFGHDlGdprCiM00DBUp a7R2a33SxOP2Cyegf7cSpla49mlIniI2UfPM6/f8mRXtfdHKVW8ehDR2ngGsN3Xm2qojK FL9pD+zZe0Jse5M/s6ABDidaxyu2ozs+sSoGym+TLuPKMknKO8cefdL6hkwR6IpsIxUxu j9FuYoTDbHLPI+4VRjA9dPqCKLIwLduUlQYqYTpYn+FvFu7u4DOxtx7Su2CLN67N7cg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZcJ964pp; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2851606A31F for ; Sun, 6 Dec 2026 02:26:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZcJ964pp Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81FCE1F0093B; Sun, 6 Dec 2026 02:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796523995; bh=z+mdtOW0xiNkk5j55oShWtsPeJZxI8GB93oEkxZt7l4=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=ZcJ964ppKv1LneJvA+0fQbtB6V4S1IGyEH/dLoSiHc3c5NQyY3uS534J+Z0PybXaM 8KDB8qZY0bfseeUgYv05zFzF4kQ/gAVNHSvhP6xt16xLh9D6yNVVoD2c+4gt/qx2WR YKqSBytMG+Mpi5UxC7IheeXm/Glfp2LbnlrhSHdFxArCpO3Bm++cv5Uyph8PgmEEyk 7sgN854hO0X2UBXNqLScBcu2WcnHCNYz3PdJLIdpBRCDvSjP0daRi5HuH5kVqlrDGZ ozkIBx+YeihY90c8wdkJY/CTIp30F5kLbUSNaXuvYHrl28Ggri9gol2iG+kY0aYmeE tCP3cTWK+kUzQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 3/8] perf build: Avoid copying pmu-events JSON files into OUTPUT Reply-To: sashiko-reviews@lists.linux.dev To: "Ian Rogers" Cc: linux-perf-users@vger.kernel.org In-Reply-To: <20261206021147.3036701-4-irogers@google.com> References: <20261206021147.3036701-1-irogers@google.com> <20261206021147.3036701-4-irogers@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 06 Dec 2026 02:26:35 +0000 X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] perf build: unescaped hash in shell calls breaks GNU Make 4.0 to 4.2 - [Low] perf build: manifest rules omit make -q/-t guards and tmp cleanup -- commit e0b46c01cb6199425e57038cd246c6ade1c2f920 Author: Ian Rogers perf build: Avoid copying pmu-events JSON files into OUTPUT This commit writes generated pmu-events JSON files into a separate $(OUTPUT)pmu-events/gen directory and passes them to jevents.py via manifests, avoiding copying checked-in JSON files into OUTPUT. > diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build > index 32fc1378ef3aa..22e4db88272f3 100644 > --- a/tools/perf/pmu-events/Build > +++ b/tools/perf/pmu-events/Build [ ... ] > @@ -87,103 +99,95 @@ GEN_METRIC_DEPS :=3D pmu-events/metric.py pmu-events= /common_metrics.py > # Functions to extract the model from an extra-metrics.json or extra-met= ricgroups.json path. > model_name =3D $(notdir $(patsubst %/,%,$(dir $(1)))) > vendor_name =3D $(notdir $(patsubst %/,%,$(dir $(patsubst %/,%,$(dir $(1= )))))) > +JEVENTS_AWK :=3D $(or $(AWK),awk) > =20 > ifeq ($(JEVENTS_ARCH),$(filter $(JEVENTS_ARCH),x86 all)) > +X86_MODELS :=3D $(shell $(JEVENTS_AWK) -F, 'NR > 1 && $$0 !~ /^#/ && NF = >=3D 3 { print $$3 }' $(SRC_DIR)/x86/mapfile.csv | sort -u) [ ... ] > ifeq ($(JEVENTS_ARCH),$(filter $(JEVENTS_ARCH),arm64 all)) > # Generate ARM Json > -ARMS :=3D $(shell ls -d pmu-events/arch/arm64/arm/*|grep -v cmn) > -ARM_METRICS =3D $(foreach x,$(ARMS),$(OUTPUT)$(x)/extra-metrics.json) > -ARM_METRICGROUPS =3D $(foreach x,$(ARMS),$(OUTPUT)$(x)/extra-metricgroup= s.json) > +ARMS :=3D $(shell $(JEVENTS_AWK) -F, 'NR > 1 && $$0 !~ /^#/ && NF >=3D 3= && $$3 ~ /^arm\// { print $$3 }' $(SRC_DIR)/arm64/mapfile.csv | sort -u) [Severity: Medium] Can the unescaped # inside $(shell ...) in X86_MODELS and ARMS break builds on GNU Make 4.0 to 4.2? Before GNU Make 4.3, an unescaped # inside a function call starts a Makefile comment, truncating the line and aborting with an unterminated $(shell ...) error. Documentation/process/changes.rst lists GNU Make 4.0 as the minimum supported version. tools/build/Build.include already defines pound :=3D \#, so /^$(pound)/ works across both GNU Make 4.0-4.2 and 4.3+. [ ... ] > +$(JEVENTS_GEN_MANIFEST): FORCE | $(PMU_EVENTS_OUT_DIR) > + $(if $(findstring n,$(firstword -$(MAKEFLAGS))),,$(file > $@.tmp,$(subs= t $(space),$(_jevents_nl),$(strip $(GEN_JSON_REL)))))@if cmp -s $@.tmp $@ 2= >/dev/null; then \ > + rm -f $@.tmp; \ > + else \ > + mv -f $@.tmp $@; \ > + fi > =20 > -endif # ifneq ($(OUTPUT),) > +$(JEVENTS_SRC_MANIFEST): FORCE | $(PMU_EVENTS_OUT_DIR) > + $(if $(findstring n,$(firstword -$(MAKEFLAGS))),,$(file > $@.tmp,$(subs= t $(space),$(_jevents_nl),$(strip $(sort $(SRC_JSON))))))@if cmp -s $@.tmp = $@ 2>/dev/null; then \ > + rm -f $@.tmp; \ > + else \ > + mv -f $@.tmp $@; \ > + fi > + > +$(JEVENTS_EMPTY_SRC_MANIFEST): FORCE | $(PMU_EVENTS_OUT_DIR) > + $(if $(findstring n,$(firstword -$(MAKEFLAGS))),,$(file > $@.tmp,$(subs= t $(space),$(_jevents_nl),$(strip $(sort $(SRC_COMMON_TEST))))))@if cmp -s = $@.tmp $@ 2>/dev/null; then \ > + rm -f $@.tmp; \ > + else \ > + mv -f $@.tmp $@; \ > + fi [Severity: Low] Should these manifest rules also guard $(file > $@.tmp,...) against make -q and -t? Because the targets depend on FORCE, GNU Make expands their recipes under make -q and make -t without running $(PMU_EVENTS_OUT_DIR) or the shell cmp/rm/mv cleanup. On a fresh out-of-tree build that fails to open $@.tmp, and otherwise leaves jevents-*-files.tmp behind. In addition, pmu-events-clean in tools/perf/Makefile.perf does not remove leftover jevents-*-files.tmp files from make -q/-t or interrupted builds. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261206021147.3036= 701-1-irogers@google.com?part=3D3