From patchwork Mon Dec 7 10:32:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 57760 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp1060611lbb; Mon, 7 Dec 2015 02:32:29 -0800 (PST) X-Received: by 10.67.23.135 with SMTP id ia7mr41669262pad.77.1449484349461; Mon, 07 Dec 2015 02:32:29 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tw2si13523936pab.238.2015.12.07.02.32.29; Mon, 07 Dec 2015 02:32:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755447AbbLGKc1 (ORCPT + 28 others); Mon, 7 Dec 2015 05:32:27 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:55839 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753277AbbLGKc0 (ORCPT ); Mon, 7 Dec 2015 05:32:26 -0500 Received: from 172.24.1.49 (EHLO szxeml434-hub.china.huawei.com) ([172.24.1.49]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DAJ55007; Mon, 07 Dec 2015 18:32:15 +0800 (CST) Received: from [127.0.0.1] (10.111.66.109) by szxeml434-hub.china.huawei.com (10.82.67.225) with Microsoft SMTP Server id 14.3.235.1; Mon, 7 Dec 2015 18:32:10 +0800 Message-ID: <5665602A.7020600@huawei.com> Date: Mon, 7 Dec 2015 18:32:10 +0800 From: "Wangnan (F)" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Jiri Olsa CC: Arnaldo Carvalho de Melo , lkml , David Ahern , Ingo Molnar , Namhyung Kim , Jiri Olsa , Peter Zijlstra Subject: Re: [PATCH 1/2] tools build: Introduce features dump include makefile References: <1448615211-16074-1-git-send-email-jolsa@kernel.org> <20151207085613.GA21484@krava.brq.redhat.com> <56654FE1.50304@huawei.com> <20151207102949.GD21484@krava.brq.redhat.com> In-Reply-To: <20151207102949.GD21484@krava.brq.redhat.com> X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.56656030.01A4, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 8dc0a3cda965591f309128f404f4ec35 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> >> 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/ 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))