All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] tools build: Make FEATURE_DUMP include makefile
@ 2015-12-23 17:58 Jiri Olsa
  2015-12-23 17:58 ` [PATCH 1/5] tools build feature: Fix feature_check_display_code typo Jiri Olsa
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Jiri Olsa @ 2015-12-23 17:58 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Wang Nan, pi3orama, lizefan

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(-)

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

* [PATCH 1/5] tools build feature: Fix feature_check_display_code typo
  2015-12-23 17:58 [PATCH 0/5] tools build: Make FEATURE_DUMP include makefile Jiri Olsa
@ 2015-12-23 17:58 ` Jiri Olsa
  2016-01-09 16:26   ` [tip:perf/core] " tip-bot for Jiri Olsa
  2015-12-23 17:58 ` [PATCH 2/5] tools build feature: Move dwarf post unwind choice output into perf Jiri Olsa
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Jiri Olsa @ 2015-12-23 17:58 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Wang Nan, pi3orama, lizefan

This function is cursed.. ;-)

Link: http://lkml.kernel.org/n/tip-8p5nvjgaypgsu5ycfjmkrx5d@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/build/Makefile.feature | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 6c0519de765d..a8b4befdef7e 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -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
-- 
2.4.3


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

* [PATCH 2/5] tools build feature: Move dwarf post unwind choice output into perf
  2015-12-23 17:58 [PATCH 0/5] tools build: Make FEATURE_DUMP include makefile Jiri Olsa
  2015-12-23 17:58 ` [PATCH 1/5] tools build feature: Fix feature_check_display_code typo Jiri Olsa
@ 2015-12-23 17:58 ` Jiri Olsa
  2016-01-09 16:27   ` [tip:perf/core] " tip-bot for Jiri Olsa
  2015-12-23 17:58 ` [PATCH 3/5] tools build feature: Introduce feature_ass macro Jiri Olsa
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Jiri Olsa @ 2015-12-23 17:58 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Wang Nan, pi3orama, lizefan

We 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
  ...

Link: http://lkml.kernel.org/n/tip-w6zxacvh4e59sp3rhxqs6btl@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/build/Makefile.feature | 9 ---------
 tools/perf/config/Makefile   | 4 ++++
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index a8b4befdef7e..20753124c8f4 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -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
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index a5524179d26e..18b2f96d0941 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -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
 
-- 
2.4.3


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

* [PATCH 3/5] tools build feature: Introduce feature_ass macro
  2015-12-23 17:58 [PATCH 0/5] tools build: Make FEATURE_DUMP include makefile Jiri Olsa
  2015-12-23 17:58 ` [PATCH 1/5] tools build feature: Fix feature_check_display_code typo Jiri Olsa
  2015-12-23 17:58 ` [PATCH 2/5] tools build feature: Move dwarf post unwind choice output into perf Jiri Olsa
@ 2015-12-23 17:58 ` Jiri Olsa
  2016-01-09 16:27   ` [tip:perf/core] tools build feature: Introduce feature_assign macro tip-bot for Jiri Olsa
  2015-12-23 17:58 ` [PATCH 4/5] tools build feature: Use value assignment form for FEATURE-DUMP file Jiri Olsa
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Jiri Olsa @ 2015-12-23 17:58 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Wang Nan, pi3orama, lizefan

The 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.

Link: http://lkml.kernel.org/n/tip-jst8x3nv43w0h8afu9mfs07p@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/build/Makefile.feature | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 20753124c8f4..bd6eff14c8f9 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -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
-- 
2.4.3


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

* [PATCH 4/5] tools build feature: Use value assignment form for FEATURE-DUMP file
  2015-12-23 17:58 [PATCH 0/5] tools build: Make FEATURE_DUMP include makefile Jiri Olsa
                   ` (2 preceding siblings ...)
  2015-12-23 17:58 ` [PATCH 3/5] tools build feature: Introduce feature_ass macro Jiri Olsa
@ 2015-12-23 17:58 ` Jiri Olsa
  2016-01-09 16:27   ` [tip:perf/core] " tip-bot for Jiri Olsa
  2015-12-23 17:58 ` [PATCH 5/5] perf build: Use FEATURE-DUMP in bpf subproject Jiri Olsa
  2015-12-24  2:52 ` [PATCH 0/5] tools build: Make FEATURE_DUMP include makefile Wangnan (F)
  5 siblings, 1 reply; 14+ messages in thread
From: Jiri Olsa @ 2015-12-23 17:58 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	Wang Nan, pi3orama, lizefan

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.

Link: http://lkml.kernel.org/n/tip-69xvy9nvx0gvrvl10q40ri1q@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/build/Makefile.feature | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index bd6eff14c8f9..7796313e5ab8 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -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))
-- 
2.4.3


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

* [PATCH 5/5] perf build: Use FEATURE-DUMP in bpf subproject
  2015-12-23 17:58 [PATCH 0/5] tools build: Make FEATURE_DUMP include makefile Jiri Olsa
                   ` (3 preceding siblings ...)
  2015-12-23 17:58 ` [PATCH 4/5] tools build feature: Use value assignment form for FEATURE-DUMP file Jiri Olsa
@ 2015-12-23 17:58 ` Jiri Olsa
  2016-01-09 16:28   ` [tip:perf/core] " tip-bot for Jiri Olsa
  2015-12-24  2:52 ` [PATCH 0/5] tools build: Make FEATURE_DUMP include makefile Wangnan (F)
  5 siblings, 1 reply; 14+ messages in thread
From: Jiri Olsa @ 2015-12-23 17:58 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Wang Nan, lkml, David Ahern, Ingo Molnar, Namhyung Kim,
	Peter Zijlstra, pi3orama, lizefan

Using FEATURE-DUMP in bpf subproject for features detection
in case bpf is built via perf. Keeping the current features
detection otherwise.

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

diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 636e3ddb93a1..919b71780710 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -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
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 569fcf022531..404e3b1c4e31 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -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)
-- 
2.4.3


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

* Re: [PATCH 0/5] tools build: Make FEATURE_DUMP include makefile
  2015-12-23 17:58 [PATCH 0/5] tools build: Make FEATURE_DUMP include makefile Jiri Olsa
                   ` (4 preceding siblings ...)
  2015-12-23 17:58 ` [PATCH 5/5] perf build: Use FEATURE-DUMP in bpf subproject Jiri Olsa
@ 2015-12-24  2:52 ` Wangnan (F)
  2015-12-27 11:58   ` Jiri Olsa
  5 siblings, 1 reply; 14+ messages in thread
From: Wangnan (F) @ 2015-12-24  2:52 UTC (permalink / raw)
  To: Jiri Olsa, Arnaldo Carvalho de Melo
  Cc: lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra,
	pi3orama, lizefan



On 2015/12/24 1:58, Jiri Olsa wrote:
> 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

Tested-by: Wang Nan <wangnan0@huawei.com>

For the whole patch set.

Thank you.

>
> ---
> 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(-)



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

* Re: [PATCH 0/5] tools build: Make FEATURE_DUMP include makefile
  2015-12-24  2:52 ` [PATCH 0/5] tools build: Make FEATURE_DUMP include makefile Wangnan (F)
@ 2015-12-27 11:58   ` Jiri Olsa
  2016-01-04 21:06     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 14+ messages in thread
From: Jiri Olsa @ 2015-12-27 11:58 UTC (permalink / raw)
  To: Wangnan (F)
  Cc: Jiri Olsa, Arnaldo Carvalho de Melo, lkml, David Ahern,
	Ingo Molnar, Namhyung Kim, Peter Zijlstra, pi3orama, lizefan

On Thu, Dec 24, 2015 at 10:52:18AM +0800, Wangnan (F) wrote:
> 
> 
> On 2015/12/24 1:58, Jiri Olsa wrote:
> >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
> 
> Tested-by: Wang Nan <wangnan0@huawei.com>
> 
> For the whole patch set.

I updated perf/fixes branch with Wang's tag

thanks,
jirka

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

* Re: [PATCH 0/5] tools build: Make FEATURE_DUMP include makefile
  2015-12-27 11:58   ` Jiri Olsa
@ 2016-01-04 21:06     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-01-04 21:06 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Wangnan (F),
	Jiri Olsa, lkml, David Ahern, Ingo Molnar, Namhyung Kim,
	Peter Zijlstra, pi3orama, lizefan

Em Sun, Dec 27, 2015 at 12:58:06PM +0100, Jiri Olsa escreveu:
> On Thu, Dec 24, 2015 at 10:52:18AM +0800, Wangnan (F) wrote:
> > 
> > 
> > On 2015/12/24 1:58, Jiri Olsa wrote:
> > >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
> > 
> > Tested-by: Wang Nan <wangnan0@huawei.com>
> > 
> > For the whole patch set.

Thanks, applied.

- Arnaldo

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

* [tip:perf/core] tools build feature: Fix feature_check_display_code typo
  2015-12-23 17:58 ` [PATCH 1/5] tools build feature: Fix feature_check_display_code typo Jiri Olsa
@ 2016-01-09 16:26   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 14+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:26 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: namhyung, mingo, acme, jolsa, linux-kernel, pi3orama, lizefan,
	wangnan0, a.p.zijlstra, dsahern, tglx, hpa

Commit-ID:  d0018b495c0429af3efc1b54f16d291a9fa8b4be
Gitweb:     http://git.kernel.org/tip/d0018b495c0429af3efc1b54f16d291a9fa8b4be
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 23 Dec 2015 18:58:30 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 6 Jan 2016 20:11:13 -0300

tools build feature: Fix feature_check_display_code typo

This function is cursed.. ;-)

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Wang Nan <wangnan0@huawei.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama <pi3orama@163.com>
Link: http://lkml.kernel.org/r/1450893514-9158-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/Makefile.feature | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 6c0519d..a8b4bef 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -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

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

* [tip:perf/core] tools build feature: Move dwarf post unwind choice output into perf
  2015-12-23 17:58 ` [PATCH 2/5] tools build feature: Move dwarf post unwind choice output into perf Jiri Olsa
@ 2016-01-09 16:27   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 14+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:27 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, jolsa, namhyung, pi3orama, mingo, dsahern,
	tglx, a.p.zijlstra, acme, lizefan, wangnan0

Commit-ID:  76ee2ff342743e57cb6dc059d0aba90e0c4c9bfc
Gitweb:     http://git.kernel.org/tip/76ee2ff342743e57cb6dc059d0aba90e0c4c9bfc
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 23 Dec 2015 18:58:31 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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
  ...

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Wang Nan <wangnan0@huawei.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama <pi3orama@163.com>
Link: http://lkml.kernel.org/r/1450893514-9158-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/Makefile.feature | 9 ---------
 tools/perf/config/Makefile   | 4 ++++
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index a8b4bef..2075312 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -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
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index a552417..18b2f96 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -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
 

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

* [tip:perf/core] tools build feature: Introduce feature_assign macro
  2015-12-23 17:58 ` [PATCH 3/5] tools build feature: Introduce feature_ass macro Jiri Olsa
@ 2016-01-09 16:27   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 14+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:27 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, a.p.zijlstra, tglx, acme, dsahern, jolsa, lizefan,
	namhyung, wangnan0, mingo, pi3orama, hpa

Commit-ID:  c6a5f88f335ec43d2850d62bc4924f719d265670
Gitweb:     http://git.kernel.org/tip/c6a5f88f335ec43d2850d62bc4924f719d265670
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 23 Dec 2015 18:58:32 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Wang Nan <wangnan0@huawei.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama <pi3orama@163.com>
Link: http://lkml.kernel.org/r/1450893514-9158-4-git-send-email-jolsa@kernel.org
[ Rename it to feature_assign, the original shorter name was misleading, to say the least ;-) ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/Makefile.feature | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 2075312..b1b262e 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -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

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

* [tip:perf/core] tools build feature: Use value assignment form for FEATURE-DUMP file
  2015-12-23 17:58 ` [PATCH 4/5] tools build feature: Use value assignment form for FEATURE-DUMP file Jiri Olsa
@ 2016-01-09 16:27   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 14+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:27 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: lizefan, dsahern, acme, jolsa, wangnan0, linux-kernel, hpa,
	pi3orama, mingo, tglx, namhyung, a.p.zijlstra

Commit-ID:  936d120d5f6406377e622da3167cafc811d053ea
Gitweb:     http://git.kernel.org/tip/936d120d5f6406377e622da3167cafc811d053ea
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 23 Dec 2015 18:58:33 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Wang Nan <wangnan0@huawei.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama <pi3orama@163.com>
Link: http://lkml.kernel.org/r/1450893514-9158-5-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/Makefile.feature | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index b1b262e..02db3cd 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -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))

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

* [tip:perf/core] perf build: Use FEATURE-DUMP in bpf subproject
  2015-12-23 17:58 ` [PATCH 5/5] perf build: Use FEATURE-DUMP in bpf subproject Jiri Olsa
@ 2016-01-09 16:28   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 14+ messages in thread
From: tip-bot for Jiri Olsa @ 2016-01-09 16:28 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, acme, mingo, hpa, dsahern, jolsa, pi3orama, wangnan0,
	namhyung, lizefan, linux-kernel, a.p.zijlstra

Commit-ID:  58683600dfe377c883eb8217b5a9bfcfe231b3ff
Gitweb:     http://git.kernel.org/tip/58683600dfe377c883eb8217b5a9bfcfe231b3ff
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 23 Dec 2015 18:58:34 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Wang Nan <wangnan0@huawei.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama <pi3orama@163.com>
Link: http://lkml.kernel.org/r/1450893514-9158-6-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/bpf/Makefile   | 4 ++++
 tools/perf/Makefile.perf | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 636e3dd..919b717 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -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
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 569fcf0..404e3b1 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -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)

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

end of thread, other threads:[~2016-01-09 16:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-23 17:58 [PATCH 0/5] tools build: Make FEATURE_DUMP include makefile Jiri Olsa
2015-12-23 17:58 ` [PATCH 1/5] tools build feature: Fix feature_check_display_code typo Jiri Olsa
2016-01-09 16:26   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-12-23 17:58 ` [PATCH 2/5] tools build feature: Move dwarf post unwind choice output into perf Jiri Olsa
2016-01-09 16:27   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-12-23 17:58 ` [PATCH 3/5] tools build feature: Introduce feature_ass macro Jiri Olsa
2016-01-09 16:27   ` [tip:perf/core] tools build feature: Introduce feature_assign macro tip-bot for Jiri Olsa
2015-12-23 17:58 ` [PATCH 4/5] tools build feature: Use value assignment form for FEATURE-DUMP file Jiri Olsa
2016-01-09 16:27   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-12-23 17:58 ` [PATCH 5/5] perf build: Use FEATURE-DUMP in bpf subproject Jiri Olsa
2016-01-09 16:28   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-12-24  2:52 ` [PATCH 0/5] tools build: Make FEATURE_DUMP include makefile Wangnan (F)
2015-12-27 11:58   ` Jiri Olsa
2016-01-04 21:06     ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.