[PATCH v2] perf build: Respect V=1 for Python extension builds

Jens Remus posted 1 patch 2 weeks, 4 days ago
tools/perf/Makefile.perf | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
[PATCH v2] perf build: Respect V=1 for Python extension builds
Posted by Jens Remus 2 weeks, 4 days ago
Make util/setup.py respect the verbose build flag (V=1) by conditionally
passing --quiet only when not in verbose mode.

This eases debugging of Python extension compilation issues and aligns
with the existing perf build system behavior.

Tested-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
---

Notes (jremus):
    This patch applies on top of the perf-tools-next tree:
    
      git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git  master
    
    Changes in v2:
    - Rebase on perf-tools-next tree. (Ian)
    - Use descriptive variable name python_setup_quiet. (Ian)

 tools/perf/Makefile.perf | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 76b35ac19acb..137fc4386625 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -401,6 +401,10 @@ export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
 
 python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT)python/perf*.so
 
+ifneq ($(quiet),)
+python_setup_quiet=--quiet
+endif
+
 # Use the detected configuration
 -include $(OUTPUT).config-detected
 
@@ -752,7 +756,7 @@ $(OUTPUT)python/perf$(PYTHON_EXTENSION_SUFFIX): util/python.c util/setup.py $(PE
 	$(QUIET_GEN)LDSHARED="$(CC) -pthread -shared" \
         CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS) $(LIBS_PY)' \
 	  $(PYTHON_WORD) util/setup.py \
-	  --quiet build_ext; \
+	  $(python_setup_quiet) build_ext; \
 	cp $(PYTHON_EXTBUILD_LIB)perf*.so $(OUTPUT)python/
 
 python_perf_target:
@@ -1158,7 +1162,7 @@ install-bin: install-tools install-tests
 install: install-bin try-install-man
 
 install-python_ext:
-	$(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
+	$(PYTHON_WORD) util/setup.py $(python_setup_quiet) install --root='/$(DESTDIR_SQ)'
 
 # 'make install-doc' should call 'make -C Documentation install'
 $(INSTALL_DOC_TARGETS):
-- 
2.53.0
Re: [PATCH v2] perf build: Respect V=1 for Python extension builds
Posted by Ian Rogers 2 weeks, 4 days ago
On Mon, Jun 8, 2026 at 9:06 AM Jens Remus <jremus@linux.ibm.com> wrote:
>
> Make util/setup.py respect the verbose build flag (V=1) by conditionally
> passing --quiet only when not in verbose mode.
>
> This eases debugging of Python extension compilation issues and aligns
> with the existing perf build system behavior.
>
> Tested-by: Jan Polensky <japo@linux.ibm.com>
> Signed-off-by: Jens Remus <jremus@linux.ibm.com>

Reviewed-by: Ian Rogers <irogers@google.com>

Thanks!
Ian

> ---
>
> Notes (jremus):
>     This patch applies on top of the perf-tools-next tree:
>
>       git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git  master
>
>     Changes in v2:
>     - Rebase on perf-tools-next tree. (Ian)
>     - Use descriptive variable name python_setup_quiet. (Ian)
>
>  tools/perf/Makefile.perf | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 76b35ac19acb..137fc4386625 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -401,6 +401,10 @@ export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
>
>  python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT)python/perf*.so
>
> +ifneq ($(quiet),)
> +python_setup_quiet=--quiet
> +endif
> +
>  # Use the detected configuration
>  -include $(OUTPUT).config-detected
>
> @@ -752,7 +756,7 @@ $(OUTPUT)python/perf$(PYTHON_EXTENSION_SUFFIX): util/python.c util/setup.py $(PE
>         $(QUIET_GEN)LDSHARED="$(CC) -pthread -shared" \
>          CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS) $(LIBS_PY)' \
>           $(PYTHON_WORD) util/setup.py \
> -         --quiet build_ext; \
> +         $(python_setup_quiet) build_ext; \
>         cp $(PYTHON_EXTBUILD_LIB)perf*.so $(OUTPUT)python/
>
>  python_perf_target:
> @@ -1158,7 +1162,7 @@ install-bin: install-tools install-tests
>  install: install-bin try-install-man
>
>  install-python_ext:
> -       $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
> +       $(PYTHON_WORD) util/setup.py $(python_setup_quiet) install --root='/$(DESTDIR_SQ)'
>
>  # 'make install-doc' should call 'make -C Documentation install'
>  $(INSTALL_DOC_TARGETS):
> --
> 2.53.0
>
Re: [PATCH v2] perf build: Respect V=1 for Python extension builds
Posted by Arnaldo Carvalho de Melo 2 weeks, 2 days ago
On Mon, Jun 08, 2026 at 09:15:36AM -0700, Ian Rogers wrote:
> On Mon, Jun 8, 2026 at 9:06 AM Jens Remus <jremus@linux.ibm.com> wrote:
> >
> > Make util/setup.py respect the verbose build flag (V=1) by conditionally
> > passing --quiet only when not in verbose mode.
> >
> > This eases debugging of Python extension compilation issues and aligns
> > with the existing perf build system behavior.
> >
> > Tested-by: Jan Polensky <japo@linux.ibm.com>
> > Signed-off-by: Jens Remus <jremus@linux.ibm.com>
> 
> Reviewed-by: Ian Rogers <irogers@google.com>

Thanks, applied to perf-tools-next, for v7.2.

- Arnaldo