linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] tools build: Introduce features dump include makefile
@ 2015-11-27  9:06 Jiri Olsa
  2015-11-27  9:06 ` [PATCH 2/2] perf build: Use FEATURE-INCLUDE in bpf subproject Jiri Olsa
  2015-12-07  8:56 ` [PATCH 1/2] tools build: Introduce features dump include makefile Jiri Olsa
  0 siblings, 2 replies; 11+ messages in thread
From: Jiri Olsa @ 2015-11-27  9:06 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Wang Nan, lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

Creating the FEATURE-INCLUDE file, that contains all features
status dumped in make's variable format:
   ...
   feature-backtrace=1
   feature-dwarf=1
   ...

It's purpose is to be included in sub-project makefiles to get
features detection state. This way we can run the detection only
in top level project and propagate it down.

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

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 37ff4c9f92f1..51f8d5928f98 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -131,6 +131,16 @@ ifeq ($(dwarf-post-unwind),1)
   FEATURE_DUMP += dwarf-post-unwind($(dwarf-post-unwind-text))
 endif
 
+# The FEATURE-INCLUDE file contains all features status
+# dumped in make's variable format:
+#   ...
+#   feature-backtrace=1
+#   feature-dwarf=1
+#   ...
+# It's to be included in sub-project makefiles to get
+# features detection state.
+FEATURE_INCLUDE_FILENAME = $(OUTPUT)FEATURE-INCLUDE$(FEATURE_USER)
+
 # The $(feature_display) controls the default detection message
 # output. It's set if:
 # - detected features differes from stored features from
@@ -140,6 +150,8 @@ endif
 
 ifneq ("$(FEATURE_DUMP)","$(FEATURE_DUMP_FILE)")
   $(shell echo "$(FEATURE_DUMP)" > $(FEATURE_DUMP_FILENAME))
+  $(shell rm -f $(FEATURE_INCLUDE_FILENAME))
+  $(foreach feat,$(FEATURE_TESTS),$(shell echo "feature-$(feat)=$(feature-$(feat))" >> $(FEATURE_INCLUDE_FILENAME)))
   feature_display := 1
 endif
 
diff --git a/tools/lib/bpf/.gitignore b/tools/lib/bpf/.gitignore
index f81e549ddfdb..4019b8e4021a 100644
--- a/tools/lib/bpf/.gitignore
+++ b/tools/lib/bpf/.gitignore
@@ -1,2 +1,3 @@
 libbpf_version.h
 FEATURE-DUMP.libbpf
+FEATURE-INCLUDE.libbpf
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 636e3ddb93a1..6916cbe962a5 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -190,7 +190,7 @@ config-clean:
 clean:
 	$(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d \
 		$(RM) LIBBPF-CFLAGS
-	$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf
+	$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf $(OUTPUT)FEATURE-INCLUDE.libbpf
 
 
 
diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore
index 3d1bb802dbf4..4a3eb8dedc54 100644
--- a/tools/perf/.gitignore
+++ b/tools/perf/.gitignore
@@ -2,6 +2,7 @@ PERF-CFLAGS
 PERF-GUI-VARS
 PERF-VERSION-FILE
 FEATURE-DUMP
+FEATURE-INCLUDE
 perf
 perf-read-vdso32
 perf-read-vdsox32
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 929a32ba15f5..b74f924185b7 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -589,7 +589,7 @@ clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean config-clean
 	$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
 	$(Q)$(RM) $(OUTPUT).config-detected
 	$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32
-	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
+	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)FEATURE-INCLUDE $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
 		$(OUTPUT)util/intel-pt-decoder/inat-tables.c
 	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
 	$(python-clean)
-- 
2.4.3


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

* [PATCH 2/2] perf build: Use FEATURE-INCLUDE in bpf subproject
  2015-11-27  9:06 [PATCH 1/2] tools build: Introduce features dump include makefile Jiri Olsa
@ 2015-11-27  9:06 ` Jiri Olsa
  2015-12-07  8:56 ` [PATCH 1/2] tools build: Introduce features dump include makefile Jiri Olsa
  1 sibling, 0 replies; 11+ messages in thread
From: Jiri Olsa @ 2015-11-27  9:06 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Wang Nan, lkml, David Ahern, Ingo Molnar, Namhyung Kim, Peter Zijlstra

Using FEATURE-INCLUDE in bpf subproject in case bpf is built
via perf. Keep the current features detection for other cases.

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 6916cbe962a5..6b9af77418b3 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -80,7 +80,11 @@ endif
 endif
 
 ifeq ($(check_feat),1)
+ifeq ($(FEATURES_INCLUDE),)
 include $(srctree)/tools/build/Makefile.feature
+else
+include $(FEATURES_INCLUDE)
+endif
 endif
 
 export prefix libdir src obj
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index b74f924185b7..7338a7e62fcd 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -431,7 +431,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_INCLUDE=$(realpath $(OUTPUT)FEATURE-INCLUDE)
 
 $(LIBBPF)-clean:
 	$(call QUIET_CLEAN, libbpf)
-- 
2.4.3


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

* Re: [PATCH 1/2] tools build: Introduce features dump include makefile
  2015-11-27  9:06 [PATCH 1/2] tools build: Introduce features dump include makefile Jiri Olsa
  2015-11-27  9:06 ` [PATCH 2/2] perf build: Use FEATURE-INCLUDE in bpf subproject Jiri Olsa
@ 2015-12-07  8:56 ` Jiri Olsa
  2015-12-07  9:22   ` Wangnan (F)
  1 sibling, 1 reply; 11+ messages in thread
From: Jiri Olsa @ 2015-12-07  8:56 UTC (permalink / raw)
  To: Wang Nan
  Cc: Arnaldo Carvalho de Melo, Wang Nan, lkml, David Ahern,
	Ingo Molnar, Namhyung Kim, Jiri Olsa, Peter Zijlstra

ping, Wang Nan, any comments on these 2?

thanks,
jirka

On Fri, Nov 27, 2015 at 10:06:50AM +0100, Jiri Olsa wrote:
> Creating the FEATURE-INCLUDE file, that contains all features
> status dumped in make's variable format:
>    ...
>    feature-backtrace=1
>    feature-dwarf=1
>    ...
> 
> It's purpose is to be included in sub-project makefiles to get
> features detection state. This way we can run the detection only
> in top level project and propagate it down.
> 
> Cc: Wang Nan <wangnan0@huawei.com>
> Link: http://lkml.kernel.org/n/tip-fcq5rtdhcu4300sjp2p8l936@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/build/Makefile.feature | 12 ++++++++++++
>  tools/lib/bpf/.gitignore     |  1 +
>  tools/lib/bpf/Makefile       |  2 +-
>  tools/perf/.gitignore        |  1 +
>  tools/perf/Makefile.perf     |  2 +-
>  5 files changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
> index 37ff4c9f92f1..51f8d5928f98 100644
> --- a/tools/build/Makefile.feature
> +++ b/tools/build/Makefile.feature
> @@ -131,6 +131,16 @@ ifeq ($(dwarf-post-unwind),1)
>    FEATURE_DUMP += dwarf-post-unwind($(dwarf-post-unwind-text))
>  endif
>  
> +# The FEATURE-INCLUDE file contains all features status
> +# dumped in make's variable format:
> +#   ...
> +#   feature-backtrace=1
> +#   feature-dwarf=1
> +#   ...
> +# It's to be included in sub-project makefiles to get
> +# features detection state.
> +FEATURE_INCLUDE_FILENAME = $(OUTPUT)FEATURE-INCLUDE$(FEATURE_USER)
> +
>  # The $(feature_display) controls the default detection message
>  # output. It's set if:
>  # - detected features differes from stored features from
> @@ -140,6 +150,8 @@ endif
>  
>  ifneq ("$(FEATURE_DUMP)","$(FEATURE_DUMP_FILE)")
>    $(shell echo "$(FEATURE_DUMP)" > $(FEATURE_DUMP_FILENAME))
> +  $(shell rm -f $(FEATURE_INCLUDE_FILENAME))
> +  $(foreach feat,$(FEATURE_TESTS),$(shell echo "feature-$(feat)=$(feature-$(feat))" >> $(FEATURE_INCLUDE_FILENAME)))
>    feature_display := 1
>  endif
>  
> diff --git a/tools/lib/bpf/.gitignore b/tools/lib/bpf/.gitignore
> index f81e549ddfdb..4019b8e4021a 100644
> --- a/tools/lib/bpf/.gitignore
> +++ b/tools/lib/bpf/.gitignore
> @@ -1,2 +1,3 @@
>  libbpf_version.h
>  FEATURE-DUMP.libbpf
> +FEATURE-INCLUDE.libbpf
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index 636e3ddb93a1..6916cbe962a5 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -190,7 +190,7 @@ config-clean:
>  clean:
>  	$(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d \
>  		$(RM) LIBBPF-CFLAGS
> -	$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf
> +	$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf $(OUTPUT)FEATURE-INCLUDE.libbpf
>  
>  
>  
> diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore
> index 3d1bb802dbf4..4a3eb8dedc54 100644
> --- a/tools/perf/.gitignore
> +++ b/tools/perf/.gitignore
> @@ -2,6 +2,7 @@ PERF-CFLAGS
>  PERF-GUI-VARS
>  PERF-VERSION-FILE
>  FEATURE-DUMP
> +FEATURE-INCLUDE
>  perf
>  perf-read-vdso32
>  perf-read-vdsox32
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 929a32ba15f5..b74f924185b7 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -589,7 +589,7 @@ clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean config-clean
>  	$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
>  	$(Q)$(RM) $(OUTPUT).config-detected
>  	$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32
> -	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
> +	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)FEATURE-INCLUDE $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
>  		$(OUTPUT)util/intel-pt-decoder/inat-tables.c
>  	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
>  	$(python-clean)
> -- 
> 2.4.3
> 

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

* Re: [PATCH 1/2] tools build: Introduce features dump include makefile
  2015-12-07  8:56 ` [PATCH 1/2] tools build: Introduce features dump include makefile Jiri Olsa
@ 2015-12-07  9:22   ` Wangnan (F)
  2015-12-07 10:29     ` Jiri Olsa
  0 siblings, 1 reply; 11+ messages in thread
From: Wangnan (F) @ 2015-12-07  9:22 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, lkml, David Ahern, Ingo Molnar,
	Namhyung Kim, Jiri Olsa, Peter Zijlstra

Sorry for the late response...

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

But I'm thinking whether we can remove FEATURE-DUMP and rely on
FEATURE-INCLUDE only, since they contain same information...

Thank you.

On 2015/12/7 16:56, Jiri Olsa wrote:
> ping, Wang Nan, any comments on these 2?
>
> thanks,
> jirka
>
> On Fri, Nov 27, 2015 at 10:06:50AM +0100, Jiri Olsa wrote:
>> Creating the FEATURE-INCLUDE file, that contains all features
>> status dumped in make's variable format:
>>     ...
>>     feature-backtrace=1
>>     feature-dwarf=1
>>     ...
>>
>> It's purpose is to be included in sub-project makefiles to get
>> features detection state. This way we can run the detection only
>> in top level project and propagate it down.
>>
>> Cc: Wang Nan <wangnan0@huawei.com>
>> Link: http://lkml.kernel.org/n/tip-fcq5rtdhcu4300sjp2p8l936@git.kernel.org
>> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
>> ---
>>   tools/build/Makefile.feature | 12 ++++++++++++
>>   tools/lib/bpf/.gitignore     |  1 +
>>   tools/lib/bpf/Makefile       |  2 +-
>>   tools/perf/.gitignore        |  1 +
>>   tools/perf/Makefile.perf     |  2 +-
>>   5 files changed, 16 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
>> index 37ff4c9f92f1..51f8d5928f98 100644
>> --- a/tools/build/Makefile.feature
>> +++ b/tools/build/Makefile.feature
>> @@ -131,6 +131,16 @@ ifeq ($(dwarf-post-unwind),1)
>>     FEATURE_DUMP += dwarf-post-unwind($(dwarf-post-unwind-text))
>>   endif
>>   
>> +# The FEATURE-INCLUDE file contains all features status
>> +# dumped in make's variable format:
>> +#   ...
>> +#   feature-backtrace=1
>> +#   feature-dwarf=1
>> +#   ...
>> +# It's to be included in sub-project makefiles to get
>> +# features detection state.
>> +FEATURE_INCLUDE_FILENAME = $(OUTPUT)FEATURE-INCLUDE$(FEATURE_USER)
>> +
>>   # The $(feature_display) controls the default detection message
>>   # output. It's set if:
>>   # - detected features differes from stored features from
>> @@ -140,6 +150,8 @@ endif
>>   
>>   ifneq ("$(FEATURE_DUMP)","$(FEATURE_DUMP_FILE)")
>>     $(shell echo "$(FEATURE_DUMP)" > $(FEATURE_DUMP_FILENAME))
>> +  $(shell rm -f $(FEATURE_INCLUDE_FILENAME))
>> +  $(foreach feat,$(FEATURE_TESTS),$(shell echo "feature-$(feat)=$(feature-$(feat))" >> $(FEATURE_INCLUDE_FILENAME)))
>>     feature_display := 1
>>   endif
>>   
>> diff --git a/tools/lib/bpf/.gitignore b/tools/lib/bpf/.gitignore
>> index f81e549ddfdb..4019b8e4021a 100644
>> --- a/tools/lib/bpf/.gitignore
>> +++ b/tools/lib/bpf/.gitignore
>> @@ -1,2 +1,3 @@
>>   libbpf_version.h
>>   FEATURE-DUMP.libbpf
>> +FEATURE-INCLUDE.libbpf
>> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
>> index 636e3ddb93a1..6916cbe962a5 100644
>> --- a/tools/lib/bpf/Makefile
>> +++ b/tools/lib/bpf/Makefile
>> @@ -190,7 +190,7 @@ config-clean:
>>   clean:
>>   	$(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d \
>>   		$(RM) LIBBPF-CFLAGS
>> -	$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf
>> +	$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf $(OUTPUT)FEATURE-INCLUDE.libbpf
>>   
>>   
>>   
>> diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore
>> index 3d1bb802dbf4..4a3eb8dedc54 100644
>> --- a/tools/perf/.gitignore
>> +++ b/tools/perf/.gitignore
>> @@ -2,6 +2,7 @@ PERF-CFLAGS
>>   PERF-GUI-VARS
>>   PERF-VERSION-FILE
>>   FEATURE-DUMP
>> +FEATURE-INCLUDE
>>   perf
>>   perf-read-vdso32
>>   perf-read-vdsox32
>> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
>> index 929a32ba15f5..b74f924185b7 100644
>> --- a/tools/perf/Makefile.perf
>> +++ b/tools/perf/Makefile.perf
>> @@ -589,7 +589,7 @@ clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean config-clean
>>   	$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
>>   	$(Q)$(RM) $(OUTPUT).config-detected
>>   	$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32
>> -	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
>> +	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)FEATURE-INCLUDE $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
>>   		$(OUTPUT)util/intel-pt-decoder/inat-tables.c
>>   	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
>>   	$(python-clean)
>> -- 
>> 2.4.3
>>



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

* Re: [PATCH 1/2] tools build: Introduce features dump include makefile
  2015-12-07  9:22   ` Wangnan (F)
@ 2015-12-07 10:29     ` Jiri Olsa
  2015-12-07 10:32       ` Wangnan (F)
  0 siblings, 1 reply; 11+ messages in thread
From: Jiri Olsa @ 2015-12-07 10:29 UTC (permalink / raw)
  To: Wangnan (F)
  Cc: Arnaldo Carvalho de Melo, lkml, David Ahern, Ingo Molnar,
	Namhyung Kim, Jiri Olsa, Peter Zijlstra

On Mon, Dec 07, 2015 at 05:22:41PM +0800, Wangnan (F) wrote:
> Sorry for the late response...
> 
> Tested-by: Wang Nan <wangnan0@huawei.com>
> 
> But I'm thinking whether we can remove FEATURE-DUMP and rely on
> FEATURE-INCLUDE only, since they contain same information...

had the same thought, but the issue I hit is that I couldn't
find a way to create *multiline* contents for FEATURE-INCLUDE
variable in make

maybe we could use internally signle line contents and
convert multiline contents of FEATURE-INCLUDE into singleline
variable for checking against live info

jirka

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

* Re: [PATCH 1/2] tools build: Introduce features dump include makefile
  2015-12-07 10:29     ` Jiri Olsa
@ 2015-12-07 10:32       ` Wangnan (F)
  2015-12-07 10:38         ` Wangnan (F)
  0 siblings, 1 reply; 11+ messages in thread
From: Wangnan (F) @ 2015-12-07 10:32 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, lkml, David Ahern, Ingo Molnar,
	Namhyung Kim, Jiri Olsa, Peter Zijlstra



On 2015/12/7 18:29, Jiri Olsa wrote:
> On Mon, Dec 07, 2015 at 05:22:41PM +0800, Wangnan (F) wrote:
>> Sorry for the late response...
>>
>> Tested-by: Wang Nan <wangnan0@huawei.com>
>>
>> But I'm thinking whether we can remove FEATURE-DUMP and rely on
>> FEATURE-INCLUDE only, since they contain same information...
> had the same thought, but the issue I hit is that I couldn't
> find a way to create *multiline* contents for FEATURE-INCLUDE
> variable in make
>
> maybe we could use internally signle line contents and
> convert multiline contents of FEATURE-INCLUDE into singleline
> variable for checking against live info

What about this? The drawback is it heavily rely on shell commands...

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 51f8d59..514c4e6 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -123,9 +123,8 @@ define feature_print_text_code
      MSG = $(shell printf '...%30s: %s' $(1) $(2))
  endef

-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))
+#FEATURE_DUMP_FILENAME = $(OUTPUT)FEATURE-DUMP$(FEATURE_USER)
+#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))
@@ -141,6 +140,9 @@ endif
  # features detection state.
  FEATURE_INCLUDE_FILENAME = $(OUTPUT)FEATURE-INCLUDE$(FEATURE_USER)

+FEATURE_DUMP := $(foreach 
feat,$(FEATURE_DISPLAY),feature-$(feat)($(feature-$(feat))))
+FEATURE_DUMP_FILE := $(foreach feat,$(FEATURE_DISPLAY),$(shell touch 
$(FEATURE_INCLUDE_FILENAME); cat $(FEATURE_INCLUDE_FILENAME) | grep 
'feature-$(feat)=' | sed 's/=\(.\)/(\1)/g'))
+
  # The $(feature_display) controls the default detection message
  # output. It's set if:
  # - detected features differes from stored features from

> jirka



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

* Re: [PATCH 1/2] tools build: Introduce features dump include makefile
  2015-12-07 10:32       ` Wangnan (F)
@ 2015-12-07 10:38         ` Wangnan (F)
  2015-12-07 10:48           ` [PATCH] tools build: Remove FEATURE-DUMP Wang Nan
  0 siblings, 1 reply; 11+ messages in thread
From: Wangnan (F) @ 2015-12-07 10:38 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, lkml, David Ahern, Ingo Molnar,
	Namhyung Kim, Jiri Olsa, Peter Zijlstra



On 2015/12/7 18:32, Wangnan (F) wrote:
>
>
> On 2015/12/7 18:29, Jiri Olsa wrote:
>> On Mon, Dec 07, 2015 at 05:22:41PM +0800, Wangnan (F) wrote:
>>> Sorry for the late response...
>>>
>>> Tested-by: Wang Nan <wangnan0@huawei.com>
>>>
>>> But I'm thinking whether we can remove FEATURE-DUMP and rely on
>>> FEATURE-INCLUDE only, since they contain same information...
>> had the same thought, but the issue I hit is that I couldn't
>> find a way to create *multiline* contents for FEATURE-INCLUDE
>> variable in make
>>
>> maybe we could use internally signle line contents and
>> convert multiline contents of FEATURE-INCLUDE into singleline
>> variable for checking against live info
>
> What about this? The drawback is it heavily rely on shell commands...
>
> diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
> index 51f8d59..514c4e6 100644
> --- a/tools/build/Makefile.feature
> +++ b/tools/build/Makefile.feature
> @@ -123,9 +123,8 @@ define feature_print_text_code
>      MSG = $(shell printf '...%30s: %s' $(1) $(2))
>  endef
>
> -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))
> +#FEATURE_DUMP_FILENAME = $(OUTPUT)FEATURE-DUMP$(FEATURE_USER)
> +#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))
> @@ -141,6 +140,9 @@ endif
>  # features detection state.
>  FEATURE_INCLUDE_FILENAME = $(OUTPUT)FEATURE-INCLUDE$(FEATURE_USER)
>
> +FEATURE_DUMP := $(foreach 
> feat,$(FEATURE_DISPLAY),feature-$(feat)($(feature-$(feat))))
> +FEATURE_DUMP_FILE := $(foreach feat,$(FEATURE_DISPLAY),$(shell touch 
> $(FEATURE_INCLUDE_FILENAME); cat $(FEATURE_INCLUDE_FILENAME) | grep 
> 'feature-$(feat)=' | sed 's/=\(.\)/(\1)/g'))

We can avoid this 'sed' by transforming feature-xxx(1) to feature-xxx=1, 
then it would be uniformed
with strings in FEATURE-INCLUDE...

Will provide a patch with my SOB.

Thank you.

> +
>  # The $(feature_display) controls the default detection message
>  # output. It's set if:
>  # - detected features differes from stored features from
>
>> jirka
>



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

* [PATCH] tools build: Remove FEATURE-DUMP
  2015-12-07 10:38         ` Wangnan (F)
@ 2015-12-07 10:48           ` Wang Nan
  2015-12-07 13:52             ` Jiri Olsa
  0 siblings, 1 reply; 11+ messages in thread
From: Wang Nan @ 2015-12-07 10:48 UTC (permalink / raw)
  To: acme, jolsa; +Cc: linux-kernel, pi3orama, lizefan, Wang Nan, Jiri Olsa

Jiri introduces a FEATURE-INCLUDE file for feature checking. It
contains same information with FEATURE-DUMP, so we can avoid generating
FEATURE-DUMP.

Following modification should ensure FEATURE_TESTS contains
FEATURE_DISPLAY.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
---

I haven't thoroughly tested this patch, just want to show the
possibility of removing FEATURE-DUMP. I don't insist on this. Jiri, if
you find this patch is not good please simply ignore it.

Thank you.

---

 tools/build/Makefile.feature | 8 +++-----
 tools/lib/bpf/.gitignore     | 1 -
 tools/lib/bpf/Makefile       | 2 +-
 tools/perf/.gitignore        | 1 -
 tools/perf/Makefile.perf     | 2 +-
 5 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 51f8d59..98a13bd 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -123,10 +123,6 @@ define feature_print_text_code
     MSG = $(shell printf '...%30s: %s' $(1) $(2))
 endef
 
-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
@@ -141,6 +137,9 @@ endif
 # features detection state.
 FEATURE_INCLUDE_FILENAME = $(OUTPUT)FEATURE-INCLUDE$(FEATURE_USER)
 
+FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),feature-$(feat)=$(feature-$(feat)))
+FEATURE_DUMP_FILE := $(foreach feat,$(FEATURE_DISPLAY),$(shell touch $(FEATURE_INCLUDE_FILENAME); cat $(FEATURE_INCLUDE_FILENAME) | grep 'feature-$(feat)='))
+
 # The $(feature_display) controls the default detection message
 # output. It's set if:
 # - detected features differes from stored features from
@@ -149,7 +148,6 @@ FEATURE_INCLUDE_FILENAME = $(OUTPUT)FEATURE-INCLUDE$(FEATURE_USER)
 # - VF is enabled
 
 ifneq ("$(FEATURE_DUMP)","$(FEATURE_DUMP_FILE)")
-  $(shell echo "$(FEATURE_DUMP)" > $(FEATURE_DUMP_FILENAME))
   $(shell rm -f $(FEATURE_INCLUDE_FILENAME))
   $(foreach feat,$(FEATURE_TESTS),$(shell echo "feature-$(feat)=$(feature-$(feat))" >> $(FEATURE_INCLUDE_FILENAME)))
   feature_display := 1
diff --git a/tools/lib/bpf/.gitignore b/tools/lib/bpf/.gitignore
index 4019b8e..c4cc003 100644
--- a/tools/lib/bpf/.gitignore
+++ b/tools/lib/bpf/.gitignore
@@ -1,3 +1,2 @@
 libbpf_version.h
-FEATURE-DUMP.libbpf
 FEATURE-INCLUDE.libbpf
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 6b9af77..6bc3cb5 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -194,7 +194,7 @@ config-clean:
 clean:
 	$(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d \
 		$(RM) LIBBPF-CFLAGS
-	$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf $(OUTPUT)FEATURE-INCLUDE.libbpf
+	$(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-INCLUDE.libbpf
 
 
 
diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore
index 4a3eb8d..5e93718 100644
--- a/tools/perf/.gitignore
+++ b/tools/perf/.gitignore
@@ -1,7 +1,6 @@
 PERF-CFLAGS
 PERF-GUI-VARS
 PERF-VERSION-FILE
-FEATURE-DUMP
 FEATURE-INCLUDE
 perf
 perf-read-vdso32
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 7338a7e..7cccf11 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -589,7 +589,7 @@ clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean config-clean
 	$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
 	$(Q)$(RM) $(OUTPUT).config-detected
 	$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32
-	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)FEATURE-INCLUDE $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
+	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-INCLUDE $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
 		$(OUTPUT)util/intel-pt-decoder/inat-tables.c
 	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
 	$(python-clean)
-- 
1.8.3.4


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

* Re: [PATCH] tools build: Remove FEATURE-DUMP
  2015-12-07 10:48           ` [PATCH] tools build: Remove FEATURE-DUMP Wang Nan
@ 2015-12-07 13:52             ` Jiri Olsa
  2015-12-18  8:41               ` Wangnan (F)
  0 siblings, 1 reply; 11+ messages in thread
From: Jiri Olsa @ 2015-12-07 13:52 UTC (permalink / raw)
  To: Wang Nan; +Cc: acme, linux-kernel, pi3orama, lizefan, Jiri Olsa

On Mon, Dec 07, 2015 at 10:48:58AM +0000, Wang Nan wrote:
> Jiri introduces a FEATURE-INCLUDE file for feature checking. It
> contains same information with FEATURE-DUMP, so we can avoid generating
> FEATURE-DUMP.
> 
> Following modification should ensure FEATURE_TESTS contains
> FEATURE_DISPLAY.
> 
> Signed-off-by: Wang Nan <wangnan0@huawei.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> ---
> 
> I haven't thoroughly tested this patch, just want to show the
> possibility of removing FEATURE-DUMP. I don't insist on this. Jiri, if
> you find this patch is not good please simply ignore it.
> 
> Thank you.
> 
> ---
> 
>  tools/build/Makefile.feature | 8 +++-----
>  tools/lib/bpf/.gitignore     | 1 -
>  tools/lib/bpf/Makefile       | 2 +-
>  tools/perf/.gitignore        | 1 -
>  tools/perf/Makefile.perf     | 2 +-
>  5 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
> index 51f8d59..98a13bd 100644
> --- a/tools/build/Makefile.feature
> +++ b/tools/build/Makefile.feature
> @@ -123,10 +123,6 @@ define feature_print_text_code
>      MSG = $(shell printf '...%30s: %s' $(1) $(2))
>  endef
>  
> -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
> @@ -141,6 +137,9 @@ endif
>  # features detection state.
>  FEATURE_INCLUDE_FILENAME = $(OUTPUT)FEATURE-INCLUDE$(FEATURE_USER)
>  
> +FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),feature-$(feat)=$(feature-$(feat)))
> +FEATURE_DUMP_FILE := $(foreach feat,$(FEATURE_DISPLAY),$(shell touch $(FEATURE_INCLUDE_FILENAME); cat $(FEATURE_INCLUDE_FILENAME) | grep 'feature-$(feat)='))

hum, this ignores dwarf-post-unwind setup, I think it needs more changes
I'll post new version

thanks.
jirka

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

* Re: [PATCH] tools build: Remove FEATURE-DUMP
  2015-12-07 13:52             ` Jiri Olsa
@ 2015-12-18  8:41               ` Wangnan (F)
  2015-12-18 10:13                 ` Jiri Olsa
  0 siblings, 1 reply; 11+ messages in thread
From: Wangnan (F) @ 2015-12-18  8:41 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: acme, linux-kernel, pi3orama, lizefan, Jiri Olsa



On 2015/12/7 21:52, Jiri Olsa wrote:
> On Mon, Dec 07, 2015 at 10:48:58AM +0000, Wang Nan wrote:
>> Jiri introduces a FEATURE-INCLUDE file for feature checking. It
>> contains same information with FEATURE-DUMP, so we can avoid generating
>> FEATURE-DUMP.
>>
>> Following modification should ensure FEATURE_TESTS contains
>> FEATURE_DISPLAY.
>>
>> Signed-off-by: Wang Nan <wangnan0@huawei.com>
>> Cc: Jiri Olsa <jolsa@kernel.org>
>> ---
>>
>> I haven't thoroughly tested this patch, just want to show the
>> possibility of removing FEATURE-DUMP. I don't insist on this. Jiri, if
>> you find this patch is not good please simply ignore it.
>>
>> Thank you.
>>
>> ---
>>
>>   tools/build/Makefile.feature | 8 +++-----
>>   tools/lib/bpf/.gitignore     | 1 -
>>   tools/lib/bpf/Makefile       | 2 +-
>>   tools/perf/.gitignore        | 1 -
>>   tools/perf/Makefile.perf     | 2 +-
>>   5 files changed, 5 insertions(+), 9 deletions(-)
>>
>> diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
>> index 51f8d59..98a13bd 100644
>> --- a/tools/build/Makefile.feature
>> +++ b/tools/build/Makefile.feature
>> @@ -123,10 +123,6 @@ define feature_print_text_code
>>       MSG = $(shell printf '...%30s: %s' $(1) $(2))
>>   endef
>>   
>> -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
>> @@ -141,6 +137,9 @@ endif
>>   # features detection state.
>>   FEATURE_INCLUDE_FILENAME = $(OUTPUT)FEATURE-INCLUDE$(FEATURE_USER)
>>   
>> +FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),feature-$(feat)=$(feature-$(feat)))
>> +FEATURE_DUMP_FILE := $(foreach feat,$(FEATURE_DISPLAY),$(shell touch $(FEATURE_INCLUDE_FILENAME); cat $(FEATURE_INCLUDE_FILENAME) | grep 'feature-$(feat)='))
> hum, this ignores dwarf-post-unwind setup, I think it needs more changes
> I'll post new version

Hi Jiri,

What the current status of this patch and 'tools build: Introduce
features dump include makefile'? They are in my local tree for a long time.

Thank you.



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

* Re: [PATCH] tools build: Remove FEATURE-DUMP
  2015-12-18  8:41               ` Wangnan (F)
@ 2015-12-18 10:13                 ` Jiri Olsa
  0 siblings, 0 replies; 11+ messages in thread
From: Jiri Olsa @ 2015-12-18 10:13 UTC (permalink / raw)
  To: Wangnan (F); +Cc: acme, linux-kernel, pi3orama, lizefan, Jiri Olsa

On Fri, Dec 18, 2015 at 04:41:05PM +0800, Wangnan (F) wrote:

SNIP

> >>  # features detection state.
> >>  FEATURE_INCLUDE_FILENAME = $(OUTPUT)FEATURE-INCLUDE$(FEATURE_USER)
> >>+FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),feature-$(feat)=$(feature-$(feat)))
> >>+FEATURE_DUMP_FILE := $(foreach feat,$(FEATURE_DISPLAY),$(shell touch $(FEATURE_INCLUDE_FILENAME); cat $(FEATURE_INCLUDE_FILENAME) | grep 'feature-$(feat)='))
> >hum, this ignores dwarf-post-unwind setup, I think it needs more changes
> >I'll post new version
> 
> Hi Jiri,
> 
> What the current status of this patch and 'tools build: Introduce
> features dump include makefile'? They are in my local tree for a long time.

hi,
I'll try to send it out next week.. I needed to factor the code a little

jirka

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

end of thread, other threads:[~2015-12-18 10:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-27  9:06 [PATCH 1/2] tools build: Introduce features dump include makefile Jiri Olsa
2015-11-27  9:06 ` [PATCH 2/2] perf build: Use FEATURE-INCLUDE in bpf subproject Jiri Olsa
2015-12-07  8:56 ` [PATCH 1/2] tools build: Introduce features dump include makefile Jiri Olsa
2015-12-07  9:22   ` Wangnan (F)
2015-12-07 10:29     ` Jiri Olsa
2015-12-07 10:32       ` Wangnan (F)
2015-12-07 10:38         ` Wangnan (F)
2015-12-07 10:48           ` [PATCH] tools build: Remove FEATURE-DUMP Wang Nan
2015-12-07 13:52             ` Jiri Olsa
2015-12-18  8:41               ` Wangnan (F)
2015-12-18 10:13                 ` Jiri Olsa

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