All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH update] perf build: Use feature dump file for build-test
@ 2016-01-29 11:51 Wang Nan
  2016-01-29 13:02 ` Wangnan (F)
  2016-02-03 10:16 ` [tip:perf/core] " tip-bot for Wang Nan
  0 siblings, 2 replies; 4+ messages in thread
From: Wang Nan @ 2016-01-29 11:51 UTC (permalink / raw)
  To: jolsa, acme
  Cc: linux-kernel, Wang Nan, Jiri Olsa, Arnaldo Carvalho de Melo,
	Namhyung Kim

To prevent feature check run too many times, this patch utilizes
previous introduced feature-dump make target and FEATURES_DUMP
variable, makes sure 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: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
---
 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 dcd9a70..e4ff0bd 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 f918015..7f663f4 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
-- 
1.8.3.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH update] perf build: Use feature dump file for build-test
  2016-01-29 11:51 [PATCH update] perf build: Use feature dump file for build-test Wang Nan
@ 2016-01-29 13:02 ` Wangnan (F)
  2016-01-29 14:53   ` Arnaldo Carvalho de Melo
  2016-02-03 10:16 ` [tip:perf/core] " tip-bot for Wang Nan
  1 sibling, 1 reply; 4+ messages in thread
From: Wangnan (F) @ 2016-01-29 13:02 UTC (permalink / raw)
  To: jolsa, acme
  Cc: linux-kernel, Jiri Olsa, Arnaldo Carvalho de Melo, Namhyung Kim

I tested this patch in my platform with

  $ make build-test
  $ make -f ./tests/make

All test cases passed for me.

Thank you.

On 2016/1/29 19:51, Wang Nan wrote:
> To prevent feature check run too many times, this patch utilizes
> previous introduced feature-dump make target and FEATURES_DUMP
> variable, makes sure 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: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> ---
>   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 dcd9a70..e4ff0bd 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 f918015..7f663f4 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH update] perf build: Use feature dump file for build-test
  2016-01-29 13:02 ` Wangnan (F)
@ 2016-01-29 14:53   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-01-29 14:53 UTC (permalink / raw)
  To: Wangnan (F); +Cc: jolsa, linux-kernel, Jiri Olsa, Namhyung Kim

Em Fri, Jan 29, 2016 at 09:02:19PM +0800, Wangnan (F) escreveu:
> I tested this patch in my platform with
> 
>  $ make build-test
>  $ make -f ./tests/make
> 
> All test cases passed for me.

Thanks, I've testing this now,

- Arnaldo
 
> Thank you.
> 
> On 2016/1/29 19:51, Wang Nan wrote:
> >To prevent feature check run too many times, this patch utilizes
> >previous introduced feature-dump make target and FEATURES_DUMP
> >variable, makes sure 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: Arnaldo Carvalho de Melo <acme@redhat.com>
> >Cc: Namhyung Kim <namhyung@kernel.org>
> >---
> >  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 dcd9a70..e4ff0bd 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 f918015..7f663f4 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
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip:perf/core] perf build: Use feature dump file for build-test
  2016-01-29 11:51 [PATCH update] perf build: Use feature dump file for build-test Wang Nan
  2016-01-29 13:02 ` Wangnan (F)
@ 2016-02-03 10:16 ` tip-bot for Wang Nan
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Wang Nan @ 2016-02-03 10:16 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, tglx, hpa, wangnan0, namhyung, jolsa, mingo, linux-kernel

Commit-ID:  79191c89a049a9c525ce22a7d1e5674699c58818
Gitweb:     http://git.kernel.org/tip/79191c89a049a9c525ce22a7d1e5674699c58818
Author:     Wang Nan <wangnan0@huawei.com>
AuthorDate: Fri, 29 Jan 2016 11:51:09 +0000
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 29 Jan 2016 14:47:52 -0300

perf build: Use feature dump file for build-test

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 dcd9a70..e4ff0bd 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 f918015..7f663f4 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-03 10:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-29 11:51 [PATCH update] perf build: Use feature dump file for build-test Wang Nan
2016-01-29 13:02 ` Wangnan (F)
2016-01-29 14:53   ` Arnaldo Carvalho de Melo
2016-02-03 10:16 ` [tip:perf/core] " tip-bot for Wang Nan

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.