Skip to content

Commit 293f324

Browse files
charlie-rivosacmel
authored andcommitted
tools: Unify top-level quiet infrastructure
Commit f2868b1 ("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. Fixes: f2868b1 ("perf tools: Expose quiet/verbose variables in Makefile.perf") Reviewed-by: Jiri Olsa <[email protected]> Signed-off-by: Charlie Jenkins <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Benjamin Tissoires <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: Eduard Zingerman <[email protected]> Cc: Hao Luo <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: John Fastabend <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: KP Singh <[email protected]> Cc: Lukasz Luba <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Martin KaFai Lau <[email protected]> Cc: Mykola Lysenko <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Quentin Monnet <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Song Liu <[email protected]> Cc: Stanislav Fomichev <[email protected]> Cc: Steven Rostedt (VMware) <[email protected]> Cc: Yonghong Song <[email protected]> Cc: Zhang Rui <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 9fae588 commit 293f324

File tree

3 files changed

+31
-48
lines changed

3 files changed

+31
-48
lines changed

tools/build/Makefile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@ $(call allow-override,LD,$(CROSS_COMPILE)ld)
1717

1818
export HOSTCC HOSTLD HOSTAR
1919

20-
ifeq ($(V),1)
21-
Q =
22-
else
23-
Q = @
24-
endif
25-
26-
export Q srctree CC LD
20+
export srctree CC LD
2721

2822
MAKEFLAGS := --no-print-directory
2923
build := -f $(srctree)/tools/build/Makefile.build dir=. obj

tools/perf/Makefile.perf

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -161,47 +161,6 @@ export VPATH
161161
SOURCE := $(shell ln -sf $(srctree)/tools/perf $(OUTPUT)/source)
162162
endif
163163

164-
# Beautify output
165-
# ---------------------------------------------------------------------------
166-
#
167-
# Most of build commands in Kbuild start with "cmd_". You can optionally define
168-
# "quiet_cmd_*". If defined, the short log is printed. Otherwise, no log from
169-
# that command is printed by default.
170-
#
171-
# e.g.)
172-
# quiet_cmd_depmod = DEPMOD $(MODLIB)
173-
# cmd_depmod = $(srctree)/scripts/depmod.sh $(DEPMOD) $(KERNELRELEASE)
174-
#
175-
# A simple variant is to prefix commands with $(Q) - that's useful
176-
# for commands that shall be hidden in non-verbose mode.
177-
#
178-
# $(Q)$(MAKE) $(build)=scripts/basic
179-
#
180-
# To put more focus on warnings, be less verbose as default
181-
# Use 'make V=1' to see the full commands
182-
183-
ifeq ($(V),1)
184-
quiet =
185-
Q =
186-
else
187-
quiet=quiet_
188-
Q=@
189-
endif
190-
191-
# If the user is running make -s (silent mode), suppress echoing of commands
192-
# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS.
193-
ifeq ($(filter 3.%,$(MAKE_VERSION)),)
194-
short-opts := $(firstword -$(MAKEFLAGS))
195-
else
196-
short-opts := $(filter-out --%,$(MAKEFLAGS))
197-
endif
198-
199-
ifneq ($(findstring s,$(short-opts)),)
200-
quiet=silent_
201-
endif
202-
203-
export quiet Q
204-
205164
# Do not use make's built-in rules
206165
# (this improves performance and avoids hard-to-debug behaviour);
207166
MAKEFLAGS += -r

tools/scripts/Makefile.include

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,33 @@ else
136136
NO_SUBDIR = :
137137
endif
138138

139+
# Beautify output
140+
# ---------------------------------------------------------------------------
141+
#
142+
# Most of build commands in Kbuild start with "cmd_". You can optionally define
143+
# "quiet_cmd_*". If defined, the short log is printed. Otherwise, no log from
144+
# that command is printed by default.
145+
#
146+
# e.g.)
147+
# quiet_cmd_depmod = DEPMOD $(MODLIB)
148+
# cmd_depmod = $(srctree)/scripts/depmod.sh $(DEPMOD) $(KERNELRELEASE)
149+
#
150+
# A simple variant is to prefix commands with $(Q) - that's useful
151+
# for commands that shall be hidden in non-verbose mode.
152+
#
153+
# $(Q)$(MAKE) $(build)=scripts/basic
154+
#
155+
# To put more focus on warnings, be less verbose as default
156+
# Use 'make V=1' to see the full commands
157+
158+
ifeq ($(V),1)
159+
quiet =
160+
Q =
161+
else
162+
quiet = quiet_
163+
Q = @
164+
endif
165+
139166
# If the user is running make -s (silent mode), suppress echoing of commands
140167
# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS.
141168
ifeq ($(filter 3.%,$(MAKE_VERSION)),)
@@ -146,8 +173,11 @@ endif
146173

147174
ifneq ($(findstring s,$(short-opts)),)
148175
silent=1
176+
quiet=silent_
149177
endif
150178

179+
export quiet Q
180+
151181
#
152182
# Define a callable command for descending to a new directory
153183
#

0 commit comments

Comments
 (0)