Commit f1138ec6 authored by Ingo Molnar's avatar Ingo Molnar

tools/perf/build: Speed up auto-detection

The detection of certain rarely detected features can be delayed
to when they are actually needed.

So speed up the common case of auto-detection by pre-building only
a core set of features and populating only their feature-flags.

[ Features not listed in CORE_FEATURES need to built explicitly
  via the feature_check() function. ]

(Also order the feature names alphabetically, while at it.)

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-xQkuveknd0gqla1dfxrqKpkl@git.kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent de0f03fb
...@@ -105,30 +105,36 @@ endef ...@@ -105,30 +105,36 @@ endef
$(info ) $(info )
$(info Auto-detecting system features:) $(info Auto-detecting system features:)
FEATURE_TESTS = \ #
hello \ # Note that this is not a complete list of all feature tests, just
stackprotector-all \ # those that are typically built on a fully configured system.
stackprotector \ #
volatile-register-var \ # [ Feature tests not mentioned here have to be built explicitly in
# the rule that uses them - an example for that is the 'bionic'
# feature check. ]
#
CORE_FEATURE_TESTS = \
backtrace \
dwarf \
fortify-source \ fortify-source \
bionic \
libelf \
glibc \ glibc \
dwarf \
libelf-mmap \
libelf-getphdrnum \
libunwind \
libaudit \
libslang \
gtk2 \ gtk2 \
gtk2-infobar \ gtk2-infobar \
libaudit \
libbfd \
libelf \
libelf-getphdrnum \
libelf-mmap \
libnuma \
libperl \ libperl \
libpython \ libpython \
libpython-version \ libpython-version \
libbfd \ libslang \
libunwind \
on-exit \ on-exit \
backtrace \ stackprotector \
libnuma stackprotector-all \
volatile-register-var
# #
# Special fast-path for the 'all features are available' case: # Special fast-path for the 'all features are available' case:
...@@ -136,10 +142,13 @@ FEATURE_TESTS = \ ...@@ -136,10 +142,13 @@ FEATURE_TESTS = \
$(call feature_check,all) $(call feature_check,all)
ifeq ($(feature-all), 1) ifeq ($(feature-all), 1)
$(foreach feat,$(FEATURE_TESTS),$(call feature_set,$(feat))) #
# test-all.c passed - just set all the core feature flags to 1:
#
$(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_set,$(feat)))
else else
$(shell $(MAKE) -i -j -C config/feature-checks >/dev/null 2>&1) $(shell $(MAKE) -i -j -C config/feature-checks $(CORE_FEATURE_TESTS) >/dev/null 2>&1)
$(foreach feat,$(FEATURE_TESTS),$(call feature_check,$(feat))) $(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_check,$(feat)))
endif endif
feature_print = $(eval $(feature_print_code)) feature_print = $(eval $(feature_print_code))
...@@ -156,7 +165,7 @@ define feature_print_code ...@@ -156,7 +165,7 @@ define feature_print_code
$(info $(MSG)) $(info $(MSG))
endef endef
$(foreach feat,$(FEATURE_TESTS) DUMMY,$(call feature_print,$(feat))) $(foreach feat,$(CORE_FEATURE_TESTS) DUMMY,$(call feature_print,$(feat)))
# newline at the end of the feature printouts: # newline at the end of the feature printouts:
$(info ) $(info )
......
FILES= \ FILES= \
test-hello \ test-all \
test-stackprotector-all \ test-backtrace \
test-stackprotector \
test-volatile-register-var \
test-fortify-source \
test-bionic \ test-bionic \
test-libelf \
test-glibc \
test-dwarf \ test-dwarf \
test-libelf-mmap \ test-fortify-source \
test-libelf-getphdrnum \ test-glibc \
test-libunwind \
test-libaudit \
test-libslang \
test-gtk2 \ test-gtk2 \
test-gtk2-infobar \ test-gtk2-infobar \
test-hello \
test-libaudit \
test-libbfd \
test-libelf \
test-libelf-getphdrnum \
test-libelf-mmap \
test-libnuma \
test-libperl \ test-libperl \
test-libpython \ test-libpython \
test-libpython-version \ test-libpython-version \
test-libbfd \ test-libslang \
test-libunwind \
test-on-exit \ test-on-exit \
test-backtrace \ test-stackprotector-all \
test-libnuma test-stackprotector \
test-volatile-register-var
CC := $(CC) -MD CC := $(CC) -MD
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment