tools: Unify top-level quiet infrastructure
Subsystems (12)
v3 cover tools: Unify top-level quiet infrastructure
The quiet infrastructure was moved out of Makefile.build to accomidate the new syscall table generation scripts in perf. Syscall table generation wanted to also be able to be quiet, so instead of again copying the code to set the quiet variables, the code was moved into Makefile.perf to be used globally. This was not the right solution. It should have been moved even further upwards in the call chain. Makefile.include is imported in many files so this seems like a proper place to put it.
To:
---
Changes in v3:
- Add back erroneously removed "silent=1" (Jiri)
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Fix spacing around Q= (Andrii)
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Charlie Jenkins (2):
tools: Unify top-level quiet infrastructure
tools: Remove redundant quiet setup
tools/arch/arm64/tools/Makefile | 6 ----- tools/bpf/Makefile | 6 ----- tools/bpf/bpftool/Documentation/Makefile | 6 ----- tools/bpf/bpftool/Makefile | 6 ----- tools/bpf/resolve_btfids/Makefile | 2 -- tools/bpf/runqslower/Makefile | 5 +--- tools/build/Makefile | 8 +----- tools/lib/bpf/Makefile | 13 ---------- tools/lib/perf/Makefile | 13 ---------- tools/lib/thermal/Makefile | 13 ---------- tools/objtool/Makefile | 6 ----- tools/perf/Makefile.perf | 41 ------------------------------- tools/scripts/Makefile.include | 30 ++++++++++++++++++++++ tools/testing/selftests/bpf/Makefile.docs | 6 ----- tools/testing/selftests/hid/Makefile | 2 -- tools/thermal/lib/Makefile | 13 ---------- tools/tracing/latency/Makefile | 6 ----- tools/tracing/rtla/Makefile | 6 ----- tools/verification/rv/Makefile | 6 ----- 19 files changed, 32 insertions(+), 162 deletions(-)
---
base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
change-id: 20250203-quiet_tools-9a6ea9d65a19
Signature · 1 line
- Charlie
PATCH v3 1/2 tools: Unify top-level quiet infrastructure
Commit f2868b1a66d4 ("perf tools: Expose quiet/verbose variables in Makefile.perf") moved the quiet infrastructure out of tools/build/Makefile.build and into the top-level Makefile.perf file so that the quiet infrastructure could be used throughout perf and not just in Makefile.build.
Extract out the quiet infrastructure into Makefile.include so that it can be leveraged outside of perf.
--- tools/build/Makefile | 8 +------- tools/perf/Makefile.perf | 41 ----------------------------------------- tools/scripts/Makefile.include | 30 ++++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 48 deletions(-)
tools/build/Makefile +1 -7
@@ -17,13 +17,7 @@ $(call allow-override,LD,$(CROSS_COMPILE)ld) export HOSTCC HOSTLD HOSTAR -ifeq ($(V),1) - Q = -else - Q = @ -endif - -export Q srctree CC LD +export srctree CC LD MAKEFLAGS := --no-print-directory build := -f $(srctree)/tools/build/Makefile.build dir=. obj
tools/perf/Makefile.perf +0 -41
47 lines not on this page · raw message
tools/scripts/Makefile.include +30 -0
@@ -136,6 +136,33 @@ else NO_SUBDIR = : endif +# Beautify output +# --------------------------------------------------------------------------- +# +# Most of build commands in Kbuild start with "cmd_". You can optionally define +# "quiet_cmd_*". If defined, the short log is printed. Otherwise, no log from +# that command is printed by default. +# +# e.g.) +# quiet_cmd_depmod = DEPMOD $(MODLIB) +# cmd_depmod = $(srctree)/scripts/depmod.sh $(DEPMOD) $(KERNELRELEASE) +# +# A simple variant is to prefix commands with $(Q) - that's useful +# for commands that shall be hidden in non-verbose mode. +# +# $(Q)$(MAKE) $(build)=scripts/basic +# +# To put more focus on warnings, be less verbose as default +# Use 'make V=1' to see the full commands + +ifeq ($(V),1) + quiet = + Q = +else + quiet = quiet_ + Q = @ +endif + # If the user is running make -s (silent mode), suppress echoing of commands # make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS. ifeq ($(filter 3.%,$(MAKE_VERSION)),)
@@ -146,8 +173,11 @@ endif ifneq ($(findstring s,$(short-opts)),) silent=1 + quiet=silent_ endif +export quiet Q + # # Define a callable command for descending to a new directory #
Signature · 1 line
2.43.0
PATCH v3 2/2 tools: Remove redundant quiet setup
In reply to Charlie JenkinsQ is exported from Makefile.include so it is not necessary to manually set it.
--- tools/arch/arm64/tools/Makefile | 6 ------ tools/bpf/Makefile | 6 ------ tools/bpf/bpftool/Documentation/Makefile | 6 ------ tools/bpf/bpftool/Makefile | 6 ------ tools/bpf/resolve_btfids/Makefile | 2 -- tools/bpf/runqslower/Makefile | 5 +---- tools/lib/bpf/Makefile | 13 ------------- tools/lib/perf/Makefile | 13 ------------- tools/lib/thermal/Makefile | 13 ------------- tools/objtool/Makefile | 6 ------ tools/testing/selftests/bpf/Makefile.docs | 6 ------ tools/testing/selftests/hid/Makefile | 2 -- tools/thermal/lib/Makefile | 13 ------------- tools/tracing/latency/Makefile | 6 ------ tools/tracing/rtla/Makefile | 6 ------ tools/verification/rv/Makefile | 6 ------ 16 files changed, 1 insertion(+), 114 deletions(-)
tools/arch/arm64/tools/Makefile +0 -6
@@ -13,12 +13,6 @@ AWK ?= awk MKDIR ?= mkdir RM ?= rm -ifeq ($(V),1) -Q = -else -Q = @ -endif - arm64_tools_dir = $(top_srcdir)/arch/arm64/tools arm64_sysreg_tbl = $(arm64_tools_dir)/sysreg arm64_gen_sysreg = $(arm64_tools_dir)/gen-sysreg.awk
tools/bpf/Makefile +0 -6
@@ -27,12 +27,6 @@ srctree := $(patsubst %/,%,$(dir $(CURDIR))) srctree := $(patsubst %/,%,$(dir $(srctree))) endif -ifeq ($(V),1) - Q = -else - Q = @ -endif - FEATURE_USER = .bpf FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled FEATURE_DISPLAY = libbfd
tools/bpf/bpftool/Documentation/Makefile +0 -6
@@ -5,12 +5,6 @@ INSTALL ?= install RM ?= rm -f RMDIR ?= rmdir --ignore-fail-on-non-empty -ifeq ($(V),1) - Q = -else - Q = @ -endif - prefix ?= /usr/local mandir ?= $(prefix)/man man8dir = $(mandir)/man8
tools/bpf/bpftool/Makefile +0 -6
@@ -7,12 +7,6 @@ srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree))) endif -ifeq ($(V),1) - Q = -else - Q = @ -endif - BPF_DIR = $(srctree)/tools/lib/bpf ifneq ($(OUTPUT),)
tools/bpf/resolve_btfids/Makefile +0 -2
@@ -5,10 +5,8 @@ include ../../scripts/Makefile.arch srctree := $(abspath $(CURDIR)/../../../) ifeq ($(V),1) - Q = msg = else - Q = @ ifeq ($(silent),1) msg = else
tools/bpf/runqslower/Makefile +1 -4
@@ -26,10 +26,7 @@ VMLINUX_BTF_PATHS := $(if $(O),$(O)/vmlinux) \ VMLINUX_BTF_PATH := $(or $(VMLINUX_BTF),$(firstword \ $(wildcard $(VMLINUX_BTF_PATHS)))) -ifeq ($(V),1) -Q = -else -Q = @ +ifneq ($(V),1) MAKEFLAGS += --no-print-directory submake_extras := feature_display=0 endif
tools/lib/bpf/Makefile +0 -13
@@ -53,13 +53,6 @@ include $(srctree)/tools/scripts/Makefile.include # copy a bit from Linux kbuild -ifeq ("$(origin V)", "command line") - VERBOSE = $(V) -endif -ifndef VERBOSE - VERBOSE = 0 -endif - INCLUDES = -I$(or $(OUTPUT),.) \ -I$(srctree)/tools/include -I$(srctree)/tools/include/uapi \ -I$(srctree)/tools/arch/$(SRCARCH)/include
@@ -96,12 +89,6 @@ override CFLAGS += $(CLANG_CROSS_FLAGS) # flags specific for shared library SHLIB_FLAGS := -DSHARED -fPIC -ifeq ($(VERBOSE),1) - Q = -else - Q = @ -endif - # Disable command line variables (CFLAGS) override from top # level Makefile (perf), otherwise build Makefile will get # the same command line setup.
tools/lib/perf/Makefile +0 -13
@@ -39,19 +39,6 @@ libdir = $(prefix)/$(libdir_relative) libdir_SQ = $(subst ','\'',$(libdir)) libdir_relative_SQ = $(subst ','\'',$(libdir_relative)) -ifeq ("$(origin V)", "command line") - VERBOSE = $(V) -endif -ifndef VERBOSE - VERBOSE = 0 -endif - -ifeq ($(VERBOSE),1) - Q = -else - Q = @ -endif - TEST_ARGS := $(if $(V),-v) # Set compile option CFLAGS
tools/lib/thermal/Makefile +0 -13
@@ -39,19 +39,6 @@ libdir = $(prefix)/$(libdir_relative) libdir_SQ = $(subst ','\'',$(libdir)) libdir_relative_SQ = $(subst ','\'',$(libdir_relative)) -ifeq ("$(origin V)", "command line") - VERBOSE = $(V) -endif -ifndef VERBOSE - VERBOSE = 0 -endif - -ifeq ($(VERBOSE),1) - Q = -else - Q = @ -endif - # Set compile option CFLAGS ifdef EXTRA_CFLAGS CFLAGS := $(EXTRA_CFLAGS)
tools/objtool/Makefile +0 -6
@@ -46,12 +46,6 @@ HOST_OVERRIDES := CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)" AWK = awk MKDIR = mkdir -ifeq ($(V),1) - Q = -else - Q = @ -endif - BUILD_ORC := n ifeq ($(SRCARCH),x86)
tools/testing/selftests/bpf/Makefile.docs +0 -6
@@ -7,12 +7,6 @@ INSTALL ?= install RM ?= rm -f RMDIR ?= rmdir --ignore-fail-on-non-empty -ifeq ($(V),1) - Q = -else - Q = @ -endif - prefix ?= /usr/local mandir ?= $(prefix)/man man2dir = $(mandir)/man2
tools/testing/selftests/hid/Makefile +0 -2
@@ -43,10 +43,8 @@ TEST_GEN_PROGS = hid_bpf hidraw # $3 - target (assumed to be file); only file name will be emitted; # $4 - optional extra arg, emitted as-is, if provided. ifeq ($(V),1) -Q = msg = else -Q = @ msg = @printf ' %-8s%s %s%s\n' "$(1)" "$(if $(2), [$(2)])" "$(notdir $(3))" "$(if $(4), $(4))"; MAKEFLAGS += --no-print-directory submake_extras := feature_display=0
tools/thermal/lib/Makefile +0 -13
@@ -39,19 +39,6 @@ libdir = $(prefix)/$(libdir_relative) libdir_SQ = $(subst ','\'',$(libdir)) libdir_relative_SQ = $(subst ','\'',$(libdir_relative)) -ifeq ("$(origin V)", "command line") - VERBOSE = $(V) -endif -ifndef VERBOSE - VERBOSE = 0 -endif - -ifeq ($(VERBOSE),1) - Q = -else - Q = @ -endif - # Set compile option CFLAGS ifdef EXTRA_CFLAGS CFLAGS := $(EXTRA_CFLAGS)
tools/tracing/latency/Makefile +0 -6
@@ -37,12 +37,6 @@ FEATURE_TESTS += libtracefs FEATURE_DISPLAY := libtraceevent FEATURE_DISPLAY += libtracefs -ifeq ($(V),1) - Q = -else - Q = @ -endif - all: $(LATENCY-COLLECTOR) include $(srctree)/tools/build/Makefile.include
tools/tracing/rtla/Makefile +0 -6
@@ -37,12 +37,6 @@ FEATURE_DISPLAY := libtraceevent FEATURE_DISPLAY += libtracefs FEATURE_DISPLAY += libcpupower -ifeq ($(V),1) - Q = -else - Q = @ -endif - all: $(RTLA) include $(srctree)/tools/build/Makefile.include
tools/verification/rv/Makefile +0 -6
@@ -35,12 +35,6 @@ FEATURE_TESTS += libtracefs FEATURE_DISPLAY := libtraceevent FEATURE_DISPLAY += libtracefs -ifeq ($(V),1) - Q = -else - Q = @ -endif - all: $(RV) include $(srctree)/tools/build/Makefile.include
Signature · 1 line
2.43.0
Re: [PATCH v3 2/2] tools: Remove redundant quiet setup
Quoted 42 lines · On Thu, 13 Feb 2025 13:06:22 -0800 Charlie Jenkins <[email protected]> wrote:
tools/tracing/latency/Makefile +0
-6@@ -37,12 +37,6 @@ FEATURE_TESTS += libtracefs FEATURE_DISPLAY := libtraceevent FEATURE_DISPLAY += libtracefs -ifeq ($(V),1) - Q = -else - Q = @ -endif - all: $(LATENCY-COLLECTOR) include $(srctree)/tools/build/Makefile.includetools/tracing/rtla/Makefile +0
-6@@ -37,12 +37,6 @@ FEATURE_DISPLAY := libtraceevent FEATURE_DISPLAY += libtracefs FEATURE_DISPLAY += libcpupower -ifeq ($(V),1) - Q = -else - Q = @ -endif - all: $(RTLA) include $(srctree)/tools/build/Makefile.includetools/verification/rv/Makefile +0
-0@@ -35,12 +35,6 @@ FEATURE_TESTS += libtracefs FEATURE_DISPLAY := libtraceevent FEATURE_DISPLAY += libtracefs
tools/verification/rv/Makefile FEATURE_TESTS += libtracefs · line 40
Quoted 10 lines
tools/verification/rv/Makefile +0
-6-ifeq ($(V),1) - Q = -else - Q = @ -endif - all: $(RV) include $(srctree)/tools/build/Makefile.include
-- Steve
Quoted 9 lines · Charlie Jenkins
The quiet infrastructure was moved out of Makefile.build to accomidate the new syscall table generation scripts in perf. Syscall table generation wanted to also be able to be quiet, so instead of again copying the code to set the quiet variables, the code was moved into Makefile.perf to be used globally. This was not the right solution. It should have been moved even further upwards in the call chain. Makefile.include is imported in many files so this seems like a proper place to put it.
Quoted 7 lines
To:
Signed-off-by Charlie Jenkins <[email protected]>---
Changes in v3:
- Add back erroneously removed "silent=1" (Jiri)
- Link to v2: https://lore.kernel.org/r/[email protected]
thanks,
jirka
Quoted 36 lines
Changes in v2:
- Fix spacing around Q= (Andrii)
- Link to v1: https://lore.kernel.org/r/[email protected]---
Charlie Jenkins (2):
tools: Unify top-level quiet infrastructure
tools: Remove redundant quiet setuptools/arch/arm64/tools/Makefile | 6 ----- tools/bpf/Makefile | 6 ----- tools/bpf/bpftool/Documentation/Makefile | 6 ----- tools/bpf/bpftool/Makefile | 6 ----- tools/bpf/resolve_btfids/Makefile | 2 -- tools/bpf/runqslower/Makefile | 5 +--- tools/build/Makefile | 8 +----- tools/lib/bpf/Makefile | 13 ---------- tools/lib/perf/Makefile | 13 ---------- tools/lib/thermal/Makefile | 13 ---------- tools/objtool/Makefile | 6 ----- tools/perf/Makefile.perf | 41 ------------------------------- tools/scripts/Makefile.include | 30 ++++++++++++++++++++++ tools/testing/selftests/bpf/Makefile.docs | 6 ----- tools/testing/selftests/hid/Makefile | 2 -- tools/thermal/lib/Makefile | 13 ---------- tools/tracing/latency/Makefile | 6 ----- tools/tracing/rtla/Makefile | 6 ----- tools/verification/rv/Makefile | 6 ----- 19 files changed, 32 insertions(+), 162 deletions(-)---
base-commit:2014c95afecee3e76ca4a56956a936e23283f05b
change-id: 20250203-quiet_tools-9a6ea9d65a19Signature · 1 line
- Charlie