提交 b3b64a12 编写于 作者: I Ingo Molnar

tools/perf/build: Improve printout-of auto-detected features

Change the print-out of auto-detected features by making sure that
repeat invocations of 'make' when all features are successfully
detected do not produce the (rather lengthy) autodetection printout.

( When one or more features are missing then we still print out the
  feature detection table, to make sure people are aware of the
  resulting limitations. )

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/n/tip-qd8sMsshcjomxqx9bQcufmaa@git.kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 f1138ec6
...@@ -102,8 +102,6 @@ endef ...@@ -102,8 +102,6 @@ endef
# #
# Build the feature check binaries in parallel, ignore errors, ignore return value and suppress output: # Build the feature check binaries in parallel, ignore errors, ignore return value and suppress output:
# #
$(info )
$(info Auto-detecting system features:)
# #
# Note that this is not a complete list of all feature tests, just # Note that this is not a complete list of all feature tests, just
...@@ -136,10 +134,34 @@ CORE_FEATURE_TESTS = \ ...@@ -136,10 +134,34 @@ CORE_FEATURE_TESTS = \
stackprotector-all \ stackprotector-all \
volatile-register-var volatile-register-var
#
# So here we detect whether test-all was rebuilt, to be able
# to skip the print-out of the long features list if the file
# existed before and after it was built:
#
ifeq ($(wildcard config/feature-checks/test-all),)
test-all-failed := 1
else
test-all-failed := 0
endif
# #
# Special fast-path for the 'all features are available' case: # Special fast-path for the 'all features are available' case:
# #
$(call feature_check,all) $(call feature_check,all,$(MSG))
#
# Just in case the build freshly failed, make sure we print the
# feature matrix:
#
ifeq ($(feature-all), 0)
test-all-failed := 1
endif
ifeq ($(test-all-failed),1)
$(info )
$(info Auto-detecting system features:)
endif
ifeq ($(feature-all), 1) ifeq ($(feature-all), 1)
# #
...@@ -151,11 +173,10 @@ else ...@@ -151,11 +173,10 @@ else
$(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_check,$(feat))) $(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_check,$(feat)))
endif endif
feature_print = $(eval $(feature_print_code))
# #
# Print the result of the feature test: # Print the result of the feature test:
# #
feature_print = $(eval $(feature_print_code))
define feature_print_code define feature_print_code
ifeq ($(feature-$(1)), 1) ifeq ($(feature-$(1)), 1)
MSG := $(shell printf '...%30s: [ \033[32mon\033[m ]' $(1)) MSG := $(shell printf '...%30s: [ \033[32mon\033[m ]' $(1))
...@@ -165,10 +186,13 @@ define feature_print_code ...@@ -165,10 +186,13 @@ define feature_print_code
$(info $(MSG)) $(info $(MSG))
endef endef
$(foreach feat,$(CORE_FEATURE_TESTS) DUMMY,$(call feature_print,$(feat))) #
# Only print out our features if we rebuilt the testcases or if a test failed:
# newline at the end of the feature printouts: #
$(info ) ifeq ($(test-all-failed), 1)
$(foreach feat,$(CORE_FEATURE_TESTS) DUMMY,$(call feature_print,$(feat)))
$(info )
endif
ifeq ($(feature-stackprotector-all), 1) ifeq ($(feature-stackprotector-all), 1)
CFLAGS += -fstack-protector-all CFLAGS += -fstack-protector-all
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册