]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf build: fix "argument list too long" in second location
authorMarkus Mayer <mmayer@broadcom.com>
Thu, 9 Apr 2026 22:14:17 +0000 (15:14 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 14 Apr 2026 06:22:16 +0000 (23:22 -0700)
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>
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/pmu-events/Build

index dc5f94862a3bc45683c05b04b627adfd5d68aed2..dc1df2d57ddc1749ec02299b01e8dc41084918c8 100644 (file)
@@ -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