tools build: Make FEATURE_DUMP include makefile
Subsystems (3)
Jiri Olsa
reviewercover tools build: Make FEATURE_DUMP include makefile
hi,
Changing the contents of the FEATURE-DUMP file,
so it looks like:
feature-backtrace=1
feature-dwarf=0
feature-fortify-source=1
feature-sync-compare-and-swap=0
This way it could get included in sub projects, so they won't be forced to redo features detection.
changing bpf library to use that, so it's not forced to rerun feature detection if compiled within perf.
Also available in:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
thanks,
jirka
---
Jiri Olsa (5):
tools build feature: Fix feature_check_display_code typo tools build feature: Move dwarf post unwind choice output into perf tools build feature: Introduce feature_ass macro
tools build feature: Use value assignment form for FEATURE-DUMP file perf build: Use FEATURE-DUMP in bpf subproject
tools/build/Makefile.feature | 41 +++++++++++++++++++++++++++-------------- tools/lib/bpf/Makefile | 4 ++++ tools/perf/Makefile.perf | 2 +- tools/perf/config/Makefile | 4 ++++ 4 files changed, 36 insertions(+), 15 deletions(-)
Jiri Olsa
reviewerPATCH 1/5 tools build feature: Fix feature_check_display_code typo
This function is cursed.. ;-)
--- tools/build/Makefile.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/build/Makefile.feature +1 -1
@@ -143,7 +143,7 @@ ifneq ("$(FEATURE_DUMP)","$(FEATURE_DUMP_FILE)") endif feature_display_check = $(eval $(feature_check_display_code)) -define feature_display_check_code +define feature_check_display_code ifneq ($(feature-$(1)), 1) feature_display := 1 endif
Signature · 1 line
2.4.3
tip-bot for Jiri Olsa
merge bot[tip:perf/core] tools build feature: Fix feature_check_display_code typo
tools build feature: Fix feature_check_display_code typo
Commit-ID: d0018b495c0429af3efc1b54f16d291a9fa8b4be Gitweb: http://git.kernel.org/tip/d0018b495c0429af3efc1b54f16d291a9fa8b4be Author: Jiri Olsa <[email protected]> AuthorDate: Wed, 23 Dec 2015 18:58:30 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 6 Jan 2016 20:11:13 -0300
tools build feature: Fix feature_check_display_code typo
This function is cursed.. ;-)
--- tools/build/Makefile.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/build/Makefile.feature +1 -1
@@ -143,7 +143,7 @@ ifneq ("$(FEATURE_DUMP)","$(FEATURE_DUMP_FILE)") endif feature_display_check = $(eval $(feature_check_display_code)) -define feature_display_check_code +define feature_check_display_code ifneq ($(feature-$(1)), 1) feature_display := 1 endif
Jiri Olsa
reviewerPATCH 2/5 tools build feature: Move dwarf post unwind choice output into perf
In reply to Jiri OlsaWe decide what dwarf unwind to choose way after Makefile.feature makefile is included. The $(dwarf-post-unwind) is not even set at that time. For the same reason it was never included in FEATURE-DUMP file.
Moving it into perf VF=1 verbose display.
$ make VF=1
BUILD: Doing 'make -j4' parallel build
Auto-detecting system features:
... dwarf: [ on ]
...
... LIBUNWIND_DIR:
... LIBDW_DIR:
... DWARF post unwind library: libunwind
...--- tools/build/Makefile.feature | 9 --------- tools/perf/config/Makefile | 4 ++++ 2 files changed, 4 insertions(+), 9 deletions(-)
tools/build/Makefile.feature +0 -9
@@ -126,10 +126,6 @@ FEATURE_DUMP_FILENAME = $(OUTPUT)FEATURE-DUMP$(FEATURE_USER) FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),feature-$(feat)($(feature-$(feat)))) FEATURE_DUMP_FILE := $(shell touch $(FEATURE_DUMP_FILENAME); cat $(FEATURE_DUMP_FILENAME)) -ifeq ($(dwarf-post-unwind),1) - FEATURE_DUMP += dwarf-post-unwind($(dwarf-post-unwind-text)) -endif - # The $(feature_display) controls the default detection message # output. It's set if: # - detected features differes from stored features from
@@ -160,11 +156,6 @@ ifeq ($(feature_display),1) $(info ) $(info Auto-detecting system features:) $(foreach feat,$(FEATURE_DISPLAY),$(call feature_print_status,$(feat),)) - - ifeq ($(dwarf-post-unwind),1) - $(call feature_print_text,"DWARF post unwind library", $(dwarf-post-unwind-text)) - endif - ifneq ($(feature_verbose),1) $(info ) endif
tools/perf/config/Makefile +4 -0
@@ -751,6 +751,10 @@ ifeq ($(VF),1) $(call print_var,sysconfdir) $(call print_var,LIBUNWIND_DIR) $(call print_var,LIBDW_DIR) + + ifeq ($(dwarf-post-unwind),1) + $(call feature_print_text,"DWARF post unwind library", $(dwarf-post-unwind-text)) + endif $(info ) endif
Signature · 1 line
2.4.3
tip-bot for Jiri Olsa
merge bot[tip:perf/core] tools build feature: Move dwarf post unwind choice output into perf
tools build feature: Move dwarf post unwind choice output into perf
Commit-ID: 76ee2ff342743e57cb6dc059d0aba90e0c4c9bfc Gitweb: http://git.kernel.org/tip/76ee2ff342743e57cb6dc059d0aba90e0c4c9bfc Author: Jiri Olsa <[email protected]> AuthorDate: Wed, 23 Dec 2015 18:58:31 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 6 Jan 2016 20:11:13 -0300
tools build feature: Move dwarf post unwind choice output into perf
We decide what dwarf unwind to choose way after the Makefile.feature makefile is included. The $(dwarf-post-unwind) is not even set at that time. For the same reason it was never included in FEATURE-DUMP file.
Moving it into perf VF=1 verbose display.
$ make VF=1
BUILD: Doing 'make -j4' parallel build
Auto-detecting system features:
... dwarf: [ on ]
...
... LIBUNWIND_DIR:
... LIBDW_DIR:
... DWARF post unwind library: libunwind
...--- tools/build/Makefile.feature | 9 --------- tools/perf/config/Makefile | 4 ++++ 2 files changed, 4 insertions(+), 9 deletions(-)
tools/build/Makefile.feature +0 -9
@@ -126,10 +126,6 @@ FEATURE_DUMP_FILENAME = $(OUTPUT)FEATURE-DUMP$(FEATURE_USER) FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),feature-$(feat)($(feature-$(feat)))) FEATURE_DUMP_FILE := $(shell touch $(FEATURE_DUMP_FILENAME); cat $(FEATURE_DUMP_FILENAME)) -ifeq ($(dwarf-post-unwind),1) - FEATURE_DUMP += dwarf-post-unwind($(dwarf-post-unwind-text)) -endif - # The $(feature_display) controls the default detection message # output. It's set if: # - detected features differes from stored features from
@@ -160,11 +156,6 @@ ifeq ($(feature_display),1) $(info ) $(info Auto-detecting system features:) $(foreach feat,$(FEATURE_DISPLAY),$(call feature_print_status,$(feat),)) - - ifeq ($(dwarf-post-unwind),1) - $(call feature_print_text,"DWARF post unwind library", $(dwarf-post-unwind-text)) - endif - ifneq ($(feature_verbose),1) $(info ) endif
tools/perf/config/Makefile +4 -0
@@ -751,6 +751,10 @@ ifeq ($(VF),1) $(call print_var,sysconfdir) $(call print_var,LIBUNWIND_DIR) $(call print_var,LIBDW_DIR) + + ifeq ($(dwarf-post-unwind),1) + $(call feature_print_text,"DWARF post unwind library", $(dwarf-post-unwind-text)) + endif $(info ) endif
Jiri Olsa
reviewerPATCH 3/5 tools build feature: Introduce feature_ass macro
In reply to Jiri OlsaThe feature_ass macro generates feature value
assignment for name, like:
$(call feature_ass,dwarf) == feature-dwarf=1
This will be used more in following patches.
--- tools/build/Makefile.feature | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
tools/build/Makefile.feature +7 -1
@@ -122,8 +122,14 @@ define feature_print_text_code MSG = $(shell printf '...%30s: %s' $(1) $(2)) endef +# +# generates feature value assignment for name, like: +# $(call feature_ass,dwarf) == feature-dwarf=1 +# +feature_ass = feature-$(1)=$(feature-$(1)) + FEATURE_DUMP_FILENAME = $(OUTPUT)FEATURE-DUMP$(FEATURE_USER) -FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),feature-$(feat)($(feature-$(feat)))) +FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),$(call feature_ass,$(feat))) FEATURE_DUMP_FILE := $(shell touch $(FEATURE_DUMP_FILENAME); cat $(FEATURE_DUMP_FILENAME)) # The $(feature_display) controls the default detection message
Signature · 1 line
2.4.3
tip-bot for Jiri Olsa
merge bot[tip:perf/core] tools build feature: Introduce feature_assign macro
tools build feature: Introduce feature_assign macro
Commit-ID: c6a5f88f335ec43d2850d62bc4924f719d265670 Gitweb: http://git.kernel.org/tip/c6a5f88f335ec43d2850d62bc4924f719d265670 Author: Jiri Olsa <[email protected]> AuthorDate: Wed, 23 Dec 2015 18:58:32 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 6 Jan 2016 20:11:13 -0300
tools build feature: Introduce feature_assign macro
The feature_assign macro generates feature value
assignment for name, like:
$(call feature_assign,dwarf) == feature-dwarf=1
This will be used more in following patches.
--- tools/build/Makefile.feature | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
tools/build/Makefile.feature +7 -1
@@ -122,8 +122,14 @@ define feature_print_text_code MSG = $(shell printf '...%30s: %s' $(1) $(2)) endef +# +# generates feature value assignment for name, like: +# $(call feature_assign,dwarf) == feature-dwarf=1 +# +feature_assign = feature-$(1)=$(feature-$(1)) + FEATURE_DUMP_FILENAME = $(OUTPUT)FEATURE-DUMP$(FEATURE_USER) -FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),feature-$(feat)($(feature-$(feat)))) +FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),$(call feature_assign,$(feat))) FEATURE_DUMP_FILE := $(shell touch $(FEATURE_DUMP_FILENAME); cat $(FEATURE_DUMP_FILENAME)) # The $(feature_display) controls the default detection message
Jiri Olsa
reviewerPATCH 4/5 tools build feature: Use value assignment form for FEATURE-DUMP file
In reply to Jiri OlsaChanging the contents of the FEATURE-DUMP file,
so it looks like:
feature-backtrace=1
feature-dwarf=0
feature-fortify-source=1
feature-sync-compare-and-swap=0
This way it could get included in sub projects, so they won't be forced to redo features detection.
Also now storing the complete set of features.
--- tools/build/Makefile.feature | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-)
tools/build/Makefile.feature +21 -5
@@ -129,8 +129,24 @@ endef feature_ass = feature-$(1)=$(feature-$(1)) FEATURE_DUMP_FILENAME = $(OUTPUT)FEATURE-DUMP$(FEATURE_USER) -FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),$(call feature_ass,$(feat))) -FEATURE_DUMP_FILE := $(shell touch $(FEATURE_DUMP_FILENAME); cat $(FEATURE_DUMP_FILENAME)) +FEATURE_DUMP := $(shell touch $(FEATURE_DUMP_FILENAME); cat $(FEATURE_DUMP_FILENAME)) + +feature_dump_check = $(eval $(feature_dump_check_code)) +define feature_dump_check_code + ifeq ($(findstring $(1),$(FEATURE_DUMP)),) + $(2) := 1 + endif +endef + +# +# First check if any test from FEATURE_DISPLAY +# and set feature_display := 1 if it does +$(foreach feat,$(FEATURE_DISPLAY),$(call feature_dump_check,$(call feature_ass,$(feat)),feature_display)) + +# +# Now also check if any other test changed, +# so we force FEATURE-DUMP generation +$(foreach feat,$(FEATURE_TESTS),$(call feature_dump_check,$(call feature_ass,$(feat)),feature_dump_changed)) # The $(feature_display) controls the default detection message # output. It's set if:
@@ -139,9 +155,9 @@ FEATURE_DUMP_FILE := $(shell touch $(FEATURE_DUMP_FILENAME); cat $(FEATURE_DUMP_ # - one of the $(FEATURE_DISPLAY) is not detected # - VF is enabled -ifneq ("$(FEATURE_DUMP)","$(FEATURE_DUMP_FILE)") - $(shell echo "$(FEATURE_DUMP)" > $(FEATURE_DUMP_FILENAME)) - feature_display := 1 +ifeq ($(feature_dump_changed),1) + $(shell rm -f $(FEATURE_DUMP_FILENAME)) + $(foreach feat,$(FEATURE_TESTS),$(shell echo "$(call feature_ass,$(feat))" >> $(FEATURE_DUMP_FILENAME))) endif feature_display_check = $(eval $(feature_check_display_code))
Signature · 1 line
2.4.3
tip-bot for Jiri Olsa
merge bot[tip:perf/core] tools build feature: Use value assignment form for FEATURE-DUMP file
tools build feature: Use value assignment form for FEATURE-DUMP file
Commit-ID: 936d120d5f6406377e622da3167cafc811d053ea Gitweb: http://git.kernel.org/tip/936d120d5f6406377e622da3167cafc811d053ea Author: Jiri Olsa <[email protected]> AuthorDate: Wed, 23 Dec 2015 18:58:33 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 6 Jan 2016 20:11:14 -0300
tools build feature: Use value assignment form for FEATURE-DUMP file
Changing the contents of the FEATURE-DUMP file, so it looks like:
feature-backtrace=1
feature-dwarf=0
feature-fortify-source=1
feature-sync-compare-and-swap=0
This way it could get included in sub projects, so they won't be forced to redo features detection.
Also now storing the complete set of features.
--- tools/build/Makefile.feature | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-)
tools/build/Makefile.feature +21 -5
@@ -129,8 +129,24 @@ endef feature_assign = feature-$(1)=$(feature-$(1)) FEATURE_DUMP_FILENAME = $(OUTPUT)FEATURE-DUMP$(FEATURE_USER) -FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),$(call feature_assign,$(feat))) -FEATURE_DUMP_FILE := $(shell touch $(FEATURE_DUMP_FILENAME); cat $(FEATURE_DUMP_FILENAME)) +FEATURE_DUMP := $(shell touch $(FEATURE_DUMP_FILENAME); cat $(FEATURE_DUMP_FILENAME)) + +feature_dump_check = $(eval $(feature_dump_check_code)) +define feature_dump_check_code + ifeq ($(findstring $(1),$(FEATURE_DUMP)),) + $(2) := 1 + endif +endef + +# +# First check if any test from FEATURE_DISPLAY +# and set feature_display := 1 if it does +$(foreach feat,$(FEATURE_DISPLAY),$(call feature_dump_check,$(call feature_assign,$(feat)),feature_display)) + +# +# Now also check if any other test changed, +# so we force FEATURE-DUMP generation +$(foreach feat,$(FEATURE_TESTS),$(call feature_dump_check,$(call feature_assign,$(feat)),feature_dump_changed)) # The $(feature_display) controls the default detection message # output. It's set if:
@@ -139,9 +155,9 @@ FEATURE_DUMP_FILE := $(shell touch $(FEATURE_DUMP_FILENAME); cat $(FEATURE_DUMP_ # - one of the $(FEATURE_DISPLAY) is not detected # - VF is enabled -ifneq ("$(FEATURE_DUMP)","$(FEATURE_DUMP_FILE)") - $(shell echo "$(FEATURE_DUMP)" > $(FEATURE_DUMP_FILENAME)) - feature_display := 1 +ifeq ($(feature_dump_changed),1) + $(shell rm -f $(FEATURE_DUMP_FILENAME)) + $(foreach feat,$(FEATURE_TESTS),$(shell echo "$(call feature_assign,$(feat))" >> $(FEATURE_DUMP_FILENAME))) endif feature_display_check = $(eval $(feature_check_display_code))
Jiri Olsa
reviewerPATCH 5/5 perf build: Use FEATURE-DUMP in bpf subproject
In reply to Jiri OlsaUsing FEATURE-DUMP in bpf subproject for features detection in case bpf is built via perf. Keeping the current features detection otherwise.
--- tools/lib/bpf/Makefile | 4 ++++ tools/perf/Makefile.perf | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
tools/lib/bpf/Makefile +4 -0
@@ -80,7 +80,11 @@ endif endif ifeq ($(check_feat),1) +ifeq ($(FEATURES_DUMP),) include $(srctree)/tools/build/Makefile.feature +else +include $(FEATURES_DUMP) +endif endif export prefix libdir src obj
tools/perf/Makefile.perf +1 -1
@@ -436,7 +436,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 + $(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) $(OUTPUT)libbpf.a FEATURES_DUMP=$(realpath $(OUTPUT)FEATURE-DUMP) $(LIBBPF)-clean: $(call QUIET_CLEAN, libbpf)
Signature · 1 line
2.4.3
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf build: Use FEATURE-DUMP in bpf subproject
perf build: Use FEATURE-DUMP in bpf subproject
Commit-ID: 58683600dfe377c883eb8217b5a9bfcfe231b3ff Gitweb: http://git.kernel.org/tip/58683600dfe377c883eb8217b5a9bfcfe231b3ff Author: Jiri Olsa <[email protected]> AuthorDate: Wed, 23 Dec 2015 18:58:34 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 6 Jan 2016 20:11:14 -0300
perf build: Use FEATURE-DUMP in bpf subproject
Using FEATURE-DUMP in bpf subproject for features detection in case bpf is built via perf. Keeping the current features detection otherwise.
--- tools/lib/bpf/Makefile | 4 ++++ tools/perf/Makefile.perf | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
tools/lib/bpf/Makefile +4 -0
@@ -80,7 +80,11 @@ endif endif ifeq ($(check_feat),1) +ifeq ($(FEATURES_DUMP),) include $(srctree)/tools/build/Makefile.feature +else +include $(FEATURES_DUMP) +endif endif export prefix libdir src obj
tools/perf/Makefile.perf +1 -1
@@ -436,7 +436,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 + $(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) $(OUTPUT)libbpf.a FEATURES_DUMP=$(realpath $(OUTPUT)FEATURE-DUMP) $(LIBBPF)-clean: $(call QUIET_CLEAN, libbpf)
Quoted 12 lines · Jiri Olsa
hi,
Changing the contents of the FEATURE-DUMP file,
so it looks like:feature-backtrace=1
feature-dwarf=0
feature-fortify-source=1
feature-sync-compare-and-swap=0This way it could get included in sub projects, so they won't be forced to redo features detection.
Quoted 8 lines
changing bpf library to use that, so it's not forced to rerun feature detection if compiled within perf.
Also available in:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.gitthanks,
jirka
For the whole patch set.
Thank you.
Quoted 14 lines
---
Jiri Olsa (5):
tools build feature: Fixfeature_check_display_codetypo tools build feature: Move dwarf post unwind choice output into perf tools build feature: Introducefeature_assmacro
tools build feature: Use value assignment form for FEATURE-DUMP file perf build: Use FEATURE-DUMP in bpf subprojecttools/build/Makefile.feature | 41 +++++++++++++++++++++++++++-------------- tools/lib/bpf/Makefile | 4 ++++ tools/perf/Makefile.perf | 2 +- tools/perf/config/Makefile | 4 ++++ 4 files changed, 36 insertions(+), 15 deletions(-)
Quoted 19 lines · Wangnan (F)
Quoted 16 lines · Jiri Olsa
hi,
Changing the contents of the FEATURE-DUMP file, so it looks like:
feature-backtrace=1
feature-dwarf=0
feature-fortify-source=1 feature-sync-compare-and-swap=0
This way it could get included in sub projects, so they won't be forced to redo features detection.changing bpf library to use that, so it's not forced to rerun feature detection if compiled within perf.
Also available in:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
Quoted 6 lines
Quoted 2 lines
thanks,
jirkaTested-by Wang Nan <[email protected]>For the whole patch set.
I updated perf/fixes branch with Wang's tag
thanks,
jirka
Em Sun, Dec 27, 2015 at 12:58:06PM +0100, Jiri Olsa escreveu:
Quoted 20 lines · Wangnan (F)
Quoted 19 lines · Jiri Olsa
Quoted 16 lines
hi,
Changing the contents of the FEATURE-DUMP file, so it looks like:
feature-backtrace=1
feature-dwarf=0
feature-fortify-source=1 feature-sync-compare-and-swap=0
This way it could get included in sub projects, so they won't be forced to redo features detection.changing bpf library to use that, so it's not forced to rerun feature detection if compiled within perf.
Also available in:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
thanks,
jirkaTested-by Wang Nan <[email protected]>For the whole patch set.
Thanks, applied.
- Arnaldo