aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2013-10-02 03:54:43 -0400
committerIngo Molnar <mingo@kernel.org>2013-10-09 02:48:53 -0400
commitf1138ec66e839ce90c58af0c264db33271d73466 (patch)
tree684820b98aa66aea8f02aa0b0c8be1abb4f0152f /tools/perf
parentde0f03fb8dc268de63d366e735cc576a22df201b (diff)
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.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/config/Makefile49
-rw-r--r--tools/perf/config/feature-checks/Makefile31
2 files changed, 45 insertions, 35 deletions
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index cbd7cdca3e56..581a94211fea 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -105,30 +105,36 @@ endef
105$(info ) 105$(info )
106$(info Auto-detecting system features:) 106$(info Auto-detecting system features:)
107 107
108FEATURE_TESTS = \ 108#
109 hello \ 109# Note that this is not a complete list of all feature tests, just
110 stackprotector-all \ 110# those that are typically built on a fully configured system.
111 stackprotector \ 111#
112 volatile-register-var \ 112# [ Feature tests not mentioned here have to be built explicitly in
113# the rule that uses them - an example for that is the 'bionic'
114# feature check. ]
115#
116CORE_FEATURE_TESTS = \
117 backtrace \
118 dwarf \
113 fortify-source \ 119 fortify-source \
114 bionic \
115 libelf \
116 glibc \ 120 glibc \
117 dwarf \
118 libelf-mmap \
119 libelf-getphdrnum \
120 libunwind \
121 libaudit \
122 libslang \
123 gtk2 \ 121 gtk2 \
124 gtk2-infobar \ 122 gtk2-infobar \
123 libaudit \
124 libbfd \
125 libelf \
126 libelf-getphdrnum \
127 libelf-mmap \
128 libnuma \
125 libperl \ 129 libperl \
126 libpython \ 130 libpython \
127 libpython-version \ 131 libpython-version \
128 libbfd \ 132 libslang \
133 libunwind \
129 on-exit \ 134 on-exit \
130 backtrace \ 135 stackprotector \
131 libnuma 136 stackprotector-all \
137 volatile-register-var
132 138
133# 139#
134# Special fast-path for the 'all features are available' case: 140# Special fast-path for the 'all features are available' case:
@@ -136,10 +142,13 @@ FEATURE_TESTS = \
136$(call feature_check,all) 142$(call feature_check,all)
137 143
138ifeq ($(feature-all), 1) 144ifeq ($(feature-all), 1)
139 $(foreach feat,$(FEATURE_TESTS),$(call feature_set,$(feat))) 145 #
146 # test-all.c passed - just set all the core feature flags to 1:
147 #
148 $(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_set,$(feat)))
140else 149else
141 $(shell $(MAKE) -i -j -C config/feature-checks >/dev/null 2>&1) 150 $(shell $(MAKE) -i -j -C config/feature-checks $(CORE_FEATURE_TESTS) >/dev/null 2>&1)
142 $(foreach feat,$(FEATURE_TESTS),$(call feature_check,$(feat))) 151 $(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_check,$(feat)))
143endif 152endif
144 153
145feature_print = $(eval $(feature_print_code)) 154feature_print = $(eval $(feature_print_code))
@@ -156,7 +165,7 @@ define feature_print_code
156 $(info $(MSG)) 165 $(info $(MSG))
157endef 166endef
158 167
159$(foreach feat,$(FEATURE_TESTS) DUMMY,$(call feature_print,$(feat))) 168$(foreach feat,$(CORE_FEATURE_TESTS) DUMMY,$(call feature_print,$(feat)))
160 169
161# newline at the end of the feature printouts: 170# newline at the end of the feature printouts:
162$(info ) 171$(info )
diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile
index 4b855e0ccd0b..d4c55acc82bb 100644
--- a/tools/perf/config/feature-checks/Makefile
+++ b/tools/perf/config/feature-checks/Makefile
@@ -1,28 +1,29 @@
1 1
2FILES= \ 2FILES= \
3 test-hello \ 3 test-all \
4 test-stackprotector-all \ 4 test-backtrace \
5 test-stackprotector \
6 test-volatile-register-var \
7 test-fortify-source \
8 test-bionic \ 5 test-bionic \
9 test-libelf \
10 test-glibc \
11 test-dwarf \ 6 test-dwarf \
12 test-libelf-mmap \ 7 test-fortify-source \
13 test-libelf-getphdrnum \ 8 test-glibc \
14 test-libunwind \
15 test-libaudit \
16 test-libslang \
17 test-gtk2 \ 9 test-gtk2 \
18 test-gtk2-infobar \ 10 test-gtk2-infobar \
11 test-hello \
12 test-libaudit \
13 test-libbfd \
14 test-libelf \
15 test-libelf-getphdrnum \
16 test-libelf-mmap \
17 test-libnuma \
19 test-libperl \ 18 test-libperl \
20 test-libpython \ 19 test-libpython \
21 test-libpython-version \ 20 test-libpython-version \
22 test-libbfd \ 21 test-libslang \
22 test-libunwind \
23 test-on-exit \ 23 test-on-exit \
24 test-backtrace \ 24 test-stackprotector-all \
25 test-libnuma 25 test-stackprotector \
26 test-volatile-register-var
26 27
27CC := $(CC) -MD 28CC := $(CC) -MD
28 29