Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH] perf build: Override OUTPUT when building internal libraries
@ 2026-11-03 16:55 Dmitry Safonov via B4 Relay
  2026-11-03 17:01 ` sashiko-bot
  2026-11-04 20:44 ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Safonov via B4 Relay @ 2026-11-03 16:55 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: Arnaldo Carvalho de Melo, linux-perf-users, linux-kernel,
	Dmitry Safonov, Dmitry Safonov

From: Dmitry Safonov <dima@arista.com>

After commit 1572ba36fbca ("perf tests: Improvements to build-test
performance"), building perf with OUTPUT on the command line fails:
  make -C tools/perf OUTPUT=/tmp/linux/bld/perf/ ARCH=x86_64 LC_ALL=C CC=gcc HOSTCC=gcc LD=ld
  ...
  make[3]: *** No rule to make target '/tmp/linux/perf/libsubcmd/libsubcmd.a'.  Stop.

MAKEFLAGS propagates the command-line OUTPUT assignment to recursive makes.
The library builds pass their output directories through $O, but the assignment
to $OUTPUT in tools/scripts/Makefile.include cannot replace a command-line
argument. This affects libapi, libperf, libsubcmd and libsymbol.

With "unexport MAKEFLAGS" returned and added $(info) debug in libsubcmd
Makefile produces:
  OUTPUT = /tmp/linux/perf/libsubcmd/
Without it, on current master it prints:
  OUTPUT = /tmp/linux/perf/

Pass OUTPUT explicitly to each library build, including the trailing slash
required when constructing file names. This follows the existing libbpf
build rule and preserves MAKEFLAGS and jobserver propagation.

Fixes: 1572ba36fbca ("perf tests: Improvements to build-test performance")
Signed-off-by: Dmitry Safonov <dima@arista.com>
---
 tools/perf/Makefile.perf | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index b74b534e1153..4cc5bb3011da 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -798,7 +798,7 @@ $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
 
 $(LIBAPI): FORCE | $(LIBAPI_OUTPUT)
 	$(Q)$(MAKE) -C $(LIBAPI_DIR) O=$(LIBAPI_OUTPUT) \
-		DESTDIR=$(LIBAPI_DESTDIR) prefix= subdir= \
+		OUTPUT=$(LIBAPI_OUTPUT)/ DESTDIR=$(LIBAPI_DESTDIR) prefix= subdir= \
 		$@ install_headers
 
 $(LIBAPI)-clean:
@@ -816,7 +816,7 @@ $(LIBBPF)-clean:
 
 $(LIBPERF): FORCE | $(LIBPERF_OUTPUT)
 	$(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(LIBPERF_OUTPUT) \
-		DESTDIR=$(LIBPERF_DESTDIR) prefix= subdir= \
+		OUTPUT=$(LIBPERF_OUTPUT)/ DESTDIR=$(LIBPERF_DESTDIR) prefix= subdir= \
 		$@ install_headers
 
 $(LIBPERF)-clean:
@@ -825,7 +825,7 @@ $(LIBPERF)-clean:
 
 $(LIBSUBCMD): FORCE | $(LIBSUBCMD_OUTPUT)
 	$(Q)$(MAKE) -C $(LIBSUBCMD_DIR) O=$(LIBSUBCMD_OUTPUT) \
-		DESTDIR=$(LIBSUBCMD_DESTDIR) prefix= subdir= \
+		OUTPUT=$(LIBSUBCMD_OUTPUT)/ DESTDIR=$(LIBSUBCMD_DESTDIR) prefix= subdir= \
 		$@ install_headers
 
 $(LIBSUBCMD)-clean:
@@ -834,7 +834,7 @@ $(LIBSUBCMD)-clean:
 
 $(LIBSYMBOL): FORCE | $(LIBSYMBOL_OUTPUT)
 	$(Q)$(MAKE) -C $(LIBSYMBOL_DIR) O=$(LIBSYMBOL_OUTPUT) \
-		DESTDIR=$(LIBSYMBOL_DESTDIR) prefix= subdir= \
+		OUTPUT=$(LIBSYMBOL_OUTPUT)/ DESTDIR=$(LIBSYMBOL_DESTDIR) prefix= subdir= \
 		$@ install_headers
 
 $(LIBSYMBOL)-clean:

---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261103-perf-output-58d6965d2726

Best regards,
--  
Dmitry Safonov <dima@arista.com>



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf build: Override OUTPUT when building internal libraries
  2026-11-03 16:55 [PATCH] perf build: Override OUTPUT when building internal libraries Dmitry Safonov via B4 Relay
@ 2026-11-03 17:01 ` sashiko-bot
  2026-11-04 20:44 ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-11-03 17:01 UTC (permalink / raw)
  To: Dmitry Safonov; +Cc: linux-perf-users

> From: Dmitry Safonov <dima@arista.com>
> 
> After commit 1572ba36fbca ("perf tests: Improvements to build-test
> performance"), building perf with OUTPUT on the command line fails:
>   make -C tools/perf OUTPUT=/tmp/linux/bld/perf/ ARCH=x86_64 LC_ALL=C CC=gcc HOSTCC=gcc LD=ld
>   ...
>   make[3]: *** No rule to make target '/tmp/linux/perf/libsubcmd/libsubcmd.a'.  Stop.
> 
> MAKEFLAGS propagates the command-line OUTPUT assignment to recursive makes.
> The library builds pass their output directories through $O, but the assignment
> to $OUTPUT in tools/scripts/Makefile.include cannot replace a command-line
> argument. This affects libapi, libperf, libsubcmd and libsymbol.
> 
> With "unexport MAKEFLAGS" returned and added $(info) debug in libsubcmd
> Makefile produces:
>   OUTPUT = /tmp/linux/perf/libsubcmd/
> Without it, on current master it prints:
>   OUTPUT = /tmp/linux/perf/
> 
> Pass OUTPUT explicitly to each library build, including the trailing slash
> required when constructing file names. This follows the existing libbpf
> build rule and preserves MAKEFLAGS and jobserver propagation.
> 
> Fixes: 1572ba36fbca ("perf tests: Improvements to build-test performance")
> Signed-off-by: Dmitry Safonov <dima@arista.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261103-perf-output-v1-1-df33a0368cf2@arista.com?part=1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf build: Override OUTPUT when building internal libraries
  2026-11-03 16:55 [PATCH] perf build: Override OUTPUT when building internal libraries Dmitry Safonov via B4 Relay
  2026-11-03 17:01 ` sashiko-bot
@ 2026-11-04 20:44 ` Arnaldo Carvalho de Melo
  2026-11-04 21:09   ` Dmitry Safonov
  1 sibling, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2026-11-04 20:44 UTC (permalink / raw)
  To: dima
  Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	James Clark, Arnaldo Carvalho de Melo, linux-perf-users,
	linux-kernel, Dmitry Safonov

On Tue, Nov 03, 2026 at 04:55:21PM +0000, Dmitry Safonov via B4 Relay wrote:
> From: Dmitry Safonov <dima@arista.com>
> 
> After commit 1572ba36fbca ("perf tests: Improvements to build-test
> performance"), building perf with OUTPUT on the command line fails:
>   make -C tools/perf OUTPUT=/tmp/linux/bld/perf/ ARCH=x86_64 LC_ALL=C CC=gcc HOSTCC=gcc LD=ld

That '/bld/' is not reflected in the next line, copy'n'paste mistake?

>   ...
>   make[3]: *** No rule to make target '/tmp/linux/perf/libsubcmd/libsubcmd.a'.  Stop.

⬢ [acme@toolbx perf-tools]$ mkdir -p /tmp/linux/perf
⬢ [acme@toolbx perf-tools]$ make -C tools/perf OUTPUT=/tmp/linux/perf/ ARCH=x86_64 LC_ALL=C CC=gcc HOSTCC=gcc LD=ld
make: Entering directory '/home/acme/git/perf-tools/tools/perf'
  BUILD:   Doing 'make -j32' parallel build
  <SNIP>
    TEST    /tmp/linux/perf/tests/shell/base_probe/test_line_semantics.sh.shellcheck_log
  GEN     /tmp/linux/perf/arch/arm64/include/generated/asm/sysreg-defs.h
make[3]: *** No rule to make target '/tmp/linux/perf/libsubcmd/libsubcmd.a'.  Stop.
make[2]: *** [Makefile.perf:827: /tmp/linux/perf/libsubcmd/libsubcmd.a] Error 2
make[2]: *** Waiting for unfinished jobs....
  MKDIR   /tmp/linux/perf/tests/shell/lib/
  TEST    /tmp/linux/perf/tests/shell/lib/perf_metric_validation.py.mypy_log
  TEST    /tmp/linux/perf/tests/shell/lib/perf_json_output_lint.py.mypy_log
  PERF_VERSION = 7.4.rc1.g45e09a6dbb2d
make[3]: *** No rule to make target '/tmp/linux/perf/libsymbol/libsymbol.a'.  Stop.
make[3]: *** No rule to make target '/tmp/linux/perf/libperf/libperf.a'.  Stop.

Minor stuff, I'll fix it up and apply to perf-tools to send for 7.4-rc1,

Thanks,

- Arnaldo

> MAKEFLAGS propagates the command-line OUTPUT assignment to recursive makes.
> The library builds pass their output directories through $O, but the assignment
> to $OUTPUT in tools/scripts/Makefile.include cannot replace a command-line
> argument. This affects libapi, libperf, libsubcmd and libsymbol.
> 
> With "unexport MAKEFLAGS" returned and added $(info) debug in libsubcmd
> Makefile produces:
>   OUTPUT = /tmp/linux/perf/libsubcmd/
> Without it, on current master it prints:
>   OUTPUT = /tmp/linux/perf/
> 
> Pass OUTPUT explicitly to each library build, including the trailing slash
> required when constructing file names. This follows the existing libbpf
> build rule and preserves MAKEFLAGS and jobserver propagation.
> 
> Fixes: 1572ba36fbca ("perf tests: Improvements to build-test performance")
> Signed-off-by: Dmitry Safonov <dima@arista.com>
> ---
>  tools/perf/Makefile.perf | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index b74b534e1153..4cc5bb3011da 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -798,7 +798,7 @@ $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
>  
>  $(LIBAPI): FORCE | $(LIBAPI_OUTPUT)
>  	$(Q)$(MAKE) -C $(LIBAPI_DIR) O=$(LIBAPI_OUTPUT) \
> -		DESTDIR=$(LIBAPI_DESTDIR) prefix= subdir= \
> +		OUTPUT=$(LIBAPI_OUTPUT)/ DESTDIR=$(LIBAPI_DESTDIR) prefix= subdir= \
>  		$@ install_headers
>  
>  $(LIBAPI)-clean:
> @@ -816,7 +816,7 @@ $(LIBBPF)-clean:
>  
>  $(LIBPERF): FORCE | $(LIBPERF_OUTPUT)
>  	$(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(LIBPERF_OUTPUT) \
> -		DESTDIR=$(LIBPERF_DESTDIR) prefix= subdir= \
> +		OUTPUT=$(LIBPERF_OUTPUT)/ DESTDIR=$(LIBPERF_DESTDIR) prefix= subdir= \
>  		$@ install_headers
>  
>  $(LIBPERF)-clean:
> @@ -825,7 +825,7 @@ $(LIBPERF)-clean:
>  
>  $(LIBSUBCMD): FORCE | $(LIBSUBCMD_OUTPUT)
>  	$(Q)$(MAKE) -C $(LIBSUBCMD_DIR) O=$(LIBSUBCMD_OUTPUT) \
> -		DESTDIR=$(LIBSUBCMD_DESTDIR) prefix= subdir= \
> +		OUTPUT=$(LIBSUBCMD_OUTPUT)/ DESTDIR=$(LIBSUBCMD_DESTDIR) prefix= subdir= \
>  		$@ install_headers
>  
>  $(LIBSUBCMD)-clean:
> @@ -834,7 +834,7 @@ $(LIBSUBCMD)-clean:
>  
>  $(LIBSYMBOL): FORCE | $(LIBSYMBOL_OUTPUT)
>  	$(Q)$(MAKE) -C $(LIBSYMBOL_DIR) O=$(LIBSYMBOL_OUTPUT) \
> -		DESTDIR=$(LIBSYMBOL_DESTDIR) prefix= subdir= \
> +		OUTPUT=$(LIBSYMBOL_OUTPUT)/ DESTDIR=$(LIBSYMBOL_DESTDIR) prefix= subdir= \
>  		$@ install_headers
>  
>  $(LIBSYMBOL)-clean:
> 
> ---
> base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
> change-id: 20261103-perf-output-58d6965d2726
> 
> Best regards,
> --  
> Dmitry Safonov <dima@arista.com>
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf build: Override OUTPUT when building internal libraries
  2026-11-04 20:44 ` Arnaldo Carvalho de Melo
@ 2026-11-04 21:09   ` Dmitry Safonov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Safonov @ 2026-11-04 21:09 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: dima, Peter Zijlstra, Ingo Molnar, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	James Clark, Arnaldo Carvalho de Melo, linux-perf-users,
	linux-kernel

On Wed, 4 Nov 2026 at 20:44, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> On Tue, Nov 03, 2026 at 04:55:21PM +0000, Dmitry Safonov via B4 Relay wrote:
> > From: Dmitry Safonov <dima@arista.com>
> >
> > After commit 1572ba36fbca ("perf tests: Improvements to build-test
> > performance"), building perf with OUTPUT on the command line fails:
> >   make -C tools/perf OUTPUT=/tmp/linux/bld/perf/ ARCH=x86_64 LC_ALL=C CC=gcc HOSTCC=gcc LD=ld
>
> That '/bld/' is not reflected in the next line, copy'n'paste mistake?

It is, yes. The path in the build system is quite much longer, so I
decided to cut the noise and cut it in commit. But my eyes have
failed, and I should have re-checked it on the short path and copied
the output, really. Heh.

> >   ...
> >   make[3]: *** No rule to make target '/tmp/linux/perf/libsubcmd/libsubcmd.a'.  Stop.
>
> ⬢ [acme@toolbx perf-tools]$ mkdir -p /tmp/linux/perf
> ⬢ [acme@toolbx perf-tools]$ make -C tools/perf OUTPUT=/tmp/linux/perf/ ARCH=x86_64 LC_ALL=C CC=gcc HOSTCC=gcc LD=ld
> make: Entering directory '/home/acme/git/perf-tools/tools/perf'
>   BUILD:   Doing 'make -j32' parallel build
>   <SNIP>
>     TEST    /tmp/linux/perf/tests/shell/base_probe/test_line_semantics.sh.shellcheck_log
>   GEN     /tmp/linux/perf/arch/arm64/include/generated/asm/sysreg-defs.h
> make[3]: *** No rule to make target '/tmp/linux/perf/libsubcmd/libsubcmd.a'.  Stop.
> make[2]: *** [Makefile.perf:827: /tmp/linux/perf/libsubcmd/libsubcmd.a] Error 2
> make[2]: *** Waiting for unfinished jobs....
>   MKDIR   /tmp/linux/perf/tests/shell/lib/
>   TEST    /tmp/linux/perf/tests/shell/lib/perf_metric_validation.py.mypy_log
>   TEST    /tmp/linux/perf/tests/shell/lib/perf_json_output_lint.py.mypy_log
>   PERF_VERSION = 7.4.rc1.g45e09a6dbb2d
> make[3]: *** No rule to make target '/tmp/linux/perf/libsymbol/libsymbol.a'.  Stop.
> make[3]: *** No rule to make target '/tmp/linux/perf/libperf/libperf.a'.  Stop.
>
> Minor stuff, I'll fix it up and apply to perf-tools to send for 7.4-rc1,

Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-04 21:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-03 16:55 [PATCH] perf build: Override OUTPUT when building internal libraries Dmitry Safonov via B4 Relay
2026-11-03 17:01 ` sashiko-bot
2026-11-04 20:44 ` Arnaldo Carvalho de Melo
2026-11-04 21:09   ` Dmitry Safonov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox