diff options
author | Wang Nan <wangnan0@huawei.com> | 2016-01-14 23:00:15 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-01-15 14:31:59 -0500 |
commit | 68824de19a0b4cdc17193cb004c55d82c06af8bd (patch) | |
tree | de5ffd246780bf40456e53259bfd6a70345dcf84 /tools | |
parent | eb807730c034090599135bc03578015ebf8974af (diff) |
perf build: Test correct path of perf in build-test
If an 'O' is passed to 'make build-test', many 'test -x' and 'test -f'
will fail because perf resides in a different directory. Fix this by
computing PERF_OUT according to 'O' and test correct output files.
For make_kernelsrc and make_kernelsrc_tools, set KBUILD_OUTPUT_DIR
instead because the path is different from others ($(O)/perf vs
$(O)/tools/perf).
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1452830421-77757-4-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/tests/make | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/tools/perf/tests/make b/tools/perf/tests/make index fc2a9a31113f..29810cf2c117 100644 --- a/tools/perf/tests/make +++ b/tools/perf/tests/make | |||
@@ -13,10 +13,12 @@ else | |||
13 | endif | 13 | endif |
14 | else | 14 | else |
15 | PERF := . | 15 | PERF := . |
16 | PERF_O := $(PERF) | ||
16 | O_OPT := | 17 | O_OPT := |
17 | 18 | ||
18 | ifneq ($(O),) | 19 | ifneq ($(O),) |
19 | FULL_O := $(shell readlink -f $(O) || echo $(O)) | 20 | FULL_O := $(shell readlink -f $(O) || echo $(O)) |
21 | PERF_O := $(FULL_O) | ||
20 | ifeq ($(SET_O),1) | 22 | ifeq ($(SET_O),1) |
21 | O_OPT := 'O=$(FULL_O)' | 23 | O_OPT := 'O=$(FULL_O)' |
22 | endif | 24 | endif |
@@ -173,11 +175,11 @@ test_make_doc := $(test_ok) | |||
173 | test_make_help_O := $(test_ok) | 175 | test_make_help_O := $(test_ok) |
174 | test_make_doc_O := $(test_ok) | 176 | test_make_doc_O := $(test_ok) |
175 | 177 | ||
176 | test_make_python_perf_so := test -f $(PERF)/python/perf.so | 178 | test_make_python_perf_so := test -f $(PERF_O)/python/perf.so |
177 | 179 | ||
178 | test_make_perf_o := test -f $(PERF)/perf.o | 180 | test_make_perf_o := test -f $(PERF_O)/perf.o |
179 | test_make_util_map_o := test -f $(PERF)/util/map.o | 181 | test_make_util_map_o := test -f $(PERF_O)/util/map.o |
180 | test_make_util_pmu_bison_o := test -f $(PERF)/util/pmu-bison.o | 182 | test_make_util_pmu_bison_o := test -f $(PERF_O)/util/pmu-bison.o |
181 | 183 | ||
182 | define test_dest_files | 184 | define test_dest_files |
183 | for file in $(1); do \ | 185 | for file in $(1); do \ |
@@ -244,7 +246,7 @@ test_make_perf_o_O := test -f $$TMP_O/perf.o | |||
244 | test_make_util_map_o_O := test -f $$TMP_O/util/map.o | 246 | test_make_util_map_o_O := test -f $$TMP_O/util/map.o |
245 | test_make_util_pmu_bison_o_O := test -f $$TMP_O/util/pmu-bison.o | 247 | test_make_util_pmu_bison_o_O := test -f $$TMP_O/util/pmu-bison.o |
246 | 248 | ||
247 | test_default = test -x $(PERF)/perf | 249 | test_default = test -x $(PERF_O)/perf |
248 | test = $(if $(test_$1),$(test_$1),$(test_default)) | 250 | test = $(if $(test_$1),$(test_$1),$(test_default)) |
249 | 251 | ||
250 | test_default_O = test -x $$TMP_O/perf | 252 | test_default_O = test -x $$TMP_O/perf |
@@ -293,17 +295,22 @@ tarpkg: | |||
293 | ( eval $$cmd ) >> $@ 2>&1 && \ | 295 | ( eval $$cmd ) >> $@ 2>&1 && \ |
294 | rm -f $@ | 296 | rm -f $@ |
295 | 297 | ||
298 | KERNEL_O := ../.. | ||
299 | ifneq ($(O),) | ||
300 | KERNEL_O := $(O) | ||
301 | endif | ||
302 | |||
296 | make_kernelsrc: | 303 | make_kernelsrc: |
297 | @echo "- make -C <kernelsrc> $(PARALLEL_OPT) tools/perf" | 304 | @echo "- make -C <kernelsrc> $(PARALLEL_OPT) tools/perf" |
298 | $(call clean); \ | 305 | $(call clean); \ |
299 | (make -C ../.. $(PARALLEL_OPT) tools/perf) > $@ 2>&1 && \ | 306 | (make -C ../.. $(PARALLEL_OPT) tools/perf) > $@ 2>&1 && \ |
300 | test -x perf && rm -f $@ || (cat $@ ; false) | 307 | test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false) |
301 | 308 | ||
302 | make_kernelsrc_tools: | 309 | make_kernelsrc_tools: |
303 | @echo "- make -C <kernelsrc>/tools $(PARALLEL_OPT) perf" | 310 | @echo "- make -C <kernelsrc>/tools $(PARALLEL_OPT) perf" |
304 | $(call clean); \ | 311 | $(call clean); \ |
305 | (make -C ../../tools $(PARALLEL_OPT) perf) > $@ 2>&1 && \ | 312 | (make -C ../../tools $(PARALLEL_OPT) perf) > $@ 2>&1 && \ |
306 | test -x perf && rm -f $@ || (cat $@ ; false) | 313 | test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false) |
307 | 314 | ||
308 | all: $(run) $(run_O) tarpkg make_kernelsrc make_kernelsrc_tools | 315 | all: $(run) $(run_O) tarpkg make_kernelsrc make_kernelsrc_tools |
309 | @echo OK | 316 | @echo OK |