Skip to content

Commit 68824de

Browse files
WangNan0acmel
authored andcommitted
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>
1 parent eb80773 commit 68824de

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

  • tools/perf/tests

‎tools/perf/tests/make‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ else
1313
endif
1414
else
1515
PERF := .
16+
PERF_O := $(PERF)
1617
O_OPT :=
1718

1819
ifneq ($(O),)
1920
FULL_O := $(shell readlink -f $(O) || echo $(O))
21+
PERF_O := $(FULL_O)
2022
ifeq ($(SET_O),1)
2123
O_OPT := 'O=$(FULL_O)'
2224
endif
@@ -173,11 +175,11 @@ test_make_doc := $(test_ok)
173175
test_make_help_O := $(test_ok)
174176
test_make_doc_O := $(test_ok)
175177

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
177179

178-
test_make_perf_o := test -f $(PERF)/perf.o
179-
test_make_util_map_o := test -f $(PERF)/util/map.o
180-
test_make_util_pmu_bison_o := test -f $(PERF)/util/pmu-bison.o
180+
test_make_perf_o := test -f $(PERF_O)/perf.o
181+
test_make_util_map_o := test -f $(PERF_O)/util/map.o
182+
test_make_util_pmu_bison_o := test -f $(PERF_O)/util/pmu-bison.o
181183

182184
define test_dest_files
183185
for file in $(1); do \
@@ -244,7 +246,7 @@ test_make_perf_o_O := test -f $$TMP_O/perf.o
244246
test_make_util_map_o_O := test -f $$TMP_O/util/map.o
245247
test_make_util_pmu_bison_o_O := test -f $$TMP_O/util/pmu-bison.o
246248

247-
test_default = test -x $(PERF)/perf
249+
test_default = test -x $(PERF_O)/perf
248250
test = $(if $(test_$1),$(test_$1),$(test_default))
249251

250252
test_default_O = test -x $$TMP_O/perf
@@ -293,17 +295,22 @@ tarpkg:
293295
( eval $$cmd ) >> $@ 2>&1 && \
294296
rm -f $@
295297

298+
KERNEL_O := ../..
299+
ifneq ($(O),)
300+
KERNEL_O := $(O)
301+
endif
302+
296303
make_kernelsrc:
297304
@echo "- make -C <kernelsrc> $(PARALLEL_OPT) tools/perf"
298305
$(call clean); \
299306
(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)
301308

302309
make_kernelsrc_tools:
303310
@echo "- make -C <kernelsrc>/tools $(PARALLEL_OPT) perf"
304311
$(call clean); \
305312
(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)
307314

308315
all: $(run) $(run_O) tarpkg make_kernelsrc make_kernelsrc_tools
309316
@echo OK

0 commit comments

Comments
 (0)