linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/9] perf build: Make build-test faster
@ 2016-01-15  4:00 Wang Nan
  2016-01-15  4:00 ` [PATCH v3 1/9] perf build: Set parallel making options build-test Wang Nan
                   ` (9 more replies)
  0 siblings, 10 replies; 28+ messages in thread
From: Wang Nan @ 2016-01-15  4:00 UTC (permalink / raw)
  To: acme, jolsa; +Cc: linux-kernel, pi3orama, lizefan, Wang Nan

Utilise Jiri's feature-dump make target to avoid make build-test check
features too many times.

v2 -> v3: add $(O_OPT) to 'make clean' to ensure the correctness of
          config-clean.

Jiri Olsa (2):
  perf build: Add feature-dump target
  perf build: Introduce FEATURES_DUMP make variable

Wang Nan (7):
  perf build: Set parallel making options build-test
  perf build: Pass O option to Makefile.perf in build-test
  perf build: Test correct path of perf in build-test
  perf build: Pass O option to kernel makefile in build-test
  tools build: Allow subprojects select all feature checkers
  perf build: Select all feature checkers for feature-dump
  perf build: Use feature dump file for build-test

 tools/build/Makefile.feature | 21 ++++++++++-
 tools/perf/Makefile.perf     | 34 +++++++++++++++++-
 tools/perf/config/Makefile   |  4 +++
 tools/perf/tests/make        | 86 ++++++++++++++++++++++++++++++++++++--------
 4 files changed, 128 insertions(+), 17 deletions(-)

-- 
1.8.3.4

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

* [PATCH v3 1/9] perf build: Set parallel making options build-test
  2016-01-15  4:00 [PATCH v3 0/9] perf build: Make build-test faster Wang Nan
@ 2016-01-15  4:00 ` Wang Nan
  2016-01-15  4:00 ` [PATCH v3 2/9] perf build: Pass O option to Makefile.perf in build-test Wang Nan
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 28+ messages in thread
From: Wang Nan @ 2016-01-15  4:00 UTC (permalink / raw)
  To: acme, jolsa
  Cc: linux-kernel, pi3orama, lizefan, Wang Nan,
	Arnaldo Carvalho de Melo, Namhyung Kim

'make build-test' is painful because of time consuming. In a full test,
all test cases are built twice with tools/perf/Makefile and
tools/perf/Makefile.perf. 'Makefile' automatically computes parallel
options for make, but 'Makefile.perf' not, so all test cases is built
with one job. It is very slow.

This patch adds '-j' options to Makefile.perf testing. It computes
parallel building options like what tools/perf/Makefile does, and pass
'-j' option to Makefile.perf test.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/tests/make | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index df38dec..c0ee679 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -5,7 +5,7 @@ ifeq ($(MAKECMDGOALS),)
 # no target specified, trigger the whole suite
 all:
 	@echo "Testing Makefile";      $(MAKE) -sf tests/make MK=Makefile
-	@echo "Testing Makefile.perf"; $(MAKE) -sf tests/make MK=Makefile.perf
+	@echo "Testing Makefile.perf"; $(MAKE) -sf tests/make MK=Makefile.perf SET_PARALLEL=1
 else
 # run only specific test over 'Makefile'
 %:
@@ -14,6 +14,15 @@ endif
 else
 PERF := .
 
+PARALLEL_OPT=
+ifeq ($(SET_PARALLEL),1)
+  cores := $(shell (getconf _NPROCESSORS_ONLN || egrep -c '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
+  ifeq ($(cores),0)
+    cores := 1
+  endif
+  PARALLEL_OPT="-j$(cores)"
+endif
+
 # As per kernel Makefile, avoid funny character set dependencies
 unexport LC_ALL
 LC_COLLATE=C
@@ -252,7 +261,7 @@ clean := @(cd $(PERF); make -s -f $(MK) clean >/dev/null)
 $(run):
 	$(call clean)
 	@TMP_DEST=$$(mktemp -d); \
-	cmd="cd $(PERF) && make -f $(MK) DESTDIR=$$TMP_DEST $($@)"; \
+	cmd="cd $(PERF) && make -f $(MK) $(PARALLEL_OPT) DESTDIR=$$TMP_DEST $($@)"; \
 	echo "- $@: $$cmd" && echo $$cmd > $@ && \
 	( eval $$cmd ) >> $@ 2>&1; \
 	echo "  test: $(call test,$@)" >> $@ 2>&1; \
@@ -263,7 +272,7 @@ $(run_O):
 	$(call clean)
 	@TMP_O=$$(mktemp -d); \
 	TMP_DEST=$$(mktemp -d); \
-	cmd="cd $(PERF) && make -f $(MK) O=$$TMP_O DESTDIR=$$TMP_DEST $($(patsubst %_O,%,$@))"; \
+	cmd="cd $(PERF) && make -f $(MK) $(PARALLEL_OPT) O=$$TMP_O DESTDIR=$$TMP_DEST $($(patsubst %_O,%,$@))"; \
 	echo "- $@: $$cmd" && echo $$cmd > $@ && \
 	( eval $$cmd ) >> $@ 2>&1 && \
 	echo "  test: $(call test_O,$@)" >> $@ 2>&1; \
@@ -277,15 +286,15 @@ tarpkg:
 	rm -f $@
 
 make_kernelsrc:
-	@echo "- make -C <kernelsrc> tools/perf"
+	@echo "- make -C <kernelsrc> $(PARALLEL_OPT) tools/perf"
 	$(call clean); \
-	(make -C ../.. tools/perf) > $@ 2>&1 && \
+	(make -C ../.. $(PARALLEL_OPT) tools/perf) > $@ 2>&1 && \
 	test -x perf && rm -f $@ || (cat $@ ; false)
 
 make_kernelsrc_tools:
-	@echo "- make -C <kernelsrc>/tools perf"
+	@echo "- make -C <kernelsrc>/tools $(PARALLEL_OPT) perf"
 	$(call clean); \
-	(make -C ../../tools perf) > $@ 2>&1 && \
+	(make -C ../../tools $(PARALLEL_OPT) perf) > $@ 2>&1 && \
 	test -x perf && rm -f $@ || (cat $@ ; false)
 
 all: $(run) $(run_O) tarpkg make_kernelsrc make_kernelsrc_tools
-- 
1.8.3.4

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

* [PATCH v3 2/9] perf build: Pass O option to Makefile.perf in build-test
  2016-01-15  4:00 [PATCH v3 0/9] perf build: Make build-test faster Wang Nan
  2016-01-15  4:00 ` [PATCH v3 1/9] perf build: Set parallel making options build-test Wang Nan
@ 2016-01-15  4:00 ` Wang Nan
  2016-01-19 13:35   ` [tip:perf/urgent] " tip-bot for Wang Nan
  2016-01-15  4:00 ` [PATCH v3 3/9] perf build: Test correct path of perf " Wang Nan
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Wang Nan @ 2016-01-15  4:00 UTC (permalink / raw)
  To: acme, jolsa
  Cc: linux-kernel, pi3orama, lizefan, Wang Nan,
	Arnaldo Carvalho de Melo, Jiri Olsa, Namhyung Kim

Doesn't like tools/perf/Makefile, tools/perf/Makefile.perf obey 'O'
option when it is passed through cmdline only, because of code in
tools/scripts/Makefile.include:

 ifneq ($(O),)
 ifeq ($(origin O), command line)
 	...
 	ABSOLUTE_O := $(shell cd $(O) ; pwd)
 	OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
 endif
 endif

This patch passes 'O' to Makefile.perf through cmdline explicitly
to make it follow O variable during build-test.

'make clean' should have identical 'O' option with 'make'. If not,
config-clean may error.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/tests/make | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index c0ee679..fc2a9a3 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -5,7 +5,7 @@ ifeq ($(MAKECMDGOALS),)
 # no target specified, trigger the whole suite
 all:
 	@echo "Testing Makefile";      $(MAKE) -sf tests/make MK=Makefile
-	@echo "Testing Makefile.perf"; $(MAKE) -sf tests/make MK=Makefile.perf SET_PARALLEL=1
+	@echo "Testing Makefile.perf"; $(MAKE) -sf tests/make MK=Makefile.perf SET_PARALLEL=1 SET_O=1
 else
 # run only specific test over 'Makefile'
 %:
@@ -13,6 +13,14 @@ else
 endif
 else
 PERF := .
+O_OPT :=
+
+ifneq ($(O),)
+  FULL_O := $(shell readlink -f $(O) || echo $(O))
+  ifeq ($(SET_O),1)
+    O_OPT := 'O=$(FULL_O)'
+  endif
+endif
 
 PARALLEL_OPT=
 ifeq ($(SET_PARALLEL),1)
@@ -256,12 +264,12 @@ endif
 
 MAKEFLAGS := --no-print-directory
 
-clean := @(cd $(PERF); make -s -f $(MK) clean >/dev/null)
+clean := @(cd $(PERF); make -s -f $(MK) $(O_OPT) clean >/dev/null)
 
 $(run):
 	$(call clean)
 	@TMP_DEST=$$(mktemp -d); \
-	cmd="cd $(PERF) && make -f $(MK) $(PARALLEL_OPT) DESTDIR=$$TMP_DEST $($@)"; \
+	cmd="cd $(PERF) && make -f $(MK) $(PARALLEL_OPT) $(O_OPT) DESTDIR=$$TMP_DEST $($@)"; \
 	echo "- $@: $$cmd" && echo $$cmd > $@ && \
 	( eval $$cmd ) >> $@ 2>&1; \
 	echo "  test: $(call test,$@)" >> $@ 2>&1; \
-- 
1.8.3.4

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

* [PATCH v3 3/9] perf build: Test correct path of perf in build-test
  2016-01-15  4:00 [PATCH v3 0/9] perf build: Make build-test faster Wang Nan
  2016-01-15  4:00 ` [PATCH v3 1/9] perf build: Set parallel making options build-test Wang Nan
  2016-01-15  4:00 ` [PATCH v3 2/9] perf build: Pass O option to Makefile.perf in build-test Wang Nan
@ 2016-01-15  4:00 ` Wang Nan
  2016-01-19 13:35   ` [tip:perf/urgent] " tip-bot for Wang Nan
  2016-01-15  4:00 ` [PATCH v3 4/9] perf build: Pass O option to kernel makefile " Wang Nan
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Wang Nan @ 2016-01-15  4:00 UTC (permalink / raw)
  To: acme, jolsa
  Cc: linux-kernel, pi3orama, lizefan, Wang Nan,
	Arnaldo Carvalho de Melo, Jiri Olsa, Namhyung Kim

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>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/tests/make | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index fc2a9a3..29810cf 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -13,10 +13,12 @@ else
 endif
 else
 PERF := .
+PERF_O := $(PERF)
 O_OPT :=
 
 ifneq ($(O),)
   FULL_O := $(shell readlink -f $(O) || echo $(O))
+  PERF_O := $(FULL_O)
   ifeq ($(SET_O),1)
     O_OPT := 'O=$(FULL_O)'
   endif
@@ -173,11 +175,11 @@ test_make_doc    := $(test_ok)
 test_make_help_O := $(test_ok)
 test_make_doc_O  := $(test_ok)
 
-test_make_python_perf_so := test -f $(PERF)/python/perf.so
+test_make_python_perf_so := test -f $(PERF_O)/python/perf.so
 
-test_make_perf_o           := test -f $(PERF)/perf.o
-test_make_util_map_o       := test -f $(PERF)/util/map.o
-test_make_util_pmu_bison_o := test -f $(PERF)/util/pmu-bison.o
+test_make_perf_o           := test -f $(PERF_O)/perf.o
+test_make_util_map_o       := test -f $(PERF_O)/util/map.o
+test_make_util_pmu_bison_o := test -f $(PERF_O)/util/pmu-bison.o
 
 define test_dest_files
   for file in $(1); do				\
@@ -244,7 +246,7 @@ test_make_perf_o_O            := test -f $$TMP_O/perf.o
 test_make_util_map_o_O        := test -f $$TMP_O/util/map.o
 test_make_util_pmu_bison_o_O := test -f $$TMP_O/util/pmu-bison.o
 
-test_default = test -x $(PERF)/perf
+test_default = test -x $(PERF_O)/perf
 test = $(if $(test_$1),$(test_$1),$(test_default))
 
 test_default_O = test -x $$TMP_O/perf
@@ -293,17 +295,22 @@ tarpkg:
 	( eval $$cmd ) >> $@ 2>&1 && \
 	rm -f $@
 
+KERNEL_O := ../..
+ifneq ($(O),)
+  KERNEL_O := $(O)
+endif
+
 make_kernelsrc:
 	@echo "- make -C <kernelsrc> $(PARALLEL_OPT) tools/perf"
 	$(call clean); \
 	(make -C ../.. $(PARALLEL_OPT) tools/perf) > $@ 2>&1 && \
-	test -x perf && rm -f $@ || (cat $@ ; false)
+	test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false)
 
 make_kernelsrc_tools:
 	@echo "- make -C <kernelsrc>/tools $(PARALLEL_OPT) perf"
 	$(call clean); \
 	(make -C ../../tools $(PARALLEL_OPT) perf) > $@ 2>&1 && \
-	test -x perf && rm -f $@ || (cat $@ ; false)
+	test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false)
 
 all: $(run) $(run_O) tarpkg make_kernelsrc make_kernelsrc_tools
 	@echo OK
-- 
1.8.3.4

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

* [PATCH v3 4/9] perf build: Pass O option to kernel makefile in build-test
  2016-01-15  4:00 [PATCH v3 0/9] perf build: Make build-test faster Wang Nan
                   ` (2 preceding siblings ...)
  2016-01-15  4:00 ` [PATCH v3 3/9] perf build: Test correct path of perf " Wang Nan
@ 2016-01-15  4:00 ` Wang Nan
  2016-01-19 13:35   ` [tip:perf/urgent] " tip-bot for Wang Nan
  2016-01-15  4:00 ` [PATCH v3 5/9] perf build: Add feature-dump target Wang Nan
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Wang Nan @ 2016-01-15  4:00 UTC (permalink / raw)
  To: acme, jolsa
  Cc: linux-kernel, pi3orama, lizefan, Wang Nan,
	Arnaldo Carvalho de Melo, Jiri Olsa, Namhyung Kim

Kernel makefile only follow 'O' option passed from command line
explicitely. In build-test with 'O' option set, kernel makefile
contaminate kernel source directory. Build test also fail if we
don't create output directory manually.

K_O_OPT is added and passed to kernel makefile if 'O' is passed
to build-test.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/tests/make | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index 29810cf..f918015 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -22,6 +22,7 @@ ifneq ($(O),)
   ifeq ($(SET_O),1)
     O_OPT := 'O=$(FULL_O)'
   endif
+  K_O_OPT := 'O=$(FULL_O)'
 endif
 
 PARALLEL_OPT=
@@ -301,15 +302,15 @@ ifneq ($(O),)
 endif
 
 make_kernelsrc:
-	@echo "- make -C <kernelsrc> $(PARALLEL_OPT) tools/perf"
+	@echo "- make -C <kernelsrc> $(PARALLEL_OPT) $(K_O_OPT) tools/perf"
 	$(call clean); \
-	(make -C ../.. $(PARALLEL_OPT) tools/perf) > $@ 2>&1 && \
+	(make -C ../.. $(PARALLEL_OPT) $(K_O_OPT) tools/perf) > $@ 2>&1 && \
 	test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false)
 
 make_kernelsrc_tools:
-	@echo "- make -C <kernelsrc>/tools $(PARALLEL_OPT) perf"
+	@echo "- make -C <kernelsrc>/tools $(PARALLEL_OPT) $(K_O_OPT) perf"
 	$(call clean); \
-	(make -C ../../tools $(PARALLEL_OPT) perf) > $@ 2>&1 && \
+	(make -C ../../tools $(PARALLEL_OPT) $(K_O_OPT) perf) > $@ 2>&1 && \
 	test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false)
 
 all: $(run) $(run_O) tarpkg make_kernelsrc make_kernelsrc_tools
-- 
1.8.3.4

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

* [PATCH v3 5/9] perf build: Add feature-dump target
  2016-01-15  4:00 [PATCH v3 0/9] perf build: Make build-test faster Wang Nan
                   ` (3 preceding siblings ...)
  2016-01-15  4:00 ` [PATCH v3 4/9] perf build: Pass O option to kernel makefile " Wang Nan
@ 2016-01-15  4:00 ` Wang Nan
  2016-01-15 19:11   ` Arnaldo Carvalho de Melo
  2016-01-19 13:36   ` [tip:perf/urgent] " tip-bot for Jiri Olsa
  2016-01-15  4:00 ` [PATCH v3 6/9] perf build: Introduce FEATURES_DUMP make variable Wang Nan
                   ` (4 subsequent siblings)
  9 siblings, 2 replies; 28+ messages in thread
From: Wang Nan @ 2016-01-15  4:00 UTC (permalink / raw)
  To: acme, jolsa; +Cc: linux-kernel, pi3orama, lizefan, Jiri Olsa, Wang Nan

From: Jiri Olsa <jolsa@kernel.org>

To provide FEATURE-DUMP into $(FEATURE_DUMP_COPY)
if defined, with no further action.

Get feature dump of the current build:
  $ make feature-dump
    BUILD:   Doing 'make -j4' parallel build

  Auto-detecting system features:
  ...                         dwarf: [ on  ]

  FEATURE-DUMP file available in FEATURE-DUMP

Get feature dump static build into /tmp/fd file:
  $ make feature-dump FEATURE_DUMP_COPY=/tmp/fd LDFLAGS=-static
    BUILD:   Doing 'make -j4' parallel build

  Auto-detecting system features:
  ...                         dwarf: [ OFF ]

  SNIP

  FEATURE-DUMP file copied into /tmp/fd

Suggested-by: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-xzqhfxw3euqmls3cve0ruuol@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Wang Nan <wangnan0@huawei.com>
---
 tools/perf/Makefile.perf | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 0a22407..f758a72 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -611,6 +611,17 @@ clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean
 	$(python-clean)
 
 #
+# To provide FEATURE-DUMP into $(FEATURE_DUMP_COPY)
+# file if defined, with no further action.
+feature-dump:
+ifdef FEATURE_DUMP_COPY
+	@cp $(OUTPUT)FEATURE-DUMP $(FEATURE_DUMP_COPY)
+	@echo "FEATURE-DUMP file copied into $(FEATURE_DUMP_COPY)"
+else
+	@echo "FEATURE-DUMP file available in $(OUTPUT)FEATURE-DUMP"
+endif
+
+#
 # Trick: if ../../.git does not exist - we are building out of tree for example,
 # then force version regeneration:
 #
-- 
1.8.3.4

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

* [PATCH v3 6/9] perf build: Introduce FEATURES_DUMP make variable
  2016-01-15  4:00 [PATCH v3 0/9] perf build: Make build-test faster Wang Nan
                   ` (4 preceding siblings ...)
  2016-01-15  4:00 ` [PATCH v3 5/9] perf build: Add feature-dump target Wang Nan
@ 2016-01-15  4:00 ` Wang Nan
  2016-01-19 13:36   ` [tip:perf/urgent] " tip-bot for Jiri Olsa
  2016-01-15  4:00 ` [PATCH v3 7/9] tools build: Allow subprojects select all feature checkers Wang Nan
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Wang Nan @ 2016-01-15  4:00 UTC (permalink / raw)
  To: acme, jolsa; +Cc: linux-kernel, pi3orama, lizefan, Jiri Olsa

From: Jiri Olsa <jolsa@kernel.org>

Introducing FEATURES_DUMP make variable to provide features
detection dump file and bypass the feature detection.

The intention is to use this during build tests to skip
repeated features detection, like:

Get feature dump static build into /tmp/fd file:
  $ make feature-dump FEATURE_DUMP_COPY=/tmp/fd LDFLAGS=-static
    BUILD:   Doing 'make -j4' parallel build

  Auto-detecting system features:
  ...                         dwarf: [ OFF ]

  SNIP

  FEATURE-DUMP file copied into /tmp/fd

Use /tmp/fd to build perf:
  $ make FEATURES_DUMP=/tmp/fd LDFLAGS=-static

  $ file perf
  perf: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for ...

Suggested-by: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-fhb47m6t18txuwrzu33is2bo@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/Makefile.perf   | 14 +++++++++++++-
 tools/perf/config/Makefile |  4 ++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index f758a72..5d34815 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -77,6 +77,9 @@ include config/utilities.mak
 # Define NO_AUXTRACE if you do not want AUX area tracing support
 #
 # Define NO_LIBBPF if you do not want BPF support
+#
+# Define FEATURES_DUMP to provide features detection dump file
+# and bypass the feature detection
 
 # As per kernel Makefile, avoid funny character set dependencies
 unexport LC_ALL
@@ -166,6 +169,15 @@ ifeq ($(config),1)
 include config/Makefile
 endif
 
+# The FEATURE_DUMP_EXPORT holds location of the actual
+# FEATURE_DUMP file to be used to bypass feature detection
+# (for bpf or any other subproject)
+ifeq ($(FEATURES_DUMP),)
+FEATURE_DUMP_EXPORT := $(realpath $(OUTPUT)FEATURE-DUMP)
+else
+FEATURE_DUMP_EXPORT := $(FEATURES_DUMP)
+endif
+
 export prefix bindir sharedir sysconfdir DESTDIR
 
 # sparse is architecture-neutral, which means that we need to tell it
@@ -436,7 +448,7 @@ $(LIBAPI)-clean:
 	$(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null
 
 $(LIBBPF): fixdep FORCE
-	$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) $(OUTPUT)libbpf.a FEATURES_DUMP=$(realpath $(OUTPUT)FEATURE-DUMP)
+	$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) $(OUTPUT)libbpf.a FEATURES_DUMP=$(FEATURE_DUMP_EXPORT)
 
 $(LIBBPF)-clean:
 	$(call QUIET_CLEAN, libbpf)
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index e5959c1..511141b 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -181,7 +181,11 @@ LDFLAGS += -Wl,-z,noexecstack
 
 EXTLIBS = -lpthread -lrt -lm -ldl
 
+ifeq ($(FEATURES_DUMP),)
 include $(srctree)/tools/build/Makefile.feature
+else
+include $(FEATURES_DUMP)
+endif
 
 ifeq ($(feature-stackprotector-all), 1)
   CFLAGS += -fstack-protector-all
-- 
1.8.3.4

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

* [PATCH v3 7/9] tools build: Allow subprojects select all feature checkers
  2016-01-15  4:00 [PATCH v3 0/9] perf build: Make build-test faster Wang Nan
                   ` (5 preceding siblings ...)
  2016-01-15  4:00 ` [PATCH v3 6/9] perf build: Introduce FEATURES_DUMP make variable Wang Nan
@ 2016-01-15  4:00 ` Wang Nan
  2016-01-15  4:00 ` [PATCH v3 8/9] perf build: Select all feature checkers for feature-dump Wang Nan
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 28+ messages in thread
From: Wang Nan @ 2016-01-15  4:00 UTC (permalink / raw)
  To: acme, jolsa
  Cc: linux-kernel, pi3orama, lizefan, Wang Nan, Jiri Olsa,
	Arnaldo Carvalho de Melo, Namhyung Kim

Put feature checkers not in original FEATURE_TESTS to a new list
and allow subproject select all feature checkers by setting
FEATURE_TESTS to 'all'.

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/build/Makefile.feature | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 02db3cd..674c47d 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -27,7 +27,7 @@ endef
 #   the rule that uses them - an example for that is the 'bionic'
 #   feature check. ]
 #
-FEATURE_TESTS ?=			\
+FEATURE_TESTS_BASIC :=			\
 	backtrace			\
 	dwarf				\
 	fortify-source			\
@@ -56,6 +56,25 @@ FEATURE_TESTS ?=			\
 	get_cpuid			\
 	bpf
 
+# FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+# of all feature tests
+FEATURE_TESTS_EXTRA :=			\
+	bionic				\
+	compile-32			\
+	compile-x32			\
+	cplus-demangle			\
+	hello				\
+	libbabeltrace			\
+	liberty				\
+	liberty-z			\
+	libunwind-debug-frame
+
+FEATURE_TESTS ?= $(FEATURE_TESTS_BASIC)
+
+ifeq ($(FEATURE_TESTS),all)
+  FEATURE_TESTS := $(FEATURE_TESTS_BASIC) $(FEATURE_TESTS_EXTRA)
+endif
+
 FEATURE_DISPLAY ?=			\
 	dwarf				\
 	glibc				\
-- 
1.8.3.4

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

* [PATCH v3 8/9] perf build: Select all feature checkers for feature-dump
  2016-01-15  4:00 [PATCH v3 0/9] perf build: Make build-test faster Wang Nan
                   ` (6 preceding siblings ...)
  2016-01-15  4:00 ` [PATCH v3 7/9] tools build: Allow subprojects select all feature checkers Wang Nan
@ 2016-01-15  4:00 ` Wang Nan
  2016-01-15  4:00 ` [PATCH v3 9/9] perf build: Use feature dump file for build-test Wang Nan
  2016-01-15 10:20 ` [PATCH v3 0/9] perf build: Make build-test faster Jiri Olsa
  9 siblings, 0 replies; 28+ messages in thread
From: Wang Nan @ 2016-01-15  4:00 UTC (permalink / raw)
  To: acme, jolsa
  Cc: linux-kernel, pi3orama, lizefan, Wang Nan, Jiri Olsa,
	Arnaldo Carvalho de Melo, Namhyung Kim

Set FEATURE_TESTS to 'all' so all possible feature checkers are
executed. Without this setting the output feature dump file miss
some feature, for example, liberity. Select all checker so we won't
get an incomplete feature dump file.

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.perf | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 5d34815..283775b 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -165,7 +165,16 @@ ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),)
 endif
 endif
 
+# Set FEATURE_TESTS to 'all' so all possible feature checkers are
+# executed. Without this setting the output feature dump file miss
+# some feature, for example, liberity. Select all checker so we won't
+# get an incomplete feature dump file.
 ifeq ($(config),1)
+ifdef MAKECMDGOALS
+ifeq ($(filter feature-dump,$(MAKECMDGOALS)),feature-dump)
+FEATURE_TESTS := all
+endif
+endif
 include config/Makefile
 endif
 
-- 
1.8.3.4

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

* [PATCH v3 9/9] perf build: Use feature dump file for build-test
  2016-01-15  4:00 [PATCH v3 0/9] perf build: Make build-test faster Wang Nan
                   ` (7 preceding siblings ...)
  2016-01-15  4:00 ` [PATCH v3 8/9] perf build: Select all feature checkers for feature-dump Wang Nan
@ 2016-01-15  4:00 ` Wang Nan
  2016-01-15 14:06   ` [PATCH v3 9/9 -fix] " Wang Nan
  2016-01-15 14:08   ` [PATCH v3 9/9] " Wangnan (F)
  2016-01-15 10:20 ` [PATCH v3 0/9] perf build: Make build-test faster Jiri Olsa
  9 siblings, 2 replies; 28+ messages in thread
From: Wang Nan @ 2016-01-15  4:00 UTC (permalink / raw)
  To: acme, jolsa
  Cc: linux-kernel, pi3orama, lizefan, 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.

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/tests/make | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index f918015..6473324 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_OUT) || echo $(PERF_OUT))
 
 ifneq ($(O),)
   FULL_O := $(shell readlink -f $(O) || echo $(O))
@@ -313,11 +314,41 @@ 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)
+
+$(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))))
 
 .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] 28+ messages in thread

* Re: [PATCH v3 0/9] perf build: Make build-test faster
  2016-01-15  4:00 [PATCH v3 0/9] perf build: Make build-test faster Wang Nan
                   ` (8 preceding siblings ...)
  2016-01-15  4:00 ` [PATCH v3 9/9] perf build: Use feature dump file for build-test Wang Nan
@ 2016-01-15 10:20 ` Jiri Olsa
  2016-01-15 14:36   ` Arnaldo Carvalho de Melo
  9 siblings, 1 reply; 28+ messages in thread
From: Jiri Olsa @ 2016-01-15 10:20 UTC (permalink / raw)
  To: Wang Nan; +Cc: acme, linux-kernel, pi3orama, lizefan

On Fri, Jan 15, 2016 at 04:00:12AM +0000, Wang Nan wrote:
> Utilise Jiri's feature-dump make target to avoid make build-test check
> features too many times.
> 
> v2 -> v3: add $(O_OPT) to 'make clean' to ensure the correctness of
>           config-clean.
> 
> Jiri Olsa (2):
>   perf build: Add feature-dump target
>   perf build: Introduce FEATURES_DUMP make variable
> 
> Wang Nan (7):
>   perf build: Set parallel making options build-test
>   perf build: Pass O option to Makefile.perf in build-test
>   perf build: Test correct path of perf in build-test
>   perf build: Pass O option to kernel makefile in build-test
>   tools build: Allow subprojects select all feature checkers
>   perf build: Select all feature checkers for feature-dump
>   perf build: Use feature dump file for build-test
> 
>  tools/build/Makefile.feature | 21 ++++++++++-
>  tools/perf/Makefile.perf     | 34 +++++++++++++++++-
>  tools/perf/config/Makefile   |  4 +++
>  tools/perf/tests/make        | 86 ++++++++++++++++++++++++++++++++++++--------
>  4 files changed, 128 insertions(+), 17 deletions(-)

got error on:

[jolsa@krava perf]$ make -f tests/make 
Testing Makefile
readlink: missing operand
Try 'readlink --help' for more information.
- /BUILD_TEST_FEATURE_DUMP: cd . && make FEATURE_DUMP_COPY=/BUILD_TEST_FEATURE_DUMP  feature-dump
cd . && make FEATURE_DUMP_COPY=/BUILD_TEST_FEATURE_DUMP feature-dump
tests/make:329: recipe for target '/BUILD_TEST_FEATURE_DUMP' failed
make[1]: *** [/BUILD_TEST_FEATURE_DUMP] Error 2
tests/make:7: recipe for target 'all' failed
make: *** [all] Error 2

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

* [PATCH v3 9/9 -fix] perf build: Use feature dump file for build-test
  2016-01-15  4:00 ` [PATCH v3 9/9] perf build: Use feature dump file for build-test Wang Nan
@ 2016-01-15 14:06   ` Wang Nan
  2016-01-15 14:08   ` [PATCH v3 9/9] " Wangnan (F)
  1 sibling, 0 replies; 28+ messages in thread
From: Wang Nan @ 2016-01-15 14:06 UTC (permalink / raw)
  To: acme, jolsa
  Cc: linux-kernel, pi3orama, lizefan, 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.

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/tests/make | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index f918015..b8c86bd 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,41 @@ 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)
+
+$(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))))
 
 .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] 28+ messages in thread

* Re: [PATCH v3 9/9] perf build: Use feature dump file for build-test
  2016-01-15  4:00 ` [PATCH v3 9/9] perf build: Use feature dump file for build-test Wang Nan
  2016-01-15 14:06   ` [PATCH v3 9/9 -fix] " Wang Nan
@ 2016-01-15 14:08   ` Wangnan (F)
  1 sibling, 0 replies; 28+ messages in thread
From: Wangnan (F) @ 2016-01-15 14:08 UTC (permalink / raw)
  To: acme, jolsa
  Cc: linux-kernel, pi3orama, lizefan, Jiri Olsa,
	Arnaldo Carvalho de Melo, Namhyung Kim



On 2016/1/15 12:00, 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.
>
> 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/tests/make | 31 +++++++++++++++++++++++++++++++
>   1 file changed, 31 insertions(+)
>
> diff --git a/tools/perf/tests/make b/tools/perf/tests/make
> index f918015..6473324 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_OUT) || echo $(PERF_OUT))
>   

Sorry. I forgot to rename PERF_OUT to PERF_O here.

I send a [PATCH v3 9/9 -fix] for this mistake.

Jiri, please help me test this patchset again with the above fix. Today I
don't have enough time to test them throughly.

Thank you.

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

* Re: [PATCH v3 0/9] perf build: Make build-test faster
  2016-01-15 10:20 ` [PATCH v3 0/9] perf build: Make build-test faster Jiri Olsa
@ 2016-01-15 14:36   ` Arnaldo Carvalho de Melo
  2016-01-15 14:54     ` Arnaldo Carvalho de Melo
  2016-01-15 14:54     ` pi3orama
  0 siblings, 2 replies; 28+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-01-15 14:36 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: Wang Nan, linux-kernel, pi3orama, lizefan

Em Fri, Jan 15, 2016 at 11:20:05AM +0100, Jiri Olsa escreveu:
> On Fri, Jan 15, 2016 at 04:00:12AM +0000, Wang Nan wrote:
> > Utilise Jiri's feature-dump make target to avoid make build-test check
> > features too many times.
> > 
> > v2 -> v3: add $(O_OPT) to 'make clean' to ensure the correctness of
> >           config-clean.
> > 
> > Jiri Olsa (2):
> >   perf build: Add feature-dump target
> >   perf build: Introduce FEATURES_DUMP make variable
> > 
> > Wang Nan (7):
> >   perf build: Set parallel making options build-test
> >   perf build: Pass O option to Makefile.perf in build-test
> >   perf build: Test correct path of perf in build-test
> >   perf build: Pass O option to kernel makefile in build-test
> >   tools build: Allow subprojects select all feature checkers
> >   perf build: Select all feature checkers for feature-dump
> >   perf build: Use feature dump file for build-test
> > 
> >  tools/build/Makefile.feature | 21 ++++++++++-
> >  tools/perf/Makefile.perf     | 34 +++++++++++++++++-
> >  tools/perf/config/Makefile   |  4 +++
> >  tools/perf/tests/make        | 86 ++++++++++++++++++++++++++++++++++++--------
> >  4 files changed, 128 insertions(+), 17 deletions(-)
> 
> got error on:
> 
> [jolsa@krava perf]$ make -f tests/make 
> Testing Makefile
> readlink: missing operand
> Try 'readlink --help' for more information.
> - /BUILD_TEST_FEATURE_DUMP: cd . && make FEATURE_DUMP_COPY=/BUILD_TEST_FEATURE_DUMP  feature-dump
> cd . && make FEATURE_DUMP_COPY=/BUILD_TEST_FEATURE_DUMP feature-dump
> tests/make:329: recipe for target '/BUILD_TEST_FEATURE_DUMP' failed
> make[1]: *** [/BUILD_TEST_FEATURE_DUMP] Error 2
> tests/make:7: recipe for target 'all' failed
> make: *** [all] Error 2

You mean with all patches applied, right? I haven't got that far, first
and second patches are ok by now, I'm failing at patch 3, checking if
setting up the python stuff to honour O= is in a later patch...

[acme@zoo linux]$ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ; make -C tools/perf O=/tmp/build/perf build-test
make: Entering directory '/home/git/linux/tools/perf'
Testing Makefile
- make_no_ui: cd . && make -f Makefile   DESTDIR=/tmp/tmp.RYVWn1yMBU NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
- make_tags: cd . && make -f Makefile   DESTDIR=/tmp/tmp.iNjVFs9Eje tags - make_python_perf_so: cd . && make -f Makefile DESTDIR=/tmp/tmp.mvHDSUV1pl python/perf.so
cd . && make -f Makefile DESTDIR=/tmp/tmp.mvHDSUV1pl python/perf.so
  BUILD:   Doing 'make -j4' parallel build

Auto-detecting system features:
...                         dwarf: [ on  ]
...                         glibc: [ on  ]
...                          gtk2: [ on  ]
...                      libaudit: [ on  ]
...                        libbfd: [ on  ]
...                        libelf: [ on  ]
...                       libnuma: [ on  ]
...        numa_num_possible_cpus: [ on  ]
...                       libperl: [ on  ]
...                     libpython: [ on  ]
...                      libslang: [ on  ]
...                     libunwind: [ on  ]
...            libdw-dwarf-unwind: [ on  ]
...                          zlib: [ on  ]
...                          lzma: [ on  ]
...                     get_cpuid: [ on  ]
...                           bpf: [ on  ]

make[4]: Nothing to be done for 'python/perf.so'.
  test: test -f /tmp/build/perf/python/perf.so
tests/make:272: recipe for target 'make_python_perf_so' failed
make[2]: *** [make_python_perf_so] Error 1
tests/make:7: recipe for target 'all' failed
make[1]: *** [all] Error 2
Makefile:81: recipe for target 'build-test' failed
make: *** [build-test] Error 2
make: Leaving directory '/home/git/linux/tools/perf'
[acme@zoo linux]$ find . -name "*.so"
./tools/perf/python_ext_build/lib/perf.so
./tools/perf/python/perf.so
[acme@zoo linux]$

I.e. the test -f follows O=, but the process to generate python/perf.so
doesn't and ends up pollutting the source tree.

- Arnaldo 

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

* Re: [PATCH v3 0/9] perf build: Make build-test faster
  2016-01-15 14:36   ` Arnaldo Carvalho de Melo
@ 2016-01-15 14:54     ` Arnaldo Carvalho de Melo
  2016-01-15 14:54     ` pi3orama
  1 sibling, 0 replies; 28+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-01-15 14:54 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: Wang Nan, linux-kernel, pi3orama, lizefan

Em Fri, Jan 15, 2016 at 11:36:16AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Fri, Jan 15, 2016 at 11:20:05AM +0100, Jiri Olsa escreveu:
> > On Fri, Jan 15, 2016 at 04:00:12AM +0000, Wang Nan wrote:
> > > Utilise Jiri's feature-dump make target to avoid make build-test check
> > > features too many times.
> > > 
> > > v2 -> v3: add $(O_OPT) to 'make clean' to ensure the correctness of
> > >           config-clean.
> > > 
> > > Jiri Olsa (2):
> > >   perf build: Add feature-dump target
> > >   perf build: Introduce FEATURES_DUMP make variable
> > > 
> > > Wang Nan (7):
> > >   perf build: Set parallel making options build-test
> > >   perf build: Pass O option to Makefile.perf in build-test
> > >   perf build: Test correct path of perf in build-test
> > >   perf build: Pass O option to kernel makefile in build-test
> > >   tools build: Allow subprojects select all feature checkers
> > >   perf build: Select all feature checkers for feature-dump
> > >   perf build: Use feature dump file for build-test
> > > 
> > >  tools/build/Makefile.feature | 21 ++++++++++-
> > >  tools/perf/Makefile.perf     | 34 +++++++++++++++++-
> > >  tools/perf/config/Makefile   |  4 +++
> > >  tools/perf/tests/make        | 86 ++++++++++++++++++++++++++++++++++++--------
> > >  4 files changed, 128 insertions(+), 17 deletions(-)
> > 
> > got error on:
> > 
> > [jolsa@krava perf]$ make -f tests/make 
> > Testing Makefile
> > readlink: missing operand
> > Try 'readlink --help' for more information.
> > - /BUILD_TEST_FEATURE_DUMP: cd . && make FEATURE_DUMP_COPY=/BUILD_TEST_FEATURE_DUMP  feature-dump
> > cd . && make FEATURE_DUMP_COPY=/BUILD_TEST_FEATURE_DUMP feature-dump
> > tests/make:329: recipe for target '/BUILD_TEST_FEATURE_DUMP' failed
> > make[1]: *** [/BUILD_TEST_FEATURE_DUMP] Error 2
> > tests/make:7: recipe for target 'all' failed
> > make: *** [all] Error 2
> 
> You mean with all patches applied, right? I haven't got that far, first
> and second patches are ok by now, I'm failing at patch 3, checking if
> setting up the python stuff to honour O= is in a later patch...
> 
> [acme@zoo linux]$ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ; make -C tools/perf O=/tmp/build/perf build-test
> make: Entering directory '/home/git/linux/tools/perf'
> Testing Makefile
> - make_no_ui: cd . && make -f Makefile   DESTDIR=/tmp/tmp.RYVWn1yMBU NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
> - make_tags: cd . && make -f Makefile   DESTDIR=/tmp/tmp.iNjVFs9Eje tags - make_python_perf_so: cd . && make -f Makefile DESTDIR=/tmp/tmp.mvHDSUV1pl python/perf.so
> cd . && make -f Makefile DESTDIR=/tmp/tmp.mvHDSUV1pl python/perf.so
>   BUILD:   Doing 'make -j4' parallel build
> 
> Auto-detecting system features:
> ...                         dwarf: [ on  ]
> ...                         glibc: [ on  ]
> ...                          gtk2: [ on  ]
> ...                      libaudit: [ on  ]
> ...                        libbfd: [ on  ]
> ...                        libelf: [ on  ]
> ...                       libnuma: [ on  ]
> ...        numa_num_possible_cpus: [ on  ]
> ...                       libperl: [ on  ]
> ...                     libpython: [ on  ]
> ...                      libslang: [ on  ]
> ...                     libunwind: [ on  ]
> ...            libdw-dwarf-unwind: [ on  ]
> ...                          zlib: [ on  ]
> ...                          lzma: [ on  ]
> ...                     get_cpuid: [ on  ]
> ...                           bpf: [ on  ]
> 
> make[4]: Nothing to be done for 'python/perf.so'.
>   test: test -f /tmp/build/perf/python/perf.so
> tests/make:272: recipe for target 'make_python_perf_so' failed
> make[2]: *** [make_python_perf_so] Error 1
> tests/make:7: recipe for target 'all' failed
> make[1]: *** [all] Error 2
> Makefile:81: recipe for target 'build-test' failed
> make: *** [build-test] Error 2
> make: Leaving directory '/home/git/linux/tools/perf'
> [acme@zoo linux]$ find . -name "*.so"
> ./tools/perf/python_ext_build/lib/perf.so
> ./tools/perf/python/perf.so
> [acme@zoo linux]$
> 
> I.e. the test -f follows O=, but the process to generate python/perf.so
> doesn't and ends up pollutting the source tree.

But if I try to run it directly, it works:


[acme@zoo linux]$ make -C tools clean > /dev/null
[acme@zoo linux]$ find tools/ -name "*.so"
[acme@zoo linux]$ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ; make -C tools/perf O=/tmp/build/perf -f tests/make make_python_perf_so
make: Entering directory '/home/git/linux/tools/perf'
Testing Makefile
make[1]: Entering directory '/home/git/linux/tools/perf'
- make_python_perf_so: cd . && make -f Makefile   DESTDIR=/tmp/tmp.9yCzYN33GK python/perf.so
make[1]: Leaving directory '/home/git/linux/tools/perf'
make: Leaving directory '/home/git/linux/tools/perf'
[acme@zoo linux]$ find tools/ -name "*.so"
[acme@zoo linux]$ ls -la /tmp/build/perf/python/perf.so 
-rwxrwxr-x. 1 acme acme 1398965 Jan 15 11:41 /tmp/build/perf/python/perf.so
[acme@zoo linux]$

/me scratches head, does another 'make -C tools clean' and tries again build-test + O=

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

* Re: [PATCH v3 0/9] perf build: Make build-test faster
  2016-01-15 14:36   ` Arnaldo Carvalho de Melo
  2016-01-15 14:54     ` Arnaldo Carvalho de Melo
@ 2016-01-15 14:54     ` pi3orama
  2016-01-15 15:12       ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 28+ messages in thread
From: pi3orama @ 2016-01-15 14:54 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: Jiri Olsa, Wang Nan, linux-kernel, lizefan



发自我的 iPhone

> 在 2016年1月15日,下午10:36,Arnaldo Carvalho de Melo <acme@kernel.org> 写道:
> 
> Em Fri, Jan 15, 2016 at 11:20:05AM +0100, Jiri Olsa escreveu:
>> On Fri, Jan 15, 2016 at 04:00:12AM +0000, Wang Nan wrote:
>>> Utilise Jiri's feature-dump make target to avoid make build-test check
>>> features too many times.
>>> 
>>> v2 -> v3: add $(O_OPT) to 'make clean' to ensure the correctness of
>>>          config-clean.
>>> 
>>> Jiri Olsa (2):
>>>  perf build: Add feature-dump target
>>>  perf build: Introduce FEATURES_DUMP make variable
>>> 
>>> Wang Nan (7):
>>>  perf build: Set parallel making options build-test
>>>  perf build: Pass O option to Makefile.perf in build-test
>>>  perf build: Test correct path of perf in build-test
>>>  perf build: Pass O option to kernel makefile in build-test
>>>  tools build: Allow subprojects select all feature checkers
>>>  perf build: Select all feature checkers for feature-dump
>>>  perf build: Use feature dump file for build-test
>>> 
>>> tools/build/Makefile.feature | 21 ++++++++++-
>>> tools/perf/Makefile.perf     | 34 +++++++++++++++++-
>>> tools/perf/config/Makefile   |  4 +++
>>> tools/perf/tests/make        | 86 ++++++++++++++++++++++++++++++++++++--------
>>> 4 files changed, 128 insertions(+), 17 deletions(-)
>> 
>> got error on:
>> 
>> [jolsa@krava perf]$ make -f tests/make 
>> Testing Makefile
>> readlink: missing operand
>> Try 'readlink --help' for more information.
>> - /BUILD_TEST_FEATURE_DUMP: cd . && make FEATURE_DUMP_COPY=/BUILD_TEST_FEATURE_DUMP  feature-dump
>> cd . && make FEATURE_DUMP_COPY=/BUILD_TEST_FEATURE_DUMP feature-dump
>> tests/make:329: recipe for target '/BUILD_TEST_FEATURE_DUMP' failed
>> make[1]: *** [/BUILD_TEST_FEATURE_DUMP] Error 2
>> tests/make:7: recipe for target 'all' failed
>> make: *** [all] Error 2
> 
> You mean with all patches applied, right? I haven't got that far, first
> and second patches are ok by now, I'm failing at patch 3, checking if
> setting up the python stuff to honour O= is in a later patch...
> 
> [acme@zoo linux]$ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ; make -C tools/perf O=/tmp/build/perf build-test
> make: Entering directory '/home/git/linux/tools/perf'
> Testing Makefile
> - make_no_ui: cd . && make -f Makefile   DESTDIR=/tmp/tmp.RYVWn1yMBU NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
> - make_tags: cd . && make -f Makefile   DESTDIR=/tmp/tmp.iNjVFs9Eje tags - make_python_perf_so: cd . && make -f Makefile DESTDIR=/tmp/tmp.mvHDSUV1pl python/perf.so
> cd . && make -f Makefile DESTDIR=/tmp/tmp.mvHDSUV1pl python/perf.so
>  BUILD:   Doing 'make -j4' parallel build
> 
> Auto-detecting system features:
> ...                         dwarf: [ on  ]
> ...                         glibc: [ on  ]
> ...                          gtk2: [ on  ]
> ...                      libaudit: [ on  ]
> ...                        libbfd: [ on  ]
> ...                        libelf: [ on  ]
> ...                       libnuma: [ on  ]
> ...        numa_num_possible_cpus: [ on  ]
> ...                       libperl: [ on  ]
> ...                     libpython: [ on  ]
> ...                      libslang: [ on  ]
> ...                     libunwind: [ on  ]
> ...            libdw-dwarf-unwind: [ on  ]
> ...                          zlib: [ on  ]
> ...                          lzma: [ on  ]
> ...                     get_cpuid: [ on  ]
> ...                           bpf: [ on  ]
> 
> make[4]: Nothing to be done for 'python/perf.so'.
>  test: test -f /tmp/build/perf/python/perf.so
> tests/make:272: recipe for target 'make_python_perf_so' failed
> make[2]: *** [make_python_perf_so] Error 1
> tests/make:7: recipe for target 'all' failed
> make[1]: *** [all] Error 2
> Makefile:81: recipe for target 'build-test' failed
> make: *** [build-test] Error 2
> make: Leaving directory '/home/git/linux/tools/perf'
> [acme@zoo linux]$ find . -name "*.so"
> ./tools/perf/python_ext_build/lib/perf.so
> ./tools/perf/python/perf.so
> [acme@zoo linux]$
> 
> I.e. the test -f follows O=, but the process to generate python/perf.so
> doesn't and ends up pollutting the source tree.
> 

Is your source directory already polluted
before this test?

> - Arnaldo 

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

* Re: [PATCH v3 0/9] perf build: Make build-test faster
  2016-01-15 14:54     ` pi3orama
@ 2016-01-15 15:12       ` Arnaldo Carvalho de Melo
  2016-01-15 16:33         ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 28+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-01-15 15:12 UTC (permalink / raw)
  To: pi3orama; +Cc: Jiri Olsa, Wang Nan, linux-kernel, lizefan

Em Fri, Jan 15, 2016 at 10:54:47PM +0800, pi3orama escreveu:
> 发自我的 iPhone
> > 在 2016年1月15日,下午10:36,Arnaldo Carvalho de Melo <acme@kernel.org> 写道:
> > tests/make:7: recipe for target 'all' failed
> > make[1]: *** [all] Error 2
> > Makefile:81: recipe for target 'build-test' failed
> > make: *** [build-test] Error 2
> > make: Leaving directory '/home/git/linux/tools/perf'
> > [acme@zoo linux]$ find . -name "*.so"
> > ./tools/perf/python_ext_build/lib/perf.so
> > ./tools/perf/python/perf.so
> > [acme@zoo linux]$
> > 
> > I.e. the test -f follows O=, but the process to generate python/perf.so
> > doesn't and ends up pollutting the source tree.
 
> Is your source directory already polluted
> before this test?

Yeah, that seems to have been the case, I tried reproducing this problem
using just the python perf.so target, after cleaning the sources and it
worked, then I cleaned it again and I am re-running build-test O= and it
is working so far.

- Arnaldo

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

* Re: [PATCH v3 0/9] perf build: Make build-test faster
  2016-01-15 15:12       ` Arnaldo Carvalho de Melo
@ 2016-01-15 16:33         ` Arnaldo Carvalho de Melo
  2016-01-15 18:56           ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 28+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-01-15 16:33 UTC (permalink / raw)
  To: pi3orama; +Cc: Jiri Olsa, Wang Nan, linux-kernel, lizefan

Em Fri, Jan 15, 2016 at 12:12:44PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Fri, Jan 15, 2016 at 10:54:47PM +0800, pi3orama escreveu:
> > 发自我的 iPhone
> > > 在 2016年1月15日,下午10:36,Arnaldo Carvalho de Melo <acme@kernel.org> 写道:
> > > tests/make:7: recipe for target 'all' failed
> > > make[1]: *** [all] Error 2
> > > Makefile:81: recipe for target 'build-test' failed
> > > make: *** [build-test] Error 2
> > > make: Leaving directory '/home/git/linux/tools/perf'
> > > [acme@zoo linux]$ find . -name "*.so"
> > > ./tools/perf/python_ext_build/lib/perf.so
> > > ./tools/perf/python/perf.so
> > > [acme@zoo linux]$
> > > 
> > > I.e. the test -f follows O=, but the process to generate python/perf.so
> > > doesn't and ends up pollutting the source tree.
>  
> > Is your source directory already polluted
> > before this test?
> 
> Yeah, that seems to have been the case, I tried reproducing this problem
> using just the python perf.so target, after cleaning the sources and it
> worked, then I cleaned it again and I am re-running build-test O= and it
> is working so far.

So it failed as below, but I think the next patch addresses that,
checking...


[acme@zoo linux]$ make -C tools clean > /dev/null
[acme@zoo linux]$ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ; make -C tools/perf O=/tmp/build/perf build-test
make: Entering directory '/home/git/linux/tools/perf'
Testing Makefile
- make_no_scripts: cd . && make -f Makefile   DESTDIR=/tmp/tmp.ebxs0KXpLS NO_LIBPYTHON=1 NO_LIBPERL=1
- make_install_prefix: cd . && make -f Makefile   DESTDIR=/tmp/tmp.8knT8hObin install prefix=/tmp/krava
- make_install_prefix_slash: cd . && make -f Makefile   DESTDIR=/tmp/tmp.PtuBBUNEm4 install prefix=/tmp/krava/
- make_no_slang: cd . && make -f Makefile   DESTDIR=/tmp/tmp.NuGsalvjXT NO_SLANG=1
- make_static: cd . && make -f Makefile   DESTDIR=/tmp/tmp.dmNBGO7k16 LDFLAGS=-static
- make_no_libnuma: cd . && make -f Makefile   DESTDIR=/tmp/tmp.WwPD6yz1pe NO_LIBNUMA=1
- make_no_libaudit: cd . && make -f Makefile   DESTDIR=/tmp/tmp.mDf7Jax4UP NO_LIBAUDIT=1
- make_util_pmu_bison_o: cd . && make -f Makefile   DESTDIR=/tmp/tmp.GUHuukeaAY util/pmu-bison.o
- make_minimal: cd . && make -f Makefile   DESTDIR=/tmp/tmp.Me4wc6ev1s NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1
- make_no_libdw_dwarf_unwind: cd . && make -f Makefile   DESTDIR=/tmp/tmp.K8gGGDHgOI NO_LIBDW_DWARF_UNWIND=1
- make_no_libelf: cd . && make -f Makefile   DESTDIR=/tmp/tmp.zEBoMi9upL NO_LIBELF=1
- make_install_bin: cd . && make -f Makefile   DESTDIR=/tmp/tmp.wHcrzJ8syK install-bin
- make_no_libpython: cd . && make -f Makefile   DESTDIR=/tmp/tmp.W0U2UTDBBb NO_LIBPYTHON=1
- make_clean_all: cd . && make -f Makefile   DESTDIR=/tmp/tmp.fDvqG5n4Vk clean all
- make_pure: cd . && make -f Makefile   DESTDIR=/tmp/tmp.0ehxBi2tWz 
- make_doc: cd . && make -f Makefile   DESTDIR=/tmp/tmp.1IDzclKJYr doc
- make_tags: cd . && make -f Makefile   DESTDIR=/tmp/tmp.M97WM7yQHT tags
- make_util_map_o: cd . && make -f Makefile   DESTDIR=/tmp/tmp.3k3JIZYQkF util/map.o
- make_no_demangle: cd . && make -f Makefile   DESTDIR=/tmp/tmp.oaU9AmJV5q NO_DEMANGLE=1
- make_no_libbpf: cd . && make -f Makefile   DESTDIR=/tmp/tmp.Nr53WrKVCV NO_LIBBPF=1
- make_no_libbionic: cd . && make -f Makefile   DESTDIR=/tmp/tmp.NCoXY80f7D NO_LIBBIONIC=1
- make_install: cd . && make -f Makefile   DESTDIR=/tmp/tmp.p6lAl87AJb install
- make_help: cd . && make -f Makefile   DESTDIR=/tmp/tmp.d2Nb7C1tYX help
- make_no_libperl: cd . && make -f Makefile   DESTDIR=/tmp/tmp.NuQZrm1Vk3 NO_LIBPERL=1
- make_no_gtk2: cd . && make -f Makefile   DESTDIR=/tmp/tmp.cFKxI1zKkD NO_GTK2=1
- make_python_perf_so: cd . && make -f Makefile   DESTDIR=/tmp/tmp.NlhhjNxirQ python/perf.so
- make_perf_o: cd . && make -f Makefile   DESTDIR=/tmp/tmp.w4vvERtujC perf.o
- make_no_auxtrace: cd . && make -f Makefile   DESTDIR=/tmp/tmp.mCVFdJ3oJe NO_AUXTRACE=1
^[[A- make_debug: cd . && make -f Makefile   DESTDIR=/tmp/tmp.QbMsxChc6m DEBUG=1
- make_no_libunwind: cd . && make -f Makefile   DESTDIR=/tmp/tmp.pn7CDoCg5y NO_LIBUNWIND=1
- make_no_backtrace: cd . && make -f Makefile   DESTDIR=/tmp/tmp.sjEgX8Mi6g NO_BACKTRACE=1
- make_no_ui: cd . && make -f Makefile   DESTDIR=/tmp/tmp.Z2siy3vM2Y NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
- make_no_newt: cd . && make -f Makefile   DESTDIR=/tmp/tmp.KsZASQijVx NO_NEWT=1
- make_static_O: cd . && make -f Makefile  O=/tmp/tmp.s58b5QfXab DESTDIR=/tmp/tmp.mZWXX9Df1U LDFLAGS=-static
- make_minimal_O: cd . && make -f Makefile  O=/tmp/tmp.0OtiOlr9td DESTDIR=/tmp/tmp.HOWK0TxaxH NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1
- make_debug_O: cd . && make -f Makefile  O=/tmp/tmp.9rrYyKRHzr DESTDIR=/tmp/tmp.MHCLmiXvf2 DEBUG=1
- make_no_ui_O: cd . && make -f Makefile  O=/tmp/tmp.HmZqc8g7YL DESTDIR=/tmp/tmp.pkQInGXjus NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
- make_no_scripts_O: cd . && make -f Makefile  O=/tmp/tmp.iuP1n61iZ7 DESTDIR=/tmp/tmp.1XSQavi2O9 NO_LIBPYTHON=1 NO_LIBPERL=1
- make_help_O: cd . && make -f Makefile  O=/tmp/tmp.e06tqvCiA9 DESTDIR=/tmp/tmp.0QnTdlFp6o help
- make_tags_O: cd . && make -f Makefile  O=/tmp/tmp.JWHw6jgWQs DESTDIR=/tmp/tmp.KRvp6748Qp tags
- make_no_libelf_O: cd . && make -f Makefile  O=/tmp/tmp.EGx2dwtlfc DESTDIR=/tmp/tmp.pXVOHIy5Ih NO_LIBELF=1
- make_no_libpython_O: cd . && make -f Makefile  O=/tmp/tmp.NXEf5i5WKZ DESTDIR=/tmp/tmp.zbomrpxkDa NO_LIBPYTHON=1
- make_no_libbpf_O: cd . && make -f Makefile  O=/tmp/tmp.r4solvOljc DESTDIR=/tmp/tmp.gHTqlK9QA9 NO_LIBBPF=1
- make_no_backtrace_O: cd . && make -f Makefile  O=/tmp/tmp.C80klDV6hp DESTDIR=/tmp/tmp.ltRvFoNGC3 NO_BACKTRACE=1
- make_no_libaudit_O: cd . && make -f Makefile  O=/tmp/tmp.XkoDTrU9SL DESTDIR=/tmp/tmp.ZQfjETl6Xr NO_LIBAUDIT=1
- make_doc_O: cd . && make -f Makefile  O=/tmp/tmp.Z4MsE8CUoK DESTDIR=/tmp/tmp.u9cOFoLuaj doc
- make_no_newt_O: cd . && make -f Makefile  O=/tmp/tmp.EPvbkcczit DESTDIR=/tmp/tmp.z4ukrBhmrB NO_NEWT=1
- make_install_bin_O: cd . && make -f Makefile  O=/tmp/tmp.qFut1kzFaP DESTDIR=/tmp/tmp.4hRGhjLwMf install-bin
- make_no_libbionic_O: cd . && make -f Makefile  O=/tmp/tmp.hwGtWx6xvO DESTDIR=/tmp/tmp.HeTLjeOa5o NO_LIBBIONIC=1
- make_install_prefix_slash_O: cd . && make -f Makefile  O=/tmp/tmp.w2ZzAuzyDm DESTDIR=/tmp/tmp.7CaNGyBhvI install prefix=/tmp/krava/
- make_util_pmu_bison_o_O: cd . && make -f Makefile  O=/tmp/tmp.TdujbQ1ojC DESTDIR=/tmp/tmp.sYlB6KFJbN util/pmu-bison.o
- make_no_libperl_O: cd . && make -f Makefile  O=/tmp/tmp.75pzg9Z442 DESTDIR=/tmp/tmp.KT7nxcEsM5 NO_LIBPERL=1
- make_pure_O: cd . && make -f Makefile  O=/tmp/tmp.JDM12pewQB DESTDIR=/tmp/tmp.ttF2FrRl7S 
- make_util_map_o_O: cd . && make -f Makefile  O=/tmp/tmp.iEHb6G9UrB DESTDIR=/tmp/tmp.9XFPOmTiG8 util/map.o
- make_install_O: cd . && make -f Makefile  O=/tmp/tmp.LWFSHWxCz1 DESTDIR=/tmp/tmp.R0xqgcjaW9 install
- make_perf_o_O: cd . && make -f Makefile  O=/tmp/tmp.xEoyRpMiD6 DESTDIR=/tmp/tmp.dtXcXt9iv1 perf.o
- make_no_gtk2_O: cd . && make -f Makefile  O=/tmp/tmp.PdC0pjKzS0 DESTDIR=/tmp/tmp.kWoQXgQpTC NO_GTK2=1
- make_no_slang_O: cd . && make -f Makefile  O=/tmp/tmp.rO2uKMyhIa DESTDIR=/tmp/tmp.4MhQfzUOKo NO_SLANG=1
- make_clean_all_O: cd . && make -f Makefile  O=/tmp/tmp.eo0Glmhq1L DESTDIR=/tmp/tmp.fr579qc50R clean all
- make_no_libnuma_O: cd . && make -f Makefile  O=/tmp/tmp.HFuLILIT3F DESTDIR=/tmp/tmp.MhGQWAKI3m NO_LIBNUMA=1
- make_install_prefix_O: cd . && make -f Makefile  O=/tmp/tmp.wM0K7njdQZ DESTDIR=/tmp/tmp.tR36hPS86X install prefix=/tmp/krava
- make_no_demangle_O: cd . && make -f Makefile  O=/tmp/tmp.q4hLGdY44O DESTDIR=/tmp/tmp.krSAD4nobM NO_DEMANGLE=1
- make_no_auxtrace_O: cd . && make -f Makefile  O=/tmp/tmp.Z3YUgD3PAj DESTDIR=/tmp/tmp.ih0VxwtHwC NO_AUXTRACE=1
- make_no_libunwind_O: cd . && make -f Makefile  O=/tmp/tmp.JjEjr80x2e DESTDIR=/tmp/tmp.xJC0KymqSR NO_LIBUNWIND=1
- make_no_libdw_dwarf_unwind_O: cd . && make -f Makefile  O=/tmp/tmp.FnhwxcsfD6 DESTDIR=/tmp/tmp.KHZA5BaOBy NO_LIBDW_DWARF_UNWIND=1
- tarpkg: ./tests/perf-targz-src-pkg .
- make -C <kernelsrc>  tools/perf
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
scripts/kconfig/Makefile:37: recipe for target 'silentoldconfig' failed
make[5]: *** [silentoldconfig] Error 1
Makefile:531: recipe for target 'silentoldconfig' failed
make[4]: *** [silentoldconfig] Error 2
/bin/sh: line 0: cd: /tmp/build/perf/tools/: No such file or directory
scripts/Makefile.include:16: *** output directory "/tmp/build/perf/tools/" does not exist.  Stop.
Makefile:1505: recipe for target 'tools/perf' failed
make[3]: *** [tools/perf] Error 2
tests/make:304: recipe for target 'make_kernelsrc' failed
make[2]: *** [make_kernelsrc] Error 1
tests/make:7: recipe for target 'all' failed
make[1]: *** [all] Error 2
Makefile:81: recipe for target 'build-test' failed
make: *** [build-test] Error 2
make: Leaving directory '/home/git/linux/tools/perf'
[acme@zoo linux]$ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ; make -C tools/perf O=/tmp/build/perf build-test

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

* Re: [PATCH v3 0/9] perf build: Make build-test faster
  2016-01-15 16:33         ` Arnaldo Carvalho de Melo
@ 2016-01-15 18:56           ` Arnaldo Carvalho de Melo
  2016-01-15 19:01             ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 28+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-01-15 18:56 UTC (permalink / raw)
  To: pi3orama; +Cc: Jiri Olsa, Wang Nan, linux-kernel, lizefan

Em Fri, Jan 15, 2016 at 01:33:04PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Fri, Jan 15, 2016 at 12:12:44PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Fri, Jan 15, 2016 at 10:54:47PM +0800, pi3orama escreveu:
> > > Is your source directory already polluted
> > > before this test?

> > Yeah, that seems to have been the case, I tried reproducing this problem
> > using just the python perf.so target, after cleaning the sources and it
> > worked, then I cleaned it again and I am re-running build-test O= and it
> > is working so far.
 
> So it failed as below, but I think the next patch addresses that,
> checking...

yeah, all seems ok now, moving on to the other patches:

[acme@zoo linux]$ am /wb/1.patch 
Applying: perf build: Pass O option to kernel makefile in build-test
[perf/core 95785b07fa39] perf build: Pass O option to kernel makefile in build-test
 Author: Wang Nan <wangnan0@huawei.com>
 Date: Fri Jan 15 04:00:16 2016 +0000
 1 file changed, 5 insertions(+), 4 deletions(-)
[acme@zoo linux]$ make -C tools clean > /dev/null
[acme@zoo linux]$ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ; make -C tools/perf O=/tmp/build/perf build-test
make: Entering directory '/home/git/linux/tools/perf'
Testing Makefile
- make_no_scripts: cd . && make -f Makefile   DESTDIR=/tmp/tmp.9e3h1U8KOG NO_LIBPYTHON=1 NO_LIBPERL=1
- make_no_libdw_dwarf_unwind: cd . && make -f Makefile   DESTDIR=/tmp/tmp.ielCBjwifq NO_LIBDW_DWARF_UNWIND=1
- make_no_libunwind: cd . && make -f Makefile   DESTDIR=/tmp/tmp.VsFk9OlhJ4 NO_LIBUNWIND=1
- make_debug: cd . && make -f Makefile   DESTDIR=/tmp/tmp.B6GPrhP4TR DEBUG=1
- make_no_auxtrace: cd . && make -f Makefile   DESTDIR=/tmp/tmp.yHFzIEM0di NO_AUXTRACE=1
- make_no_libbionic: cd . && make -f Makefile   DESTDIR=/tmp/tmp.liLLY8SR9V NO_LIBBIONIC=1
- make_no_slang: cd . && make -f Makefile   DESTDIR=/tmp/tmp.MpU21w7Ne4 NO_SLANG=1
- make_tags: cd . && make -f Makefile   DESTDIR=/tmp/tmp.BFB4AxWw0b tags
- make_no_newt: cd . && make -f Makefile   DESTDIR=/tmp/tmp.WBrlLwmuaQ NO_NEWT=1
- make_help: cd . && make -f Makefile   DESTDIR=/tmp/tmp.1itZi51L59 help
- make_util_pmu_bison_o: cd . && make -f Makefile   DESTDIR=/tmp/tmp.oKJl6RCTI5 util/pmu-bison.o
- make_no_ui: cd . && make -f Makefile   DESTDIR=/tmp/tmp.SNRLagfSmB NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
- make_no_libperl: cd . && make -f Makefile   DESTDIR=/tmp/tmp.q0SfxDh3f9 NO_LIBPERL=1
- make_install: cd . && make -f Makefile   DESTDIR=/tmp/tmp.YS9Fmzmhbb install
- make_no_libaudit: cd . && make -f Makefile   DESTDIR=/tmp/tmp.L2lWnN8Obu NO_LIBAUDIT=1
- make_static: cd . && make -f Makefile   DESTDIR=/tmp/tmp.U8ILyojPW2 LDFLAGS=-static
- make_install_bin: cd . && make -f Makefile   DESTDIR=/tmp/tmp.xbUxcjidLy install-bin
- make_clean_all: cd . && make -f Makefile   DESTDIR=/tmp/tmp.scPubLttK2 clean all
- make_install_prefix: cd . && make -f Makefile   DESTDIR=/tmp/tmp.F4TWRxYPPS install prefix=/tmp/krava
- make_no_libpython: cd . && make -f Makefile   DESTDIR=/tmp/tmp.cd1NhaetAd NO_LIBPYTHON=1
- make_install_prefix_slash: cd . && make -f Makefile   DESTDIR=/tmp/tmp.YPtQDUQRhJ install prefix=/tmp/krava/
- make_doc: cd . && make -f Makefile   DESTDIR=/tmp/tmp.6vrmSeiNBm doc
- make_no_libelf: cd . && make -f Makefile   DESTDIR=/tmp/tmp.hHEtz9MV1S NO_LIBELF=1
- make_util_map_o: cd . && make -f Makefile   DESTDIR=/tmp/tmp.TZqqsOZ3wD util/map.o
- make_perf_o: cd . && make -f Makefile   DESTDIR=/tmp/tmp.n4PxvIFIP3 perf.o
- make_no_libnuma: cd . && make -f Makefile   DESTDIR=/tmp/tmp.DsPUiYrwbr NO_LIBNUMA=1
- make_pure: cd . && make -f Makefile   DESTDIR=/tmp/tmp.d8ap7cgKqO 
- make_python_perf_so: cd . && make -f Makefile   DESTDIR=/tmp/tmp.TpXpRgrYgP python/perf.so
- make_no_gtk2: cd . && make -f Makefile   DESTDIR=/tmp/tmp.2fZQ4bxiAY NO_GTK2=1
- make_no_backtrace: cd . && make -f Makefile   DESTDIR=/tmp/tmp.kYBpMRNScZ NO_BACKTRACE=1
- make_no_demangle: cd . && make -f Makefile   DESTDIR=/tmp/tmp.wAxy25bSDS NO_DEMANGLE=1
- make_no_libbpf: cd . && make -f Makefile   DESTDIR=/tmp/tmp.KqJduwYzDL NO_LIBBPF=1
- make_minimal: cd . && make -f Makefile   DESTDIR=/tmp/tmp.io1jsbHzDq NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1
- make_no_newt_O: cd . && make -f Makefile  O=/tmp/tmp.EooWikAT82 DESTDIR=/tmp/tmp.LKKTwY1eCP NO_NEWT=1
- make_pure_O: cd . && make -f Makefile  O=/tmp/tmp.f1QBvSbLrW DESTDIR=/tmp/tmp.hpbdecldPt 
- make_no_libbionic_O: cd . && make -f Makefile  O=/tmp/tmp.nX2TIOQqo6 DESTDIR=/tmp/tmp.DkSnjDSMYw NO_LIBBIONIC=1
- make_util_map_o_O: cd . && make -f Makefile  O=/tmp/tmp.cKFa9e56rx DESTDIR=/tmp/tmp.YbSqeV5cey util/map.o
- make_install_prefix_slash_O: cd . && make -f Makefile  O=/tmp/tmp.0c5HPFfFm9 DESTDIR=/tmp/tmp.XrB8aILqpP install prefix=/tmp/krava/
- make_help_O: cd . && make -f Makefile  O=/tmp/tmp.d2gYO1gjTR DESTDIR=/tmp/tmp.q5c0WnVCIj help
- make_install_prefix_O: cd . && make -f Makefile  O=/tmp/tmp.9IHAupXFHk DESTDIR=/tmp/tmp.TXmXyyJppI install prefix=/tmp/krava
- make_no_scripts_O: cd . && make -f Makefile  O=/tmp/tmp.rKwTvo0QiI DESTDIR=/tmp/tmp.PpUf2AoVzI NO_LIBPYTHON=1 NO_LIBPERL=1
- make_no_slang_O: cd . && make -f Makefile  O=/tmp/tmp.WPj6PaqPhL DESTDIR=/tmp/tmp.NlpNS6h9h9 NO_SLANG=1
- make_no_libpython_O: cd . && make -f Makefile  O=/tmp/tmp.QcCMMUXW3U DESTDIR=/tmp/tmp.00FbzdgxZl NO_LIBPYTHON=1
- make_util_pmu_bison_o_O: cd . && make -f Makefile  O=/tmp/tmp.CEa5MybV5v DESTDIR=/tmp/tmp.40p7E7M3qH util/pmu-bison.o
- make_no_ui_O: cd . && make -f Makefile  O=/tmp/tmp.uRX0vUtPup DESTDIR=/tmp/tmp.qazyj9H0pS NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
- make_no_libnuma_O: cd . && make -f Makefile  O=/tmp/tmp.rpye8ZsMTK DESTDIR=/tmp/tmp.dNTvUFLl1f NO_LIBNUMA=1


- make_no_libelf_O: cd . && make -f Makefile  O=/tmp/tmp.hUaf8XWJHC DESTDIR=/tmp/tmp.kM8iyYXhRi NO_LIBELF=1
- make_static_O: cd . && make -f Makefile  O=/tmp/tmp.BlVAbCLrQB DESTDIR=/tmp/tmp.UbYeVZv3lH LDFLAGS=-static
- make_no_libbpf_O: cd . && make -f Makefile  O=/tmp/tmp.Zqq3W2d4BW DESTDIR=/tmp/tmp.IwIuWZOBuT NO_LIBBPF=1
- make_no_libaudit_O: cd . && make -f Makefile  O=/tmp/tmp.vEYe0dQPqq DESTDIR=/tmp/tmp.E7DgjrMysh NO_LIBAUDIT=1
- make_no_demangle_O: cd . && make -f Makefile  O=/tmp/tmp.ZfdZY7hkNY DESTDIR=/tmp/tmp.ChdGh6TELl NO_DEMANGLE=1
- make_no_libunwind_O: cd . && make -f Makefile  O=/tmp/tmp.heHCR5TLb0 DESTDIR=/tmp/tmp.jNPh6IHibS NO_LIBUNWIND=1
- make_no_libperl_O: cd . && make -f Makefile  O=/tmp/tmp.tnAQYN9WZP DESTDIR=/tmp/tmp.MB2rgbPwO9 NO_LIBPERL=1
- make_no_auxtrace_O: cd . && make -f Makefile  O=/tmp/tmp.RvYcIFTyLc DESTDIR=/tmp/tmp.uvi4zw8J3x NO_AUXTRACE=1
- make_no_gtk2_O: cd . && make -f Makefile  O=/tmp/tmp.MKlGNsxGo6 DESTDIR=/tmp/tmp.3ccm3f6npC NO_GTK2=1
- make_doc_O: cd . && make -f Makefile  O=/tmp/tmp.NGd3OCaTgY DESTDIR=/tmp/tmp.vI8BBvl7J4 doc
- make_no_libdw_dwarf_unwind_O: cd . && make -f Makefile  O=/tmp/tmp.jR9j4r9Ue3 DESTDIR=/tmp/tmp.rpomb0UTjF NO_LIBDW_DWARF_UNWIND=1
- make_minimal_O: cd . && make -f Makefile  O=/tmp/tmp.isdFMzlmCE DESTDIR=/tmp/tmp.7PoEaJuqAo NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1
- make_tags_O: cd . && make -f Makefile  O=/tmp/tmp.h7xE1RiYV9 DESTDIR=/tmp/tmp.KyWT8krOHn tags
- make_no_backtrace_O: cd . && make -f Makefile  O=/tmp/tmp.ATWAT8F96o DESTDIR=/tmp/tmp.jMc7gWwMzE NO_BACKTRACE=1
- make_install_bin_O: cd . && make -f Makefile  O=/tmp/tmp.UQYgkHm0Gt DESTDIR=/tmp/tmp.kNKAIKLcmd install-bin
- make_clean_all_O: cd . && make -f Makefile  O=/tmp/tmp.YNrDdpfD4u DESTDIR=/tmp/tmp.wzU1HzSmir clean all
- make_debug_O: cd . && make -f Makefile  O=/tmp/tmp.vwN6Q1EKmt DESTDIR=/tmp/tmp.XYzOQIRi3O DEBUG=1
- make_install_O: cd . && make -f Makefile  O=/tmp/tmp.nTVLcnN0TM DESTDIR=/tmp/tmp.F6RYnEA8fO install
- make_perf_o_O: cd . && make -f Makefile  O=/tmp/tmp.O9VK5E6CA8 DESTDIR=/tmp/tmp.PNbredSZ2m perf.o
- tarpkg: ./tests/perf-targz-src-pkg .
- make -C <kernelsrc>  'O=/tmp/build/perf' tools/perf
- make -C <kernelsrc>/tools  'O=/tmp/build/perf' perf
OK
Testing Makefile.perf
- make_no_libunwind: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.WiV8YRc0ca NO_LIBUNWIND=1
- make_no_libperl: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.E0esZJUIRM NO_LIBPERL=1
- make_no_libdw_dwarf_unwind: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.4BW18lpL0G NO_LIBDW_DWARF_UNWIND=1
- make_tags: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.O1vtgxuW5J tags
- make_pure: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.JpKmEfP2xL 
- make_install: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.Uy2YCFl8aL install
- make_debug: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.orQ0PEn7q7 DEBUG=1
- make_no_libnuma: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.JVvIO6KiW0 NO_LIBNUMA=1
- make_help: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.lWZjV4PNIX help
- make_no_backtrace: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.VSamCzNVkx NO_BACKTRACE=1
- make_install_prefix: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.qoqcT0yUyR install prefix=/tmp/krava
- make_no_libbpf: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.RFA0xJtwvZ NO_LIBBPF=1
- make_no_slang: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.HFwhjBiLEq NO_SLANG=1
- make_no_libpython: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.mriG6UduU2 NO_LIBPYTHON=1
- make_static: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.b6yIt0P1S5 LDFLAGS=-static
- make_util_map_o: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.T5mnTqHfD4 util/map.o
- make_install_bin: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.CSyog3ewkh install-bin
- make_no_demangle: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.abuqwbrt1C NO_DEMANGLE=1
- make_install_prefix_slash: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.rxribPrdFl install prefix=/tmp/krava/
- make_no_scripts: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.hSAvz6PQr9 NO_LIBPYTHON=1 NO_LIBPERL=1
- make_no_ui: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.67P4I3awig NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
- make_minimal: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.etLVSOscHq NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1
- make_util_pmu_bison_o: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.TfUfOFfy78 util/pmu-bison.o
- make_no_libbionic: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.pNS61Cy0Ns NO_LIBBIONIC=1
- make_doc: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.Bd2WWkoBqb doc
- make_python_perf_so: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.6s3Y2ihG2Q python/perf.so
- make_no_auxtrace: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.lzprQr7SNq NO_AUXTRACE=1
- make_no_libelf: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.j7KaXdllzt NO_LIBELF=1
- make_no_newt: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.cPHEHtp6XC NO_NEWT=1
- make_perf_o: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.vJ8YCjrWMW perf.o
- make_no_gtk2: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.otDPiQ7ekA NO_GTK2=1
- make_no_libaudit: cd . && make -f Makefile.perf -j4 'O=/tmp/build/perf' DESTDIR=/tmp/tmp.iyaUgsHS9D NO_LIBAUDIT=1
- make_no_libbionic_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.PHAPShJgdv DESTDIR=/tmp/tmp.BLyod8Lxdx NO_LIBBIONIC=1
- make_no_libpython_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.EBbIVyMVRS DESTDIR=/tmp/tmp.uV9pUJhIi4 NO_LIBPYTHON=1
- make_no_libnuma_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.pCHomupSOh DESTDIR=/tmp/tmp.NGhpHI9BlK NO_LIBNUMA=1
- make_no_libdw_dwarf_unwind_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.M3oAHBGBQO DESTDIR=/tmp/tmp.cdEwiDP9EE NO_LIBDW_DWARF_UNWIND=1
- make_install_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.6GO71jDnf3 DESTDIR=/tmp/tmp.x1U8qNxFTN install
- make_no_demangle_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.AtgBaluMI4 DESTDIR=/tmp/tmp.tq6BS9WW81 NO_DEMANGLE=1
- make_install_prefix_slash_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.r17hjIKTdb DESTDIR=/tmp/tmp.mv9Q7PBN6K install prefix=/tmp/krava/
- make_no_newt_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.hnWkGje852 DESTDIR=/tmp/tmp.I9HXWd0CqZ NO_NEWT=1
- make_install_bin_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.FBp8AGOH15 DESTDIR=/tmp/tmp.CkCncZ2Zj2 install-bin
- make_no_libelf_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.ftstCEM1AT DESTDIR=/tmp/tmp.7KuQfqfrDq NO_LIBELF=1
- make_util_pmu_bison_o_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.0fFKbguZOb DESTDIR=/tmp/tmp.EDZ7IVvbUC util/pmu-bison.o
- make_no_libunwind_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.UrBvT8H2kL DESTDIR=/tmp/tmp.VAK3vzTBgf NO_LIBUNWIND=1
- make_no_slang_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.UahVvDh7cK DESTDIR=/tmp/tmp.U55STRYr9c NO_SLANG=1
- make_tags_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.ivZzE1EpPO DESTDIR=/tmp/tmp.svRAllyX2g tags
- make_pure_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.mt98wEusKP DESTDIR=/tmp/tmp.vG1l4mMjoO 
- make_no_libperl_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.5GY6cUriLs DESTDIR=/tmp/tmp.zXyTg24HbY NO_LIBPERL=1
- make_util_map_o_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.yquyLn8t3f DESTDIR=/tmp/tmp.BVUkcWunhh util/map.o
- make_doc_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.xDecKgMdU9 DESTDIR=/tmp/tmp.VVZyZIlFlF doc
- make_no_auxtrace_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.feLB8n0JNb DESTDIR=/tmp/tmp.DzOTCnhTkT NO_AUXTRACE=1
- make_no_backtrace_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.jMpJqaCI0t DESTDIR=/tmp/tmp.EpxWmAHpjg NO_BACKTRACE=1
- make_no_scripts_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.FoiUCP0FCj DESTDIR=/tmp/tmp.M5Fj5u19fp NO_LIBPYTHON=1 NO_LIBPERL=1
- make_no_ui_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.DnnDKVOcke DESTDIR=/tmp/tmp.ukA50Wc45r NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
- make_static_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.9CUGpwQYQC DESTDIR=/tmp/tmp.zdksskX0pR LDFLAGS=-static
- make_help_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.UArxgwazPc DESTDIR=/tmp/tmp.NVBwebgs4a help
- make_debug_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.Utqra7B7Ib DESTDIR=/tmp/tmp.omIS9KmXbP DEBUG=1
- make_no_libbpf_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.E25tFn9wLe DESTDIR=/tmp/tmp.LCIwFwucVk NO_LIBBPF=1
- make_install_prefix_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.ISR9EFrkrf DESTDIR=/tmp/tmp.yGBkllIGmb install prefix=/tmp/krava
- make_no_gtk2_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.ChgCwmQVsq DESTDIR=/tmp/tmp.VCIaqDoBND NO_GTK2=1
- make_minimal_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.PSotNLP7Hm DESTDIR=/tmp/tmp.zXeBkOxRfn NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1
- make_no_libaudit_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.6MXxYuHakK DESTDIR=/tmp/tmp.YAt3RK6DPR NO_LIBAUDIT=1
- make_perf_o_O: cd . && make -f Makefile.perf -j4 O=/tmp/tmp.aHK53VzNGb DESTDIR=/tmp/tmp.XksUEUWgiW perf.o
- tarpkg: ./tests/perf-targz-src-pkg .
- make -C <kernelsrc> -j4 'O=/tmp/build/perf' tools/perf
- make -C <kernelsrc>/tools -j4 'O=/tmp/build/perf' perf
OK
make: Leaving directory '/home/git/linux/tools/perf'
[acme@zoo linux]$ 
[acme@zoo linux]$ 
[acme@zoo linux]$ find tools -name "*.o"
[acme@zoo linux]$ find tools -name ".*.*"
[acme@zoo linux]$

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

* Re: [PATCH v3 0/9] perf build: Make build-test faster
  2016-01-15 18:56           ` Arnaldo Carvalho de Melo
@ 2016-01-15 19:01             ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 28+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-01-15 19:01 UTC (permalink / raw)
  To: pi3orama; +Cc: Jiri Olsa, Wang Nan, linux-kernel, lizefan

> > > Em Fri, Jan 15, 2016 at 10:54:47PM +0800, pi3orama escreveu:
> > > > Is your source directory already polluted before this test?

But it would be really great to be able to run the test that builds in
the source tree at the same time as the one that uses O=, to parallelise
it in big machines and also to avoid these kinds of errors.

Till then I'll make sure I run 'make -C tools clean' before each test
:-\

- Arnaldo

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

* Re: [PATCH v3 5/9] perf build: Add feature-dump target
  2016-01-15  4:00 ` [PATCH v3 5/9] perf build: Add feature-dump target Wang Nan
@ 2016-01-15 19:11   ` Arnaldo Carvalho de Melo
  2016-01-15 19:23     ` Arnaldo Carvalho de Melo
  2016-01-19 13:36   ` [tip:perf/urgent] " tip-bot for Jiri Olsa
  1 sibling, 1 reply; 28+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-01-15 19:11 UTC (permalink / raw)
  To: Wang Nan; +Cc: jolsa, linux-kernel, pi3orama, lizefan, Jiri Olsa

Em Fri, Jan 15, 2016 at 04:00:17AM +0000, Wang Nan escreveu:
> From: Jiri Olsa <jolsa@kernel.org>
> 
> To provide FEATURE-DUMP into $(FEATURE_DUMP_COPY)
> if defined, with no further action.
> 
> Get feature dump of the current build:
>   $ make feature-dump
>     BUILD:   Doing 'make -j4' parallel build
> 
>   Auto-detecting system features:
>   ...                         dwarf: [ on  ]
> 
>   FEATURE-DUMP file available in FEATURE-DUMP

Trying to improve this, i.e. provide an absolute or relative path to where
the file is really generated.

[acme@zoo linux]$ make -C tools/perf feature-dump
make: Entering directory '/home/git/linux/tools/perf'
  BUILD:   Doing 'make -j4' parallel build

Auto-detecting system features:
...                         dwarf: [ on  ]
...                         glibc: [ on  ]
...                          gtk2: [ on  ]
...                      libaudit: [ on  ]
...                        libbfd: [ on  ]
...                        libelf: [ on  ]
...                       libnuma: [ on  ]
...        numa_num_possible_cpus: [ on  ]
...                       libperl: [ on  ]
...                     libpython: [ on  ]
...                      libslang: [ on  ]
...                     libunwind: [ on  ]
...            libdw-dwarf-unwind: [ on  ]
...                          zlib: [ on  ]
...                          lzma: [ on  ]
...                     get_cpuid: [ on  ]
...                           bpf: [ on  ]

FEATURE-DUMP file available in FEATURE-DUMP
make: Leaving directory '/home/git/linux/tools/perf'
[acme@zoo linux]$ cat FEATURE-DUMP
cat: FEATURE-DUMP: No such file or directory
[acme@zoo linux]$ find . -name FEATURE-DUMP
./tools/perf/FEATURE-DUMP
[acme@zoo linux]$ 

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

* Re: [PATCH v3 5/9] perf build: Add feature-dump target
  2016-01-15 19:11   ` Arnaldo Carvalho de Melo
@ 2016-01-15 19:23     ` Arnaldo Carvalho de Melo
  2016-01-15 19:27       ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 28+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-01-15 19:23 UTC (permalink / raw)
  To: Wang Nan; +Cc: jolsa, linux-kernel, pi3orama, lizefan, Jiri Olsa

Em Fri, Jan 15, 2016 at 04:11:39PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Fri, Jan 15, 2016 at 04:00:17AM +0000, Wang Nan escreveu:
> > From: Jiri Olsa <jolsa@kernel.org>
> > 
> > To provide FEATURE-DUMP into $(FEATURE_DUMP_COPY)
> > if defined, with no further action.
> > 
> > Get feature dump of the current build:
> >   $ make feature-dump
> >     BUILD:   Doing 'make -j4' parallel build
> > 
> >   Auto-detecting system features:
> >   ...                         dwarf: [ on  ]
> > 
> >   FEATURE-DUMP file available in FEATURE-DUMP
> 
> Trying to improve this, i.e. provide an absolute or relative path to where
> the file is really generated.
> 
> 
> FEATURE-DUMP file available in FEATURE-DUMP
> make: Leaving directory '/home/git/linux/tools/perf'
> [acme@zoo linux]$ cat FEATURE-DUMP
> cat: FEATURE-DUMP: No such file or directory
> [acme@zoo linux]$ find . -name FEATURE-DUMP
> ./tools/perf/FEATURE-DUMP
> [acme@zoo linux]$ 

Like what is done here already:

$(LIBBPF): fixdep FORCE
        $(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) $(OUTPUT)libbpf.a FEATURES_DUMP=$(realpath $(OUTPUT)FEATURE-DUMP)

I.e. use realphat, like:


[acme@zoo linux]$ git diff
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index f758a72df1b3..ec701e61c9bd 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -618,7 +618,7 @@ ifdef FEATURE_DUMP_COPY
        @cp $(OUTPUT)FEATURE-DUMP $(FEATURE_DUMP_COPY)
        @echo "FEATURE-DUMP file copied into $(FEATURE_DUMP_COPY)"
 else
-       @echo "FEATURE-DUMP file available in $(OUTPUT)FEATURE-DUMP"
+       @echo "FEATURE-DUMP file available in $(realpath $(OUTPUT)FEATURE-DUMP)"
 endif
 
 #
[acme@zoo linux]$ make -C tools/perf feature-dump
make: Entering directory '/home/git/linux/tools/perf'
  BUILD:   Doing 'make -j4' parallel build

Auto-detecting system features:
...                         dwarf: [ on  ]
...                         glibc: [ on  ]
...                          gtk2: [ on  ]
...                      libaudit: [ on  ]
...                        libbfd: [ on  ]
...                        libelf: [ on  ]
...                       libnuma: [ on  ]
...        numa_num_possible_cpus: [ on  ]
...                       libperl: [ on  ]
...                     libpython: [ on  ]
...                      libslang: [ on  ]
...                     libunwind: [ on  ]
...            libdw-dwarf-unwind: [ on  ]
...                          zlib: [ on  ]
...                          lzma: [ on  ]
...                     get_cpuid: [ on  ]
...                           bpf: [ on  ]

FEATURE-DUMP file available in /home/git/linux/tools/perf/FEATURE-DUMP
make: Leaving directory '/home/git/linux/tools/perf'
[acme@zoo linux]$


Nitpicking a bit: libbpf uses FEATURES_DUMP, i.e. plural, which I think
is the proper naming, as there are multiple features being detected and
thus dumped, would you mind if I chainsaw it all into consistency using
FEATURES-DUMP, FEATURES_DUMP, etc?

- Arnaldo

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

* Re: [PATCH v3 5/9] perf build: Add feature-dump target
  2016-01-15 19:23     ` Arnaldo Carvalho de Melo
@ 2016-01-15 19:27       ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 28+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-01-15 19:27 UTC (permalink / raw)
  To: Wang Nan; +Cc: jolsa, linux-kernel, pi3orama, lizefan, Jiri Olsa

Em Fri, Jan 15, 2016 at 04:23:52PM -0300, Arnaldo Carvalho de Melo escreveu:
> Nitpicking a bit: libbpf uses FEATURES_DUMP, i.e. plural, which I think
> is the proper naming, as there are multiple features being detected and
> thus dumped, would you mind if I chainsaw it all into consistency using
> FEATURES-DUMP, FEATURES_DUMP, etc?

Oh well, saw the next patch in this series, it then uses FEATURES_DUMP,
will leave this for later when the whole series gets applied...

- Arnaldo

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

* [tip:perf/urgent] perf build: Pass O option to Makefile.perf in build-test
  2016-01-15  4:00 ` [PATCH v3 2/9] perf build: Pass O option to Makefile.perf in build-test Wang Nan
@ 2016-01-19 13:35   ` tip-bot for Wang Nan
  0 siblings, 0 replies; 28+ messages in thread
From: tip-bot for Wang Nan @ 2016-01-19 13:35 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: wangnan0, tglx, linux-kernel, jolsa, mingo, namhyung, hpa, lizefan, acme

Commit-ID:  eb807730c034090599135bc03578015ebf8974af
Gitweb:     http://git.kernel.org/tip/eb807730c034090599135bc03578015ebf8974af
Author:     Wang Nan <wangnan0@huawei.com>
AuthorDate: Fri, 15 Jan 2016 04:00:14 +0000
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 15 Jan 2016 16:31:59 -0300

perf build: Pass O option to Makefile.perf in build-test

Unlike tools/perf/Makefile, tools/perf/Makefile.perf obey 'O' option
when it is passed through cmdline only, due to code in
tools/scripts/Makefile.include:

 ifneq ($(O),)
 ifeq ($(origin O), command line)
 	...
 	ABSOLUTE_O := $(shell cd $(O) ; pwd)
 	OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
 endif
 endif

This patch passes 'O' to Makefile.perf through cmdline explicitly
to make it follow O variable during build-test.

'make clean' should have identical 'O' option with 'make'. If not,
config-clean may error.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1452830421-77757-3-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/make | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index c0ee679..fc2a9a3 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -5,7 +5,7 @@ ifeq ($(MAKECMDGOALS),)
 # no target specified, trigger the whole suite
 all:
 	@echo "Testing Makefile";      $(MAKE) -sf tests/make MK=Makefile
-	@echo "Testing Makefile.perf"; $(MAKE) -sf tests/make MK=Makefile.perf SET_PARALLEL=1
+	@echo "Testing Makefile.perf"; $(MAKE) -sf tests/make MK=Makefile.perf SET_PARALLEL=1 SET_O=1
 else
 # run only specific test over 'Makefile'
 %:
@@ -13,6 +13,14 @@ else
 endif
 else
 PERF := .
+O_OPT :=
+
+ifneq ($(O),)
+  FULL_O := $(shell readlink -f $(O) || echo $(O))
+  ifeq ($(SET_O),1)
+    O_OPT := 'O=$(FULL_O)'
+  endif
+endif
 
 PARALLEL_OPT=
 ifeq ($(SET_PARALLEL),1)
@@ -256,12 +264,12 @@ endif
 
 MAKEFLAGS := --no-print-directory
 
-clean := @(cd $(PERF); make -s -f $(MK) clean >/dev/null)
+clean := @(cd $(PERF); make -s -f $(MK) $(O_OPT) clean >/dev/null)
 
 $(run):
 	$(call clean)
 	@TMP_DEST=$$(mktemp -d); \
-	cmd="cd $(PERF) && make -f $(MK) $(PARALLEL_OPT) DESTDIR=$$TMP_DEST $($@)"; \
+	cmd="cd $(PERF) && make -f $(MK) $(PARALLEL_OPT) $(O_OPT) DESTDIR=$$TMP_DEST $($@)"; \
 	echo "- $@: $$cmd" && echo $$cmd > $@ && \
 	( eval $$cmd ) >> $@ 2>&1; \
 	echo "  test: $(call test,$@)" >> $@ 2>&1; \

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

* [tip:perf/urgent] perf build: Test correct path of perf in build-test
  2016-01-15  4:00 ` [PATCH v3 3/9] perf build: Test correct path of perf " Wang Nan
@ 2016-01-19 13:35   ` tip-bot for Wang Nan
  0 siblings, 0 replies; 28+ messages in thread
From: tip-bot for Wang Nan @ 2016-01-19 13:35 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, mingo, acme, jolsa, namhyung, lizefan, linux-kernel, wangnan0, tglx

Commit-ID:  68824de19a0b4cdc17193cb004c55d82c06af8bd
Gitweb:     http://git.kernel.org/tip/68824de19a0b4cdc17193cb004c55d82c06af8bd
Author:     Wang Nan <wangnan0@huawei.com>
AuthorDate: Fri, 15 Jan 2016 04:00:15 +0000
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 15 Jan 2016 16:31:59 -0300

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>
---
 tools/perf/tests/make | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index fc2a9a3..29810cf 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -13,10 +13,12 @@ else
 endif
 else
 PERF := .
+PERF_O := $(PERF)
 O_OPT :=
 
 ifneq ($(O),)
   FULL_O := $(shell readlink -f $(O) || echo $(O))
+  PERF_O := $(FULL_O)
   ifeq ($(SET_O),1)
     O_OPT := 'O=$(FULL_O)'
   endif
@@ -173,11 +175,11 @@ test_make_doc    := $(test_ok)
 test_make_help_O := $(test_ok)
 test_make_doc_O  := $(test_ok)
 
-test_make_python_perf_so := test -f $(PERF)/python/perf.so
+test_make_python_perf_so := test -f $(PERF_O)/python/perf.so
 
-test_make_perf_o           := test -f $(PERF)/perf.o
-test_make_util_map_o       := test -f $(PERF)/util/map.o
-test_make_util_pmu_bison_o := test -f $(PERF)/util/pmu-bison.o
+test_make_perf_o           := test -f $(PERF_O)/perf.o
+test_make_util_map_o       := test -f $(PERF_O)/util/map.o
+test_make_util_pmu_bison_o := test -f $(PERF_O)/util/pmu-bison.o
 
 define test_dest_files
   for file in $(1); do				\
@@ -244,7 +246,7 @@ test_make_perf_o_O            := test -f $$TMP_O/perf.o
 test_make_util_map_o_O        := test -f $$TMP_O/util/map.o
 test_make_util_pmu_bison_o_O := test -f $$TMP_O/util/pmu-bison.o
 
-test_default = test -x $(PERF)/perf
+test_default = test -x $(PERF_O)/perf
 test = $(if $(test_$1),$(test_$1),$(test_default))
 
 test_default_O = test -x $$TMP_O/perf
@@ -293,17 +295,22 @@ tarpkg:
 	( eval $$cmd ) >> $@ 2>&1 && \
 	rm -f $@
 
+KERNEL_O := ../..
+ifneq ($(O),)
+  KERNEL_O := $(O)
+endif
+
 make_kernelsrc:
 	@echo "- make -C <kernelsrc> $(PARALLEL_OPT) tools/perf"
 	$(call clean); \
 	(make -C ../.. $(PARALLEL_OPT) tools/perf) > $@ 2>&1 && \
-	test -x perf && rm -f $@ || (cat $@ ; false)
+	test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false)
 
 make_kernelsrc_tools:
 	@echo "- make -C <kernelsrc>/tools $(PARALLEL_OPT) perf"
 	$(call clean); \
 	(make -C ../../tools $(PARALLEL_OPT) perf) > $@ 2>&1 && \
-	test -x perf && rm -f $@ || (cat $@ ; false)
+	test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false)
 
 all: $(run) $(run_O) tarpkg make_kernelsrc make_kernelsrc_tools
 	@echo OK

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

* [tip:perf/urgent] perf build: Pass O option to kernel makefile in build-test
  2016-01-15  4:00 ` [PATCH v3 4/9] perf build: Pass O option to kernel makefile " Wang Nan
@ 2016-01-19 13:35   ` tip-bot for Wang Nan
  0 siblings, 0 replies; 28+ messages in thread
From: tip-bot for Wang Nan @ 2016-01-19 13:35 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: wangnan0, lizefan, namhyung, acme, linux-kernel, tglx, mingo, jolsa, hpa

Commit-ID:  c15e758c4bd7fbe38983e36258541ffcf81e1500
Gitweb:     http://git.kernel.org/tip/c15e758c4bd7fbe38983e36258541ffcf81e1500
Author:     Wang Nan <wangnan0@huawei.com>
AuthorDate: Fri, 15 Jan 2016 04:00:16 +0000
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 15 Jan 2016 16:32:00 -0300

perf build: Pass O option to kernel makefile in build-test

Kernel makefile only follows an 'O' option passed from command line
explicitely. In build-test with 'O' option set, kernel makefile
contaminate kernel source directory. Build test also fail if we don't
create output directory manually.

K_O_OPT is added and passed to kernel makefile if 'O' is passed
to build-test.

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-5-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/make | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index 29810cf..f918015 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -22,6 +22,7 @@ ifneq ($(O),)
   ifeq ($(SET_O),1)
     O_OPT := 'O=$(FULL_O)'
   endif
+  K_O_OPT := 'O=$(FULL_O)'
 endif
 
 PARALLEL_OPT=
@@ -301,15 +302,15 @@ ifneq ($(O),)
 endif
 
 make_kernelsrc:
-	@echo "- make -C <kernelsrc> $(PARALLEL_OPT) tools/perf"
+	@echo "- make -C <kernelsrc> $(PARALLEL_OPT) $(K_O_OPT) tools/perf"
 	$(call clean); \
-	(make -C ../.. $(PARALLEL_OPT) tools/perf) > $@ 2>&1 && \
+	(make -C ../.. $(PARALLEL_OPT) $(K_O_OPT) tools/perf) > $@ 2>&1 && \
 	test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false)
 
 make_kernelsrc_tools:
-	@echo "- make -C <kernelsrc>/tools $(PARALLEL_OPT) perf"
+	@echo "- make -C <kernelsrc>/tools $(PARALLEL_OPT) $(K_O_OPT) perf"
 	$(call clean); \
-	(make -C ../../tools $(PARALLEL_OPT) perf) > $@ 2>&1 && \
+	(make -C ../../tools $(PARALLEL_OPT) $(K_O_OPT) perf) > $@ 2>&1 && \
 	test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false)
 
 all: $(run) $(run_O) tarpkg make_kernelsrc make_kernelsrc_tools

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

* [tip:perf/urgent] perf build: Add feature-dump target
  2016-01-15  4:00 ` [PATCH v3 5/9] perf build: Add feature-dump target Wang Nan
  2016-01-15 19:11   ` Arnaldo Carvalho de Melo
@ 2016-01-19 13:36   ` tip-bot for Jiri Olsa
  1 sibling, 0 replies; 28+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-19 13:36 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: jolsa, acme, mingo, wangnan0, linux-kernel, lizefan, hpa, tglx

Commit-ID:  b8e52be00ca7e7659e8ee172ce9e6f0c6af28ec8
Gitweb:     http://git.kernel.org/tip/b8e52be00ca7e7659e8ee172ce9e6f0c6af28ec8
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Fri, 15 Jan 2016 04:00:17 +0000
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 15 Jan 2016 16:32:00 -0300

perf build: Add feature-dump target

To provide FEATURE-DUMP into $(FEATURE_DUMP_COPY) if defined, with no
further action.

Get feature dump of the current build:
  $ make feature-dump
    BUILD:   Doing 'make -j4' parallel build

  Auto-detecting system features:
  ...                         dwarf: [ on  ]

  FEATURE-DUMP file available in FEATURE-DUMP

Get feature dump static build into /tmp/fd file:

  $ make feature-dump FEATURE_DUMP_COPY=/tmp/fd LDFLAGS=-static
    BUILD:   Doing 'make -j4' parallel build

  Auto-detecting system features:
  ...                         dwarf: [ OFF ]

  SNIP

  FEATURE-DUMP file copied into /tmp/fd

Suggested-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1452830421-77757-6-git-send-email-wangnan0@huawei.com
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile.perf | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 0a22407..f758a72 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -611,6 +611,17 @@ clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean
 	$(python-clean)
 
 #
+# To provide FEATURE-DUMP into $(FEATURE_DUMP_COPY)
+# file if defined, with no further action.
+feature-dump:
+ifdef FEATURE_DUMP_COPY
+	@cp $(OUTPUT)FEATURE-DUMP $(FEATURE_DUMP_COPY)
+	@echo "FEATURE-DUMP file copied into $(FEATURE_DUMP_COPY)"
+else
+	@echo "FEATURE-DUMP file available in $(OUTPUT)FEATURE-DUMP"
+endif
+
+#
 # Trick: if ../../.git does not exist - we are building out of tree for example,
 # then force version regeneration:
 #

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

* [tip:perf/urgent] perf build: Introduce FEATURES_DUMP make variable
  2016-01-15  4:00 ` [PATCH v3 6/9] perf build: Introduce FEATURES_DUMP make variable Wang Nan
@ 2016-01-19 13:36   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 28+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-19 13:36 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, linux-kernel, hpa, lizefan, mingo, acme, wangnan0, jolsa

Commit-ID:  96b9e70b8e6cd65f71ee71889143976f3afb038a
Gitweb:     http://git.kernel.org/tip/96b9e70b8e6cd65f71ee71889143976f3afb038a
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Fri, 15 Jan 2016 04:00:18 +0000
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 15 Jan 2016 16:32:00 -0300

perf build: Introduce FEATURES_DUMP make variable

Introducing FEATURES_DUMP make variable to provide features
detection dump file and bypass the feature detection.

The intention is to use this during build tests to skip
repeated features detection, like:

Get feature dump static build into /tmp/fd file:
  $ make feature-dump FEATURE_DUMP_COPY=/tmp/fd LDFLAGS=-static
    BUILD:   Doing 'make -j4' parallel build

  Auto-detecting system features:
  ...                         dwarf: [ OFF ]

  SNIP

  FEATURE-DUMP file copied into /tmp/fd

Use /tmp/fd to build perf:
  $ make FEATURES_DUMP=/tmp/fd LDFLAGS=-static

  $ file perf
  perf: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for ...

Suggested-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1452830421-77757-7-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile.perf   | 14 +++++++++++++-
 tools/perf/config/Makefile |  4 ++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index f758a72..5d34815 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -77,6 +77,9 @@ include config/utilities.mak
 # Define NO_AUXTRACE if you do not want AUX area tracing support
 #
 # Define NO_LIBBPF if you do not want BPF support
+#
+# Define FEATURES_DUMP to provide features detection dump file
+# and bypass the feature detection
 
 # As per kernel Makefile, avoid funny character set dependencies
 unexport LC_ALL
@@ -166,6 +169,15 @@ ifeq ($(config),1)
 include config/Makefile
 endif
 
+# The FEATURE_DUMP_EXPORT holds location of the actual
+# FEATURE_DUMP file to be used to bypass feature detection
+# (for bpf or any other subproject)
+ifeq ($(FEATURES_DUMP),)
+FEATURE_DUMP_EXPORT := $(realpath $(OUTPUT)FEATURE-DUMP)
+else
+FEATURE_DUMP_EXPORT := $(FEATURES_DUMP)
+endif
+
 export prefix bindir sharedir sysconfdir DESTDIR
 
 # sparse is architecture-neutral, which means that we need to tell it
@@ -436,7 +448,7 @@ $(LIBAPI)-clean:
 	$(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null
 
 $(LIBBPF): fixdep FORCE
-	$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) $(OUTPUT)libbpf.a FEATURES_DUMP=$(realpath $(OUTPUT)FEATURE-DUMP)
+	$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) $(OUTPUT)libbpf.a FEATURES_DUMP=$(FEATURE_DUMP_EXPORT)
 
 $(LIBBPF)-clean:
 	$(call QUIET_CLEAN, libbpf)
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index e5959c1..511141b 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -181,7 +181,11 @@ LDFLAGS += -Wl,-z,noexecstack
 
 EXTLIBS = -lpthread -lrt -lm -ldl
 
+ifeq ($(FEATURES_DUMP),)
 include $(srctree)/tools/build/Makefile.feature
+else
+include $(FEATURES_DUMP)
+endif
 
 ifeq ($(feature-stackprotector-all), 1)
   CFLAGS += -fstack-protector-all

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

end of thread, other threads:[~2016-01-19 13:36 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-15  4:00 [PATCH v3 0/9] perf build: Make build-test faster Wang Nan
2016-01-15  4:00 ` [PATCH v3 1/9] perf build: Set parallel making options build-test Wang Nan
2016-01-15  4:00 ` [PATCH v3 2/9] perf build: Pass O option to Makefile.perf in build-test Wang Nan
2016-01-19 13:35   ` [tip:perf/urgent] " tip-bot for Wang Nan
2016-01-15  4:00 ` [PATCH v3 3/9] perf build: Test correct path of perf " Wang Nan
2016-01-19 13:35   ` [tip:perf/urgent] " tip-bot for Wang Nan
2016-01-15  4:00 ` [PATCH v3 4/9] perf build: Pass O option to kernel makefile " Wang Nan
2016-01-19 13:35   ` [tip:perf/urgent] " tip-bot for Wang Nan
2016-01-15  4:00 ` [PATCH v3 5/9] perf build: Add feature-dump target Wang Nan
2016-01-15 19:11   ` Arnaldo Carvalho de Melo
2016-01-15 19:23     ` Arnaldo Carvalho de Melo
2016-01-15 19:27       ` Arnaldo Carvalho de Melo
2016-01-19 13:36   ` [tip:perf/urgent] " tip-bot for Jiri Olsa
2016-01-15  4:00 ` [PATCH v3 6/9] perf build: Introduce FEATURES_DUMP make variable Wang Nan
2016-01-19 13:36   ` [tip:perf/urgent] " tip-bot for Jiri Olsa
2016-01-15  4:00 ` [PATCH v3 7/9] tools build: Allow subprojects select all feature checkers Wang Nan
2016-01-15  4:00 ` [PATCH v3 8/9] perf build: Select all feature checkers for feature-dump Wang Nan
2016-01-15  4:00 ` [PATCH v3 9/9] perf build: Use feature dump file for build-test Wang Nan
2016-01-15 14:06   ` [PATCH v3 9/9 -fix] " Wang Nan
2016-01-15 14:08   ` [PATCH v3 9/9] " Wangnan (F)
2016-01-15 10:20 ` [PATCH v3 0/9] perf build: Make build-test faster Jiri Olsa
2016-01-15 14:36   ` Arnaldo Carvalho de Melo
2016-01-15 14:54     ` Arnaldo Carvalho de Melo
2016-01-15 14:54     ` pi3orama
2016-01-15 15:12       ` Arnaldo Carvalho de Melo
2016-01-15 16:33         ` Arnaldo Carvalho de Melo
2016-01-15 18:56           ` Arnaldo Carvalho de Melo
2016-01-15 19:01             ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).