* [PATCH 0/1] perf build: fix "argument list too long" in second location
@ 2026-04-09 22:14 Markus Mayer
2026-04-09 22:14 ` [PATCH 1/1] " Markus Mayer
0 siblings, 1 reply; 3+ messages in thread
From: Markus Mayer @ 2026-04-09 22:14 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, James Clark
Cc: Markus Mayer, Perf Mailing List, Linux Kernel Mailing List
Hi all,
My apologies for not catching this one sooner. Using xargs in the actual
build recipe worked, but it turns out echoing $^ in quiet_cmd_rm also
offends the shell. Somehow, it didn't show up during my tests before
submitting the previous fix[1] for this issue or I would have addressed
both together.
But then it did start to show up. Like this:
GEN linux/tools/perf/pmu-events/arch/arm64/arm/neoverse-v3/extra-metricgroups.json
TEST linux/tools/perf/pmu-events/metric_test.log
make[5]: /bin/sh: Argument list too long
make[5]: *** [pmu-events/Build:220: prune_orphans] Error 127
This was a bit of a head-scratcher before I realized that this came from
quiet_cmd_rm = RM $^
and that no attempt of putting quotes around $^ would help.
With change proposed here, it'll look like this instead:
GEN linux/tools/perf/pmu-events/arch/arm64/arm/neoverse-v3/extra-metricgroups.json
TEST linux/tools/perf/pmu-events/metric_test.log
RM ...634 orphan file(s)...
LD linux/tools/perf/util/perf-util-in.o
This is probably a good thing, regardless of the shell complaining,
since listing 634 files in a so-called "quiet" message is probably not
very fitting.
I don't know why my build has 634 orphans every single time it runs
(straight-up cross-build on x86_64 for ARM64) or if that is a lot. I do
get the impression that it is probably rather unusual. Not really doing
anything special, though.
Also, the build machines are running Ubuntu 24.04. As such, /bin/sh is
provided by /bin/dash. This may also factor into why I might be seeing
this issue while others may not.
Again, sorry for the churn. Hopefully this is it now on the orphan front.
Regards,
-Markus
[1] https://lore.kernel.org/linux-perf-users/20260303211503.165337-1-mmayer@broadcom.com/
Markus Mayer (1):
perf build: fix "argument list too long" in second location
tools/perf/pmu-events/Build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH 1/1] perf build: fix "argument list too long" in second location
2026-04-09 22:14 [PATCH 0/1] perf build: fix "argument list too long" in second location Markus Mayer
@ 2026-04-09 22:14 ` Markus Mayer
2026-04-10 9:25 ` James Clark
0 siblings, 1 reply; 3+ messages in thread
From: Markus Mayer @ 2026-04-09 22:14 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, James Clark
Cc: Markus Mayer, Perf Mailing List, Linux Kernel Mailing List
Turns out that displaying "RM $^" via quiet_cmd_rm can also upset the
shell and cause it to display "argument list too long".
Trying to quote $^ doesn't help.
In the end, *not* displaying the (potentially long) list of files is
probably the right thing to do for a "quiet" message, anyway. Instead,
let's display a count of how many files were removed. There is always
V=1 if more detail is required.
TEST linux/tools/perf/pmu-events/metric_test.log
RM ...634 orphan file(s)...
LD linux/tools/perf/util/perf-util-in.o
Also move the comment regarding xargs before the rule, so it doesn't
show up in the build output.
Signed-off-by: Markus Mayer <mmayer@broadcom.com>
---
tools/perf/pmu-events/Build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
index dc5f94862a3b..dc1df2d57ddc 100644
--- a/tools/perf/pmu-events/Build
+++ b/tools/perf/pmu-events/Build
@@ -211,10 +211,10 @@ ifneq ($(strip $(ORPHAN_FILES)),)
# Message for $(call echo-cmd,rm). Generally cleaning files isn't part
# of a build step.
-quiet_cmd_rm = RM $^
+quiet_cmd_rm = RM ...$(words $^) orphan file(s)...
+# The list of files can be long. Use xargs to prevent issues.
prune_orphans: $(ORPHAN_FILES)
- # The list of files can be long. Use xargs to prevent issues.
$(Q)$(call echo-cmd,rm)echo "$^" | xargs rm -f
JEVENTS_DEPS += prune_orphans
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] perf build: fix "argument list too long" in second location
2026-04-09 22:14 ` [PATCH 1/1] " Markus Mayer
@ 2026-04-10 9:25 ` James Clark
0 siblings, 0 replies; 3+ messages in thread
From: James Clark @ 2026-04-10 9:25 UTC (permalink / raw)
To: Markus Mayer
Cc: Perf Mailing List, Linux Kernel Mailing List, Peter Zijlstra,
Ingo Molnar, Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter
On 09/04/2026 11:14 pm, Markus Mayer wrote:
> Turns out that displaying "RM $^" via quiet_cmd_rm can also upset the
> shell and cause it to display "argument list too long".
>
> Trying to quote $^ doesn't help.
>
> In the end, *not* displaying the (potentially long) list of files is
> probably the right thing to do for a "quiet" message, anyway. Instead,
> let's display a count of how many files were removed. There is always
> V=1 if more detail is required.
>
> TEST linux/tools/perf/pmu-events/metric_test.log
> RM ...634 orphan file(s)...
> LD linux/tools/perf/util/perf-util-in.o
>
> Also move the comment regarding xargs before the rule, so it doesn't
> show up in the build output.
>
I'm assuming this is just a cosmetic issue so it doesn't need a fixes
tag? And "upsetting the shell" doesn't cause a build failure?
Otherwise looks good to me.
Reviewed-by: James Clark <james.clark@linaro.org>
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
> tools/perf/pmu-events/Build | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
> index dc5f94862a3b..dc1df2d57ddc 100644
> --- a/tools/perf/pmu-events/Build
> +++ b/tools/perf/pmu-events/Build
> @@ -211,10 +211,10 @@ ifneq ($(strip $(ORPHAN_FILES)),)
>
> # Message for $(call echo-cmd,rm). Generally cleaning files isn't part
> # of a build step.
> -quiet_cmd_rm = RM $^
> +quiet_cmd_rm = RM ...$(words $^) orphan file(s)...
>
> +# The list of files can be long. Use xargs to prevent issues.
> prune_orphans: $(ORPHAN_FILES)
> - # The list of files can be long. Use xargs to prevent issues.
> $(Q)$(call echo-cmd,rm)echo "$^" | xargs rm -f
>
> JEVENTS_DEPS += prune_orphans
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-10 9:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-09 22:14 [PATCH 0/1] perf build: fix "argument list too long" in second location Markus Mayer
2026-04-09 22:14 ` [PATCH 1/1] " Markus Mayer
2026-04-10 9:25 ` James Clark
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox