From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 90F3621F833DB for ; Sun, 7 Jan 2018 22:06:50 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jan 2018 22:11:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,329,1511856000"; d="scan'208";a="8933444" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga008.jf.intel.com with ESMTP; 07 Jan 2018 22:11:59 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 7 Jan 2018 22:11:46 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.213]) with mapi id 14.03.0319.002; Mon, 8 Jan 2018 14:11:26 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: Not print SKUID info for PCD when it is only Single SKUID Thread-Index: AQHThT3kBDuyeMzlzE+c8ynLydBcu6NphIjA Date: Mon, 8 Jan 2018 06:11:25 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1A031B@SHSMSX104.ccr.corp.intel.com> References: <1515057877-1940-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1515057877-1940-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: Not print SKUID info for PCD when it is only Single SKUID X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jan 2018 06:06:50 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of >Yonghong Zhu >Sent: Thursday, January 04, 2018 5:25 PM >To: edk2-devel@lists.01.org >Subject: [edk2] [Patch] BaseTools: Not print SKUID info for PCD when it is= only >Single SKUID > >when it is only single SKUID, we don't need to print the SKUID info for >every PCD since in the Global section there already have this info. >For DefaultStore, we use same rule. > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Yonghong Zhu >--- > BaseTools/Source/Python/build/BuildReport.py | 94 +++++++++++++++++--- >-------- > 1 file changed, 59 insertions(+), 35 deletions(-) > >diff --git a/BaseTools/Source/Python/build/BuildReport.py >b/BaseTools/Source/Python/build/BuildReport.py >index 5da9914..d2ac044 100644 >--- a/BaseTools/Source/Python/build/BuildReport.py >+++ b/BaseTools/Source/Python/build/BuildReport.py >@@ -2,11 +2,11 @@ > # Routines for generating build report. > # > # This module contains the functionality to generate build report after > # build all target completes successfully. > # >-# Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
>+# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
> # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the B= SD >License > # which accompanies this distribution. The full text of the license may = be >found at > # http://opensource.org/licenses/bsd-license.php > # >@@ -754,10 +754,17 @@ class PcdReport(object): > if Wa.FdfProfile: > self.FdfPcdSet =3D Wa.FdfProfile.PcdDict > else: > self.FdfPcdSet =3D {} > >+ self.DefaultStoreSingle =3D True >+ self.SkuSingle =3D True >+ if GlobalData.gDefaultStores and len(GlobalData.gDefaultStores) >= 1: >+ self.DefaultStoreSingle =3D False >+ if GlobalData.gSkuids and len(GlobalData.gSkuids) > 1: >+ self.SkuSingle =3D False >+ > self.ModulePcdOverride =3D {} > for Pa in Wa.AutoGenObjectList: > self.Arch =3D Pa.Arch > # > # Collect all platform referenced PCDs and grouped them by PC= D token >space >@@ -1123,81 +1130,98 @@ class PcdReport(object): > else: > FirstPrint =3D True > SkuList =3D sorted(Pcd.SkuInfoList.keys()) > for Sku in SkuList: > SkuInfo =3D Pcd.SkuInfoList[Sku] >+ SkuIdName =3D SkuInfo.SkuIdName > if TypeName in ('DYNHII', 'DEXHII'): > if SkuInfo.DefaultStoreDict: > DefaultStoreList =3D sorted(SkuInfo.DefaultStoreD= ict.keys()) > for DefaultStore in DefaultStoreList: > Value =3D SkuInfo.DefaultStoreDict[DefaultSto= re] > IsByteArray, ArrayList =3D ByteArrayForamt(Va= lue) > if FirstPrint: > FirstPrint =3D False > if IsByteArray: >- FileWrite(File, ' %-*s : %6s %10s %= 10s %10s =3D %s' % >(self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + >')', '(' + SkuInfo.SkuIdName + ')', '(' + DefaultStore + ')', '{')) >+ if self.DefaultStoreSingle and self.S= kuSingle: >+ FileWrite(File, ' %-*s : %6s %1= 0s =3D %s' % (self.MaxLen, >Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '{')) >+ elif self.DefaultStoreSingle and not = self.SkuSingle: >+ FileWrite(File, ' %-*s : %6s %1= 0s %10s =3D %s' % >(self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + >')', '(' + SkuIdName + ')', '{')) >+ elif not self.DefaultStoreSingle and = self.SkuSingle: >+ FileWrite(File, ' %-*s : %6s %1= 0s %10s =3D %s' % >(self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + >')', '(' + DefaultStore + ')', '{')) >+ else: >+ FileWrite(File, ' %-*s : %6s %1= 0s %10s %10s =3D %s' % >(self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + >')', '(' + SkuIdName + ')', '(' + DefaultStore + ')', '{')) > for Array in ArrayList: > FileWrite(File, '%s' % (Array)) > else: >- FileWrite(File, ' %-*s : %6s %10s %= 10s %10s =3D %s' % >(self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + >')', '(' + SkuInfo.SkuIdName + ')', '(' + DefaultStore + ')', Value)) >+ if self.DefaultStoreSingle and self.S= kuSingle: >+ FileWrite(File, ' %-*s : %6s %1= 0s =3D %s' % (self.MaxLen, >Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', Value)) >+ elif self.DefaultStoreSingle and not = self.SkuSingle: >+ FileWrite(File, ' %-*s : %6s %1= 0s %10s =3D %s' % >(self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + >')', '(' + SkuIdName + ')', Value)) >+ elif not self.DefaultStoreSingle and = self.SkuSingle: >+ FileWrite(File, ' %-*s : %6s %1= 0s %10s =3D %s' % >(self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + >')', '(' + DefaultStore + ')', Value)) >+ else: >+ FileWrite(File, ' %-*s : %6s %1= 0s %10s %10s =3D %s' % >(self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + >')', '(' + SkuIdName + ')', '(' + DefaultStore + ')', Value)) > else: > if IsByteArray: >- FileWrite(File, ' %-*s : %6s %10s %= 10s %10s =3D %s' % >(self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + >SkuInfo.SkuIdName + ')', '(' + DefaultStore + ')', '{')) >+ if self.DefaultStoreSingle and self.S= kuSingle: >+ FileWrite(File, ' %-*s : %6s %1= 0s =3D %s' % (self.MaxLen, ' ', >TypeName, '(' + Pcd.DatumType + ')', '{')) >+ elif self.DefaultStoreSingle and not = self.SkuSingle: >+ FileWrite(File, ' %-*s : %6s %1= 0s %10s =3D %s' % >(self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + = ')', '{')) >+ elif not self.DefaultStoreSingle and = self.SkuSingle: >+ FileWrite(File, ' %-*s : %6s %1= 0s %10s =3D %s' % >(self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + DefaultStore= + ')', >'{')) >+ else: >+ FileWrite(File, ' %-*s : %6s %1= 0s %10s %10s =3D %s' % >(self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + = ')', '(' >+ DefaultStore + ')', '{')) > for Array in ArrayList: > FileWrite(File, '%s' % (Array)) > else: >- FileWrite(File, ' %-*s : %6s %10s %= 10s %10s =3D %s' % >(self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + >SkuInfo.SkuIdName + ')', '(' + DefaultStore + ')', Value)) >+ if self.DefaultStoreSingle and self.S= kuSingle: >+ FileWrite(File, ' %-*s : %6s %1= 0s =3D %s' % (self.MaxLen, ' ', >TypeName, '(' + Pcd.DatumType + ')', Value)) >+ elif self.DefaultStoreSingle and not = self.SkuSingle: >+ FileWrite(File, ' %-*s : %6s %1= 0s %10s =3D %s' % >(self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + = ')', >Value)) >+ elif not self.DefaultStoreSingle and = self.SkuSingle: >+ FileWrite(File, ' %-*s : %6s %1= 0s %10s =3D %s' % >(self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + DefaultStore= + ')', >Value)) >+ else: >+ FileWrite(File, ' %-*s : %6s %1= 0s %10s %10s =3D %s' % >(self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + = ')', '(' >+ DefaultStore + ')', Value)) > FileWrite(File, '%*s: %s: %s' % (self.MaxLen = + 4, >SkuInfo.VariableGuid, SkuInfo.VariableName, SkuInfo.VariableOffset)) > if IsStructure: > OverrideValues =3D Pcd.SkuOverrideValues[= Sku] > Struct =3D OverrideValues[DefaultStore] > self.PrintStructureInfo(File, Struct) > self.PrintPcdDefault(File, Pcd, IsStructure, = DscMatch, >DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue) >- elif TypeName in ('DYNVPD', 'DEXVPD'): >- Value =3D SkuInfo.DefaultValue >- IsByteArray, ArrayList =3D ByteArrayForamt(Value) >- if FirstPrint: >- FirstPrint =3D False >- if IsByteArray: >- FileWrite(File, ' %-*s : %6s %10s %10s =3D = %s' % (self.MaxLen, >Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + >SkuInfo.SkuIdName + ')', "{")) >- for Array in ArrayList: >- FileWrite(File, '%s' % (Array)) >- else: >- FileWrite(File, ' %-*s : %6s %10s %10s =3D = %s' % (self.MaxLen, >Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + >SkuInfo.SkuIdName + ')', Value)) >- else: >- if IsByteArray: >- FileWrite(File, ' %-*s : %6s %10s %10s =3D = %s' % (self.MaxLen, ' ' , >TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', "{")) >- for Array in ArrayList: >- FileWrite(File, '%s' % (Array)) >- else: >- FileWrite(File, ' %-*s : %6s %10s %10s =3D = %s' % (self.MaxLen, ' ' , >TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', Value)= ) >- FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo.Vpd= Offset)) >- if IsStructure: >- OverrideValues =3D Pcd.SkuOverrideValues[Sku] >- if OverrideValues: >- Keys =3D OverrideValues.keys() >- Struct =3D OverrideValues[Keys[0]] >- self.PrintStructureInfo(File, Struct) >- self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch= , >DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue) > else: > Value =3D SkuInfo.DefaultValue > IsByteArray, ArrayList =3D ByteArrayForamt(Value) > if FirstPrint: > FirstPrint =3D False > if IsByteArray: >- FileWrite(File, ' %-*s : %6s %10s %10s =3D = %s' % (self.MaxLen, >Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + >SkuInfo.SkuIdName + ')', '{')) >+ if self.SkuSingle: >+ FileWrite(File, ' %-*s : %6s %10s =3D %= s' % (self.MaxLen, Flag + >' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', "{")) >+ else: >+ FileWrite(File, ' %-*s : %6s %10s %10s = =3D %s' % (self.MaxLen, >Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + >SkuIdName + ')', "{")) > for Array in ArrayList: > FileWrite(File, '%s' % (Array)) > else: >- FileWrite(File, ' %-*s : %6s %10s %10s =3D = %s' % (self.MaxLen, >Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + >SkuInfo.SkuIdName + ')', Value)) >+ if self.SkuSingle: >+ FileWrite(File, ' %-*s : %6s %10s =3D %= s' % (self.MaxLen, Flag + >' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', Value)) >+ else: >+ FileWrite(File, ' %-*s : %6s %10s %10s = =3D %s' % (self.MaxLen, >Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + >SkuIdName + ')', Value)) > else: > if IsByteArray: >- FileWrite(File, ' %-*s : %6s %10s %10s =3D = %s' % (self.MaxLen, ' ', >TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', '{')) >+ if self.SkuSingle: >+ FileWrite(File, ' %-*s : %6s %10s =3D %= s' % (self.MaxLen, ' ' , >TypeName, '(' + Pcd.DatumType + ')', "{")) >+ else: >+ FileWrite(File, ' %-*s : %6s %10s %10s = =3D %s' % (self.MaxLen, >' ' , TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', "{")) > for Array in ArrayList: > FileWrite(File, '%s' % (Array)) > else: >- FileWrite(File, ' %-*s : %6s %10s %10s =3D = %s' % (self.MaxLen, ' ', >TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', Value)= ) >+ if self.SkuSingle: >+ FileWrite(File, ' %-*s : %6s %10s =3D %= s' % (self.MaxLen, ' ' , >TypeName, '(' + Pcd.DatumType + ')', Value)) >+ else: >+ FileWrite(File, ' %-*s : %6s %10s %10s = =3D %s' % (self.MaxLen, >' ' , TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', Value)) >+ if TypeName in ('DYNVPD', 'DEXVPD'): >+ FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo= .VpdOffset)) > if IsStructure: > OverrideValues =3D Pcd.SkuOverrideValues[Sku] > if OverrideValues: > Keys =3D OverrideValues.keys() > Struct =3D OverrideValues[Keys[0]] >-- >2.6.1.windows.1 > >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel