From: James Clark <james.clark@linaro.org>
To: "Benoît Monin" <benoit.monin@bootlin.com>
Cc: "Gregory CLEMENT" <gregory.clement@bootlin.com>,
"Théo Lebrun" <theo.lebrun@bootlin.com>,
"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>,
"Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Arnaldo Carvalho de Melo" <acme@redhat.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
"Peter Zijlstra" <peterz@infradead.org>,
"Ingo Molnar" <mingo@redhat.com>,
"Arnaldo Carvalho de Melo" <acme@kernel.org>,
"Namhyung Kim" <namhyung@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
"Jiri Olsa" <jolsa@kernel.org>, "Ian Rogers" <irogers@google.com>,
"Adrian Hunter" <adrian.hunter@intel.com>,
"Markus Mayer" <mmayer@broadcom.com>
Subject: Re: [PATCH] perf build: Improve fix for "argument list too long" error
Date: Mon, 28 Sep 2026 10:15:47 +0100 [thread overview]
Message-ID: <8bc8b276-bc4e-4a6d-b770-5b02c79946d4@linaro.org> (raw)
In-Reply-To: <20260928-perf-orphan-args-v1-1-8cacf784621e@bootlin.com>
On 28/09/2026 09:55, Benoît Monin wrote:
> The orphaned pmu-events JSON files are passed to the shell via
> `echo "$^"`, which puts the whole list into a single argument. With
> a long enough output directory path and enough files, exec'ing
> /bin/sh fails with:
>
> make[5]: /bin/sh: Argument list too long
> make[5]: *** [pmu-events/Build:228: prune_orphans] Error 127
>
> This only happens with out-of-tree builds, when setting O= to a
> relatively long path.
>
> To reproduce, build once with JEVENTS_ARCH=all, then rebuild with
> a smaller JEVENTS_ARCH without cleaning first, so the leftover files
> become orphans. Using nds32 (which leaves ~1100 orphans), an output
> path of only ~70 characters is already enough to trigger it:
>
> OUT=/any/long/path (at least 70 characters)
> make -C tools/perf JEVENTS_ARCH=all O=$OUT -j$(nproc)
> make -C tools/perf JEVENTS_ARCH=nds32 O=$OUT -j$(nproc)
>
> Express the orphan file list as paths relative to $(OUT_DIR) by
> stripping the common prefix and restoring it with printf, the same
> approach used in scripts/Makefile.clean, so the shell arguments stay
> short.
>
> Fixes: b6712d91f8f5 ("perf build: Prevent "argument list too long" error")
> Suggested-by: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>
> Signed-off-by: Benoît Monin <benoit.monin@bootlin.com>
> Tested-by: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>
Reviewed-by: James Clark <james.clark@linaro.org>
next prev parent reply other threads:[~2026-09-28 9:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 8:55 Benoît Monin
2026-09-28 9:15 ` James Clark [this message]
2026-09-28 15:10 ` Ian Rogers
2026-09-28 16:38 ` Arnaldo Carvalho de Melo
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=8bc8b276-bc4e-4a6d-b770-5b02c79946d4@linaro.org \
--to=james.clark@linaro.org \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=benoit.monin@bootlin.com \
--cc=gregory.clement@bootlin.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=mmayer@broadcom.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=tawfik.bayouk@mobileye.com \
--cc=theo.lebrun@bootlin.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=vladimir.kondratiev@mobileye.com \
/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
all inboxes | Powered by JetHome®