From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Wang Nan <wangnan0@huawei.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 04/16] perf build: Use feature dump file for build-test
Date: Fri, 29 Jan 2016 18:17:41 -0300 [thread overview]
Message-ID: <1454102273-16431-5-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1454102273-16431-1-git-send-email-acme@kernel.org>
See http://www.infradead.org/rpr.html
From: Wang Nan <wangnan0@huawei.com>
To prevent the feature check tests to run repeately, one time per
'tests/make' target/test, this patch utilizes the previously introduced
'feature-dump' make target and FEATURES_DUMP variable, making sure that
the feature checkers run only once when doing build-test for normal test
cases.
However, since standard users doesn't reuse features dump result, we'd
better give an option to check their behaviors. The above feature
should be used to make build-test faster only. Only utilize it for
build-test.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1454068269-235999-1-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Makefile | 2 +-
tools/perf/tests/make | 33 +++++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index dcd9a70c7193..e4ff0bd08870 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -78,7 +78,7 @@ clean:
# The build-test target is not really parallel, don't print the jobs info:
#
build-test:
- @$(MAKE) SHUF=1 -f tests/make --no-print-directory
+ @$(MAKE) SHUF=1 -f tests/make REUSE_FEATURES_DUMP=1 --no-print-directory
#
# All other targets get passed through:
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index f918015512af..7f663f4611c6 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -15,6 +15,7 @@ else
PERF := .
PERF_O := $(PERF)
O_OPT :=
+FULL_O := $(shell readlink -f $(PERF_O) || echo $(PERF_O))
ifneq ($(O),)
FULL_O := $(shell readlink -f $(O) || echo $(O))
@@ -313,11 +314,43 @@ make_kernelsrc_tools:
(make -C ../../tools $(PARALLEL_OPT) $(K_O_OPT) perf) > $@ 2>&1 && \
test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false)
+FEATURES_DUMP_FILE := $(FULL_O)/BUILD_TEST_FEATURE_DUMP
+FEATURES_DUMP_FILE_STATIC := $(FULL_O)/BUILD_TEST_FEATURE_DUMP_STATIC
+
all: $(run) $(run_O) tarpkg make_kernelsrc make_kernelsrc_tools
@echo OK
+ @rm -f $(FEATURES_DUMP_FILE) $(FEATURES_DUMP_FILE_STATIC)
out: $(run_O)
@echo OK
+ @rm -f $(FEATURES_DUMP_FILE) $(FEATURES_DUMP_FILE_STATIC)
+
+ifeq ($(REUSE_FEATURES_DUMP),1)
+$(FEATURES_DUMP_FILE):
+ $(call clean)
+ @cmd="cd $(PERF) && make FEATURE_DUMP_COPY=$@ $(O_OPT) feature-dump"; \
+ echo "- $@: $$cmd" && echo $$cmd && \
+ ( eval $$cmd ) > /dev/null 2>&1
+
+$(FEATURES_DUMP_FILE_STATIC):
+ $(call clean)
+ @cmd="cd $(PERF) && make FEATURE_DUMP_COPY=$@ $(O_OPT) LDFLAGS='-static' feature-dump"; \
+ echo "- $@: $$cmd" && echo $$cmd && \
+ ( eval $$cmd ) > /dev/null 2>&1
+
+# Add feature dump dependency for run/run_O targets
+$(foreach t,$(run) $(run_O),$(eval \
+ $(t): $(if $(findstring make_static,$(t)),\
+ $(FEATURES_DUMP_FILE_STATIC),\
+ $(FEATURES_DUMP_FILE))))
+
+# Append 'FEATURES_DUMP=' option to all test cases. For example:
+# make_no_libbpf: NO_LIBBPF=1 --> NO_LIBBPF=1 FEATURES_DUMP=/a/b/BUILD_TEST_FEATURE_DUMP
+# make_static: LDFLAGS=-static --> LDFLAGS=-static FEATURES_DUMP=/a/b/BUILD_TEST_FEATURE_DUMP_STATIC
+$(foreach t,$(run),$(if $(findstring make_static,$(t)),\
+ $(eval $(t) := $($(t)) FEATURES_DUMP=$(FEATURES_DUMP_FILE_STATIC)),\
+ $(eval $(t) := $($(t)) FEATURES_DUMP=$(FEATURES_DUMP_FILE))))
+endif
.PHONY: all $(run) $(run_O) tarpkg clean make_kernelsrc make_kernelsrc_tools
endif # ifndef MK
--
2.5.0
next prev parent reply other threads:[~2016-01-29 21:18 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-29 21:17 [GIT PULL 00/16] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-01-29 21:17 ` Arnaldo Carvalho de Melo
2016-01-29 21:17 ` [PATCH 01/16] tools build: Check basic headers for test-compile feature checker Arnaldo Carvalho de Melo
2016-01-29 21:17 ` [PATCH 02/16] perf build: Fix feature-dump checks, we need to test all features Arnaldo Carvalho de Melo
2016-01-29 21:17 ` [PATCH 03/16] perf build: Remove all condition feature check {C,LD}FLAGS Arnaldo Carvalho de Melo
2016-01-29 21:17 ` Arnaldo Carvalho de Melo [this message]
2016-01-29 21:17 ` [PATCH 05/16] perf tools: Speed up build-tests by reducing the number of builds tested Arnaldo Carvalho de Melo
2016-01-29 21:17 ` [PATCH 06/16] perf auxtrace: Add perf_evlist pointer to *info_priv_size() Arnaldo Carvalho de Melo
2016-01-29 21:17 ` Arnaldo Carvalho de Melo
2016-01-29 21:17 ` [PATCH 07/16] perf buildid: Fix cpumode of buildid event Arnaldo Carvalho de Melo
2016-01-29 21:17 ` [PATCH 08/16] perf test: Check environment before start real BPF test Arnaldo Carvalho de Melo
2016-01-29 21:17 ` [PATCH 09/16] perf test: Improve bp_signal Arnaldo Carvalho de Melo
2016-01-29 21:17 ` [PATCH 10/16] perf tools: Move timestamp creation to util Arnaldo Carvalho de Melo
2016-01-29 21:17 ` [PATCH 11/16] perf record: Use OPT_BOOLEAN_SET for buildid cache related options Arnaldo Carvalho de Melo
2016-01-29 21:17 ` [PATCH 12/16] perf kvm/{x86, s390}: Remove dependency on uapi/kvm_perf.h Arnaldo Carvalho de Melo
2016-01-29 21:17 ` [PATCH 12/16] perf kvm/{x86,s390}: " Arnaldo Carvalho de Melo
2016-01-29 21:17 ` [PATCH 13/16] perf kvm/{x86,s390}: Remove const from kvm_events_tp Arnaldo Carvalho de Melo
2016-01-29 21:17 ` [PATCH 14/16] perf kvm/powerpc: Port perf kvm stat to powerpc Arnaldo Carvalho de Melo
2016-01-29 21:17 ` [PATCH 15/16] perf kvm/powerpc: Add support for HCALL reasons Arnaldo Carvalho de Melo
2016-01-29 21:17 ` [PATCH 16/16] perf build: Align the names of the build tests: Arnaldo Carvalho de Melo
2016-02-03 10:02 ` [GIT PULL 00/16] perf/core improvements and fixes Ingo Molnar
2016-02-03 10:02 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1454102273-16431-5-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.