diff mbox

[1/2] tools build: Introduce features dump include makefile

Message ID 5665602A.7020600@huawei.com
State New
Headers show

Commit Message

Wang Nan Dec. 7, 2015, 10:32 a.m. UTC
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...


  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



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Comments

Wang Nan Dec. 7, 2015, 10:38 a.m. UTC | #1
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

>



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
diff mbox

Patch

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