aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorWang Nan <wangnan0@huawei.com>2016-01-14 23:00:15 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-01-15 14:31:59 -0500
commit68824de19a0b4cdc17193cb004c55d82c06af8bd (patch)
treede5ffd246780bf40456e53259bfd6a70345dcf84 /tools
parenteb807730c034090599135bc03578015ebf8974af (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/make21
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
13endif 13endif
14else 14else
15PERF := . 15PERF := .
16PERF_O := $(PERF)
16O_OPT := 17O_OPT :=
17 18
18ifneq ($(O),) 19ifneq ($(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)
173test_make_help_O := $(test_ok) 175test_make_help_O := $(test_ok)
174test_make_doc_O := $(test_ok) 176test_make_doc_O := $(test_ok)
175 177
176test_make_python_perf_so := test -f $(PERF)/python/perf.so 178test_make_python_perf_so := test -f $(PERF_O)/python/perf.so
177 179
178test_make_perf_o := test -f $(PERF)/perf.o 180test_make_perf_o := test -f $(PERF_O)/perf.o
179test_make_util_map_o := test -f $(PERF)/util/map.o 181test_make_util_map_o := test -f $(PERF_O)/util/map.o
180test_make_util_pmu_bison_o := test -f $(PERF)/util/pmu-bison.o 182test_make_util_pmu_bison_o := test -f $(PERF_O)/util/pmu-bison.o
181 183
182define test_dest_files 184define 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
244test_make_util_map_o_O := test -f $$TMP_O/util/map.o 246test_make_util_map_o_O := test -f $$TMP_O/util/map.o
245test_make_util_pmu_bison_o_O := test -f $$TMP_O/util/pmu-bison.o 247test_make_util_pmu_bison_o_O := test -f $$TMP_O/util/pmu-bison.o
246 248
247test_default = test -x $(PERF)/perf 249test_default = test -x $(PERF_O)/perf
248test = $(if $(test_$1),$(test_$1),$(test_default)) 250test = $(if $(test_$1),$(test_$1),$(test_default))
249 251
250test_default_O = test -x $$TMP_O/perf 252test_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
298KERNEL_O := ../..
299ifneq ($(O),)
300 KERNEL_O := $(O)
301endif
302
296make_kernelsrc: 303make_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
302make_kernelsrc_tools: 309make_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
308all: $(run) $(run_O) tarpkg make_kernelsrc make_kernelsrc_tools 315all: $(run) $(run_O) tarpkg make_kernelsrc make_kernelsrc_tools
309 @echo OK 316 @echo OK