Skip to contentSkip to conversation

tools: Add clean targets for tools directory

PATCH In review Jiri Olsa 4 participants 18 messages Jan 11, 2016 – Jan 13, 2016

Subsystems (3)
lore
Share & tools
lore

Jiri Olsa

author reviewer
#0 lore raw

cover tools: Add clean targets for tools directory

hi,
sending some tools build fixes,

patches 5 and 6 are RFC and I'd like to have it
tested/confirmed by Wang Nan it suits his needs.

All of them available on top of my perf/fixes branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git

thanks,
jirka

---
Jiri Olsa (6):
tools: Add clean targets for tools directory tools bpf: Add *.cmd files clean up
tools lockdep: Add *.cmd files clean up perf tools: Add missing sources in perf's MANIFEST perf build: Add feature-dump target
perf build: Introduce FEATURES_DUMP make variable

 tools/Makefile             | 11 ++++++++++-
 tools/lib/bpf/Makefile     |  2 +-
 tools/lib/lockdep/Makefile |  2 +-
 tools/perf/MANIFEST        |  2 ++
 tools/perf/Makefile.perf   | 25 ++++++++++++++++++++++++-
 tools/perf/config/Makefile |  4 ++++
 6 files changed, 42 insertions(+), 4 deletions(-)
author reviewer
#1 lore raw

PATCH 1/6 tools: Add clean targets for tools directory

Adding missing clean targets for following tools directories:
lib/bpf
lib/subcmd
build

This are now cleaned via 'make -C tools clean' command.

---
 tools/Makefile | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
tools/Makefile +10 -1
index 0ba0df3b516f..4e8e10755e0d 100644
@@ -127,6 +127,12 @@ liblockdep_clean:
 libapi_clean:
 	$(call descend,lib/api,clean)
 
+libbpf_clean:
+	$(call descend,lib/bpf,clean)
+
+libsubcmd_clean:
+	$(call descend,lib/subcmd,clean)
+
 perf_clean:
 	$(call descend,$(@:_clean=),clean)
 
@@ -142,9 +148,12 @@ tmon_clean:
 freefall_clean:
 	$(call descend,laptop/freefall,clean)
 
+build_clean:
+	$(call descend,build,clean)
+
 clean: acpi_clean cgroup_clean cpupower_clean hv_clean firewire_clean lguest_clean \
 		perf_clean selftests_clean turbostat_clean usb_clean virtio_clean \
 		vm_clean net_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
-		freefall_clean
+		freefall_clean build_clean libbpf_clean libsubcmd_clean liblockdep_clean
 
 .PHONY: FORCE
Signature · 1 line
2.4.3
#2 lore raw
tools: Add clean targets for tools directory
Commit-ID:  2f5a7f1d13df94b753794b69cc4c920f8bfb2128
Gitweb:     http://git.kernel.org/tip/2f5a7f1d13df94b753794b69cc4c920f8bfb2128
Author:     Jiri Olsa <[email protected]>
AuthorDate: Mon, 11 Jan 2016 11:54:48 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 11 Jan 2016 12:07:38 -0300

tools: Add clean targets for tools directory

Adding missing clean targets for following tools directories:

lib/bpf
lib/subcmd
build

This are now cleaned via 'make -C tools clean' command.

---
 tools/Makefile | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
tools/Makefile +10 -1
index 0ba0df3..4e8e107 100644
@@ -127,6 +127,12 @@ liblockdep_clean:
 libapi_clean:
 	$(call descend,lib/api,clean)
 
+libbpf_clean:
+	$(call descend,lib/bpf,clean)
+
+libsubcmd_clean:
+	$(call descend,lib/subcmd,clean)
+
 perf_clean:
 	$(call descend,$(@:_clean=),clean)
 
@@ -142,9 +148,12 @@ tmon_clean:
 freefall_clean:
 	$(call descend,laptop/freefall,clean)
 
+build_clean:
+	$(call descend,build,clean)
+
 clean: acpi_clean cgroup_clean cpupower_clean hv_clean firewire_clean lguest_clean \
 		perf_clean selftests_clean turbostat_clean usb_clean virtio_clean \
 		vm_clean net_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
-		freefall_clean
+		freefall_clean build_clean libbpf_clean libsubcmd_clean liblockdep_clean
 
 .PHONY: FORCE
author reviewer
#3 lore raw

PATCH 2/6 tools bpf: Add *.cmd files clean up

In reply to Jiri Olsa

Add *.cmd files to be removed within clean target.

---
 tools/lib/bpf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/Makefile +1 -1
index 919b71780710..84e0e986ade4 100644
@@ -192,7 +192,7 @@ config-clean:
 	$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
 
 clean:
-	$(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d \
+	$(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d .*.cmd \
 		$(RM) LIBBPF-CFLAGS
 	$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf
 
Signature · 1 line
2.4.3
#4 lore raw

[tip:perf/urgent] tools bpf: Add *.cmd files clean up

tools bpf: Add *.cmd files clean up
Commit-ID:  22992a320807f8eb04b48407715aacbdedb00941
Gitweb:     http://git.kernel.org/tip/22992a320807f8eb04b48407715aacbdedb00941
Author:     Jiri Olsa <[email protected]>
AuthorDate: Mon, 11 Jan 2016 11:54:49 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 11 Jan 2016 12:08:30 -0300

tools bpf: Add *.cmd files clean up

Add *.cmd files to be removed within clean target.

---
 tools/lib/bpf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/Makefile +1 -1
index 919b717..84e0e98 100644
@@ -192,7 +192,7 @@ config-clean:
 	$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
 
 clean:
-	$(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d \
+	$(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d .*.cmd \
 		$(RM) LIBBPF-CFLAGS
 	$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf
 
author reviewer
#5 lore raw

PATCH 3/6 tools lockdep: Add *.cmd files clean up

In reply to Jiri Olsa

Add *.cmd files to be removed within clean target.

---
 tools/lib/lockdep/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/lockdep/Makefile +1 -1
index 7e319afac78a..90d2baeb621a 100644
@@ -149,7 +149,7 @@ install_lib: all_cmd
 install: install_lib
 
 clean:
-	$(RM) *.o *~ $(TARGETS) *.a *liblockdep*.so* $(VERSION_FILES) .*.d
+	$(RM) *.o *~ $(TARGETS) *.a *liblockdep*.so* $(VERSION_FILES) .*.d .*.cmd
 	$(RM) tags TAGS
 
 PHONY += force
Signature · 1 line
2.4.3
#6 lore raw

[tip:perf/urgent] tools lockdep: Add *.cmd files clean up

tools lockdep: Add *.cmd files clean up
Commit-ID:  24ee9b57b95fd4d6d0b89a47c3a8f1b145569d18
Gitweb:     http://git.kernel.org/tip/24ee9b57b95fd4d6d0b89a47c3a8f1b145569d18
Author:     Jiri Olsa <[email protected]>
AuthorDate: Mon, 11 Jan 2016 11:54:50 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 11 Jan 2016 12:09:05 -0300

tools lockdep: Add *.cmd files clean up

Add *.cmd files to be removed within clean target.

---
 tools/lib/lockdep/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/lockdep/Makefile +1 -1
index 7e319af..90d2bae 100644
@@ -149,7 +149,7 @@ install_lib: all_cmd
 install: install_lib
 
 clean:
-	$(RM) *.o *~ $(TARGETS) *.a *liblockdep*.so* $(VERSION_FILES) .*.d
+	$(RM) *.o *~ $(TARGETS) *.a *liblockdep*.so* $(VERSION_FILES) .*.d .*.cmd
 	$(RM) tags TAGS
 
 PHONY += force
author reviewer
#7 lore raw

PATCH 4/6 perf tools: Add missing sources in perf's MANIFEST

In reply to Jiri Olsa

From: Jiri Olsa <[email protected]>

Adding missing bitmap.[ch] sources to the MINIFEST file.

---
 tools/perf/MANIFEST | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/MANIFEST +2 -0
index ddf922f93aa1..2e1fa2357528 100644
@@ -28,6 +28,7 @@ tools/lib/string.c
 tools/lib/symbol/kallsyms.c
 tools/lib/symbol/kallsyms.h
 tools/lib/find_bit.c
+tools/lib/bitmap.c
 tools/include/asm/atomic.h
 tools/include/asm/barrier.h
 tools/include/asm/bug.h
@@ -57,6 +58,7 @@ tools/include/linux/rbtree_augmented.h
 tools/include/linux/string.h
 tools/include/linux/types.h
 tools/include/linux/err.h
+tools/include/linux/bitmap.h
 include/asm-generic/bitops/arch_hweight.h
 include/asm-generic/bitops/const_hweight.h
 include/asm-generic/bitops/fls64.h
Signature · 1 line
2.4.3
#8 lore raw

[tip:perf/urgent] perf tools: Add missing sources to perf' s MANIFEST

perf tools: Add missing sources to perf's MANIFEST
Commit-ID:  3238ba01c235e3e9e12fc7bc6ac3f7d513e26a31
Gitweb:     http://git.kernel.org/tip/3238ba01c235e3e9e12fc7bc6ac3f7d513e26a31
Author:     Jiri Olsa <[email protected]>
AuthorDate: Mon, 11 Jan 2016 11:54:51 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 11 Jan 2016 12:09:25 -0300

perf tools: Add missing sources to perf's MANIFEST

Adding missing bitmap.[ch] sources to the MANIFEST file. Fixes building 'make perf-*-src-pkg' generated tarballs.

Cc David Ahern <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Fixes 915b0882c310 ("tools lib: Move bitmap.[ch] from tools/perf/ to tools/{lib,include}/")
---
 tools/perf/MANIFEST | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/MANIFEST +2 -0
index ddf922f..2e1fa23 100644
@@ -28,6 +28,7 @@ tools/lib/string.c
 tools/lib/symbol/kallsyms.c
 tools/lib/symbol/kallsyms.h
 tools/lib/find_bit.c
+tools/lib/bitmap.c
 tools/include/asm/atomic.h
 tools/include/asm/barrier.h
 tools/include/asm/bug.h
@@ -57,6 +58,7 @@ tools/include/linux/rbtree_augmented.h
 tools/include/linux/string.h
 tools/include/linux/types.h
 tools/include/linux/err.h
+tools/include/linux/bitmap.h
 include/asm-generic/bitops/arch_hweight.h
 include/asm-generic/bitops/const_hweight.h
 include/asm-generic/bitops/fls64.h
author reviewer
#9 lore raw

RFC 5/6 perf build: Add feature-dump target

In reply to Jiri Olsa

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

---
 tools/perf/Makefile.perf | 11 +++++++++++
 1 file changed, 11 insertions(+)
tools/perf/Makefile.perf +11 -0
index 0a22407e1d7d..f758a72df1b3 100644
@@ -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:
 #
Signature · 1 line
2.4.3
author reviewer
#10 lore raw

RFC 6/6 perf build: Introduce FEATURES_DUMP make variable

In reply to Jiri Olsa

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 ...
---
 tools/perf/Makefile.perf   | 14 +++++++++++++-
 tools/perf/config/Makefile |  4 ++++
 2 files changed, 17 insertions(+), 1 deletion(-)
tools/perf/Makefile.perf +13 -1
index f758a72df1b3..5d34815c7ccb 100644
@@ -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)
tools/perf/config/Makefile +4 -0
index 254d06e39bea..5b2f12d6be3e 100644
@@ -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
Signature · 1 line
2.4.3
#11 lore raw

Re: [RFC 6/6] perf build: Introduce FEATURES_DUMP make variable

Quoted 20 lines · Jiri Olsa

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
Quoted 7 lines
   $ file perf
   perf: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for ...

---

Thank you for these two patch. However I found a small limitation. I must skip 'make clean' between two feature-dump, or the result is wrong.

For example:

$ make feature-dump LDFLAGS="-static"
  BUILD:   Doing 'make -j24' parallel build

Auto-detecting system features:
<SNIP>
... zlib: [ on ]
... lzma: [ OFF ] <--- looks good. I don't have static lzma library
... get_cpuid: [ on ]
... bpf: [ on ]

$ make feature-dump
  BUILD:   Doing 'make -j24' parallel build

Auto-detecting system features:
<SNIP>

...                          zlib: [ on  ]
...                          lzma: [ on  ]   <--- also good
...                     get_cpuid: [ on  ]
...                           bpf: [ on  ]
$ make feature-dump LDFLAGS="-static"
  BUILD:   Doing 'make -j24' parallel build

Auto-detecting system features:
<SNIP>

...                          zlib: [ on  ]
...                          lzma: [ on  ]     <--- Bad...
...                     get_cpuid: [ on  ]
...                           bpf: [ on  ]

Thank you.

#12 lore raw

Re: [RFC 6/6] perf build: Introduce FEATURES_DUMP make variable

On Tue, Jan 12, 2016 at 05:28:28PM +0800, Wangnan (F) wrote:

SNIP

Quoted 28 lines

For example:

$ make feature-dump LDFLAGS="-static"
  BUILD:   Doing 'make -j24' parallel build

Auto-detecting system features:
<SNIP>
... zlib: [ on ]
... lzma: [ OFF ] <--- looks good. I don't have
static lzma library
... get_cpuid: [ on ]
... bpf: [ on ]

$ make feature-dump
  BUILD:   Doing 'make -j24' parallel build

Auto-detecting system features:
<SNIP>

...                          zlib: [ on  ]
...                          lzma: [ on  ]   <--- also good
...                     get_cpuid: [ on  ]
...                           bpf: [ on  ]
$ make feature-dump LDFLAGS="-static"
  BUILD:   Doing 'make -j24' parallel build
Quoted 8 lines

Auto-detecting system features:
<SNIP>

...                          zlib: [ on  ]
...                          lzma: [ on  ]     <--- Bad...
...                     get_cpuid: [ on  ]
...                           bpf: [ on  ]

Thank you.

right, it's because feature is not under build framework and compilation does not care about flags change..

I'll try to check on that.. does this patch help to improve the current speed or do you need to solve this to get substantial speedup?

thanks,
jirka

#13 lore raw

Re: [RFC 6/6] perf build: Introduce FEATURES_DUMP make variable

Quoted 39 lines · Jiri Olsa

On Tue, Jan 12, 2016 at 05:28:28PM +0800, Wangnan (F) wrote:

SNIP

Quoted 35 lines

For example:

$ make feature-dump LDFLAGS="-static"
   BUILD:   Doing 'make -j24' parallel build

Auto-detecting system features:
<SNIP>
... zlib: [ on ]
... lzma: [ OFF ] <--- looks good. I don't have
static lzma library
... get_cpuid: [ on ]
... bpf: [ on ]

$ make feature-dump
   BUILD:   Doing 'make -j24' parallel build

Auto-detecting system features:
<SNIP>

...                          zlib: [ on  ]
...                          lzma: [ on  ]   <--- also good
...                     get_cpuid: [ on  ]
...                           bpf: [ on  ]
$ make feature-dump LDFLAGS="-static"
   BUILD:   Doing 'make -j24' parallel build

Auto-detecting system features:
<SNIP>

...                          zlib: [ on  ]
...                          lzma: [ on  ]     <--- Bad...
...                     get_cpuid: [ on  ]
...                           bpf: [ on  ]
Quoted 7 lines
Quoted 1 line

Thank you.

right, it's because feature is not under build framework and compilation does not care about flags change..

I'll try to check on that.. does this patch help to improve the current speed or do you need to solve this to get substantial speedup?

I'm working on it. I have already done it, but still have some problem. On some machine 'make_static' test target lost '-liberty -lz' in its linker options. Seems something wrong in this part:

ifeq ($(feature-libbfd), 1)
EXTLIBS += -lbfd

  # call all detections now so we get correct
  # status in VF output
  $(call feature_check,liberty)
  $(call feature_check,liberty-z)
  $(call feature_check,cplus-demangle)

ifeq ($(feature-liberty), 1)

    EXTLIBS += -liberty
  else
    ifeq ($(feature-liberty-z), 1)
      EXTLIBS += -liberty -lz
    endif

endif
endif

On a 24 core machine the build-test takes about 16 mins. Faster than before:

real 16m7.642s
user 171m47.488s
sys 19m10.692s

#14 lore raw

Re: [RFC 6/6] perf build: Introduce FEATURES_DUMP make variable

On Wed, Jan 13, 2016 at 05:46:13PM +0800, Wangnan (F) wrote:

SNIP

Quoted 19 lines
Quoted 4 lines

I'll try to check on that.. does this patch help to improve the current speed or do you need to solve this to get substantial speedup?

I'm working on it. I have already done it, but still have some problem. On some machine 'make_static' test target lost '-liberty -lz' in its linker options. Seems something wrong in this part:

ifeq ($(feature-libbfd), 1)
EXTLIBS += -lbfd

  # call all detections now so we get correct
  # status in VF output
  $(call feature_check,liberty)
  $(call feature_check,liberty-z)
  $(call feature_check,cplus-demangle)
Quoted 8 lines

ifeq ($(feature-liberty), 1)

    EXTLIBS += -liberty
  else
    ifeq ($(feature-liberty-z), 1)
      EXTLIBS += -liberty -lz
    endif

endif
endif

IIRC we had issues with this before.. different systems provide those libs in different way, like:
2cf9040714f3 perf tools: Fix bfd dependency libraries detection

you might want to check feature detection code if it gets built properly on your system

jirka

#15 lore raw

Re: [RFC 6/6] perf build: Introduce FEATURES_DUMP make variable

Quoted 29 lines · Jiri Olsa

On Wed, Jan 13, 2016 at 05:46:13PM +0800, Wangnan (F) wrote:

SNIP

Quoted 17 lines
Quoted 3 lines

I'll try to check on that.. does this patch help to improve the current speed or do you need to solve this to get substantial speedup?

I'm working on it. I have already done it, but still have some problem. On some machine 'make_static' test target lost '-liberty -lz' in its linker options. Seems something wrong in this part:

ifeq ($(feature-libbfd), 1)
EXTLIBS += -lbfd

   # call all detections now so we get correct
   # status in VF output
   $(call feature_check,liberty)
   $(call feature_check,liberty-z)
   $(call feature_check,cplus-demangle)
Quoted 8 lines
   ifeq ($(feature-liberty), 1)
     EXTLIBS += -liberty
   else
     ifeq ($(feature-liberty-z), 1)
       EXTLIBS += -liberty -lz
     endif
   endif

endif

Quoted 6 lines

IIRC we had issues with this before.. different systems provide those libs in different way, like:
2cf9040714f3 perf tools: Fix bfd dependency libraries detection

you might want to check feature detection code if it gets built properly on your system

No this problem. There's no feature-libiberty and feature-libiberty-z in output feature-dump file. This is the key reason.

Quoted 1 line

jirka

#16 lore raw

Re: [RFC 6/6] perf build: Introduce FEATURES_DUMP make variable

In reply to Jiri Olsa
Quoted 7 lines · Jiri Olsa

On Wed, Jan 13, 2016 at 05:46:13PM +0800, Wangnan (F) wrote:

SNIP

Quoted 3 lines
Quoted 3 lines

I'll try to check on that.. does this patch help to improve the current speed or do you need to solve this to get substantial speedup?

Finished.

On a 24 core machine:

Without this feature, a full build-test takes:

real 21m16.579s
user 176m12.989s
sys 20m54.950s

With this feature:

real 16m0.619s
user 172m53.896s
sys 19m22.777s

Speedup: 24.75%.

So this feature is really useful.

Thank you.

#17 lore raw

Re: [RFC 6/6] perf build: Introduce FEATURES_DUMP make variable

Quoted 23 lines · Wangnan (F)
Quoted 7 lines · Jiri Olsa

On Wed, Jan 13, 2016 at 05:46:13PM +0800, Wangnan (F) wrote:

SNIP

Quoted 3 lines
Quoted 3 lines

I'll try to check on that.. does this patch help to improve the current speed or do you need to solve this to get substantial speedup?

Finished.

On a 24 core machine:

Without this feature, a full build-test takes:

real 21m16.579s
user 176m12.989s
sys 20m54.950s

With this feature:

Quoted 7 lines

real 16m0.619s
user 172m53.896s
sys 19m22.777s

Speedup: 24.75%.

So this feature is really useful.

looks great, thanks

jirka