public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Not print SKUID info for PCD when it is only Single SKUID
@ 2018-01-04  9:24 Yonghong Zhu
  2018-01-08  6:11 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2018-01-04  9:24 UTC (permalink / raw)
  To: edk2-devel

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 <yonghong.zhu@intel.com>
---
 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.<BR>
+# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 # This program and the accompanying materials
 # are licensed and made available under the terms and conditions of the BSD 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 = Wa.FdfProfile.PcdDict
         else:
             self.FdfPcdSet = {}
 
+        self.DefaultStoreSingle = True
+        self.SkuSingle = True
+        if GlobalData.gDefaultStores and len(GlobalData.gDefaultStores) > 1:
+            self.DefaultStoreSingle = False
+        if GlobalData.gSkuids and len(GlobalData.gSkuids) > 1:
+            self.SkuSingle = False
+
         self.ModulePcdOverride = {}
         for Pa in Wa.AutoGenObjectList:
             self.Arch = Pa.Arch
             #
             # Collect all platform referenced PCDs and grouped them by PCD token space
@@ -1123,81 +1130,98 @@ class PcdReport(object):
         else:
             FirstPrint = True
             SkuList = sorted(Pcd.SkuInfoList.keys())
             for Sku in SkuList:
                 SkuInfo = Pcd.SkuInfoList[Sku]
+                SkuIdName = SkuInfo.SkuIdName
                 if TypeName in ('DYNHII', 'DEXHII'):
                     if SkuInfo.DefaultStoreDict:
                         DefaultStoreList = sorted(SkuInfo.DefaultStoreDict.keys())
                         for DefaultStore in DefaultStoreList:
                             Value = SkuInfo.DefaultStoreDict[DefaultStore]
                             IsByteArray, ArrayList = ByteArrayForamt(Value)
                             if FirstPrint:
                                 FirstPrint = False
                                 if IsByteArray:
-                                    FileWrite(File, ' %-*s   : %6s %10s %10s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', '(' + DefaultStore + ')', '{'))
+                                    if self.DefaultStoreSingle and self.SkuSingle:
+                                        FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '{'))
+                                    elif self.DefaultStoreSingle and not self.SkuSingle:
+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', '{'))
+                                    elif not self.DefaultStoreSingle and self.SkuSingle:
+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + DefaultStore + ')', '{'))
+                                    else:
+                                        FileWrite(File, ' %-*s   : %6s %10s %10s %10s = %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 = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', '(' + DefaultStore + ')', Value))
+                                    if self.DefaultStoreSingle and self.SkuSingle:
+                                        FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', Value))
+                                    elif self.DefaultStoreSingle and not self.SkuSingle:
+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', Value))
+                                    elif not self.DefaultStoreSingle and self.SkuSingle:
+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + DefaultStore + ')', Value))
+                                    else:
+                                        FileWrite(File, ' %-*s   : %6s %10s %10s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', '(' + DefaultStore + ')', Value))
                             else:
                                 if IsByteArray:
-                                    FileWrite(File, ' %-*s   : %6s %10s %10s %10s = %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', '(' + DefaultStore + ')', '{'))
+                                    if self.DefaultStoreSingle and self.SkuSingle:
+                                        FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '{'))
+                                    elif self.DefaultStoreSingle and not self.SkuSingle:
+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', '{'))
+                                    elif not self.DefaultStoreSingle and self.SkuSingle:
+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + DefaultStore + ')', '{'))
+                                    else:
+                                        FileWrite(File, ' %-*s   : %6s %10s %10s %10s = %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', '(' + DefaultStore + ')', '{'))
                                     for Array in ArrayList:
                                         FileWrite(File, '%s' % (Array))
                                 else:
-                                    FileWrite(File, ' %-*s   : %6s %10s %10s %10s = %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', '(' + DefaultStore + ')', Value))
+                                    if self.DefaultStoreSingle and self.SkuSingle:
+                                        FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')',  Value))
+                                    elif self.DefaultStoreSingle and not self.SkuSingle:
+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', Value))
+                                    elif not self.DefaultStoreSingle and self.SkuSingle:
+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + DefaultStore + ')', Value))
+                                    else:
+                                        FileWrite(File, ' %-*s   : %6s %10s %10s %10s = %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 = Pcd.SkuOverrideValues[Sku]
                                 Struct = OverrideValues[DefaultStore]
                                 self.PrintStructureInfo(File, Struct)
                             self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)
-                elif TypeName in ('DYNVPD', 'DEXVPD'):
-                    Value = SkuInfo.DefaultValue
-                    IsByteArray, ArrayList = ByteArrayForamt(Value)
-                    if FirstPrint:
-                        FirstPrint = False
-                        if IsByteArray:
-                            FileWrite(File, ' %-*s   : %6s %10s %10s = %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 = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', Value))
-                    else:
-                        if IsByteArray:
-                            FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, ' ' , TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', "{"))
-                            for Array in ArrayList:
-                                FileWrite(File, '%s' % (Array))
-                        else:
-                            FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, ' ' , TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', Value))
-                    FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo.VpdOffset))
-                    if IsStructure:
-                        OverrideValues = Pcd.SkuOverrideValues[Sku]
-                        if OverrideValues:
-                            Keys = OverrideValues.keys()
-                            Struct = OverrideValues[Keys[0]]
-                            self.PrintStructureInfo(File, Struct)
-                    self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)
                 else:
                     Value = SkuInfo.DefaultValue
                     IsByteArray, ArrayList = ByteArrayForamt(Value)
                     if FirstPrint:
                         FirstPrint = False
                         if IsByteArray:
-                            FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', '{'))
+                            if self.SkuSingle:
+                                FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', "{"))
+                            else:
+                                FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', "{"))
                             for Array in ArrayList:
                                 FileWrite(File, '%s' % (Array))
                         else:
-                            FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', Value))
+                            if self.SkuSingle:
+                                FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', Value))
+                            else:
+                                FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', Value))
                     else:
                         if IsByteArray:
-                            FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', '{'))
+                            if self.SkuSingle:
+                                FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, ' ' , TypeName, '(' + Pcd.DatumType + ')', "{"))
+                            else:
+                                FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, ' ' , TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', "{"))
                             for Array in ArrayList:
                                 FileWrite(File, '%s' % (Array))
                         else:
-                            FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', Value))
+                            if self.SkuSingle:
+                                FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, ' ' , TypeName, '(' + Pcd.DatumType + ')', Value))
+                            else:
+                                FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, ' ' , TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', Value))
+                    if TypeName in ('DYNVPD', 'DEXVPD'):
+                        FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo.VpdOffset))
                     if IsStructure:
                         OverrideValues = Pcd.SkuOverrideValues[Sku]
                         if OverrideValues:
                             Keys = OverrideValues.keys()
                             Struct = OverrideValues[Keys[0]]
-- 
2.6.1.windows.1



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

* Re: [Patch] BaseTools: Not print SKUID info for PCD when it is only Single SKUID
  2018-01-04  9:24 [Patch] BaseTools: Not print SKUID info for PCD when it is only Single SKUID Yonghong Zhu
@ 2018-01-08  6:11 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2018-01-08  6:11 UTC (permalink / raw)
  To: Zhu, Yonghong, edk2-devel@lists.01.org

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----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 <yonghong.zhu@intel.com>
>---
> 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.<BR>
>+# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
> # This program and the accompanying materials
> # are licensed and made available under the terms and conditions of the BSD
>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 = Wa.FdfProfile.PcdDict
>         else:
>             self.FdfPcdSet = {}
>
>+        self.DefaultStoreSingle = True
>+        self.SkuSingle = True
>+        if GlobalData.gDefaultStores and len(GlobalData.gDefaultStores) > 1:
>+            self.DefaultStoreSingle = False
>+        if GlobalData.gSkuids and len(GlobalData.gSkuids) > 1:
>+            self.SkuSingle = False
>+
>         self.ModulePcdOverride = {}
>         for Pa in Wa.AutoGenObjectList:
>             self.Arch = Pa.Arch
>             #
>             # Collect all platform referenced PCDs and grouped them by PCD token
>space
>@@ -1123,81 +1130,98 @@ class PcdReport(object):
>         else:
>             FirstPrint = True
>             SkuList = sorted(Pcd.SkuInfoList.keys())
>             for Sku in SkuList:
>                 SkuInfo = Pcd.SkuInfoList[Sku]
>+                SkuIdName = SkuInfo.SkuIdName
>                 if TypeName in ('DYNHII', 'DEXHII'):
>                     if SkuInfo.DefaultStoreDict:
>                         DefaultStoreList = sorted(SkuInfo.DefaultStoreDict.keys())
>                         for DefaultStore in DefaultStoreList:
>                             Value = SkuInfo.DefaultStoreDict[DefaultStore]
>                             IsByteArray, ArrayList = ByteArrayForamt(Value)
>                             if FirstPrint:
>                                 FirstPrint = False
>                                 if IsByteArray:
>-                                    FileWrite(File, ' %-*s   : %6s %10s %10s %10s = %s' %
>(self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType +
>')', '(' + SkuInfo.SkuIdName + ')', '(' + DefaultStore + ')', '{'))
>+                                    if self.DefaultStoreSingle and self.SkuSingle:
>+                                        FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen,
>Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '{'))
>+                                    elif self.DefaultStoreSingle and not self.SkuSingle:
>+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' %
>(self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType +
>')', '(' + SkuIdName + ')', '{'))
>+                                    elif not self.DefaultStoreSingle and self.SkuSingle:
>+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' %
>(self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType +
>')', '(' + DefaultStore + ')', '{'))
>+                                    else:
>+                                        FileWrite(File, ' %-*s   : %6s %10s %10s %10s = %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 = %s' %
>(self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType +
>')', '(' + SkuInfo.SkuIdName + ')', '(' + DefaultStore + ')', Value))
>+                                    if self.DefaultStoreSingle and self.SkuSingle:
>+                                        FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen,
>Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', Value))
>+                                    elif self.DefaultStoreSingle and not self.SkuSingle:
>+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' %
>(self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType +
>')', '(' + SkuIdName + ')', Value))
>+                                    elif not self.DefaultStoreSingle and self.SkuSingle:
>+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' %
>(self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType +
>')', '(' + DefaultStore + ')', Value))
>+                                    else:
>+                                        FileWrite(File, ' %-*s   : %6s %10s %10s %10s = %s' %
>(self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType +
>')', '(' + SkuIdName + ')', '(' + DefaultStore + ')', Value))
>                             else:
>                                 if IsByteArray:
>-                                    FileWrite(File, ' %-*s   : %6s %10s %10s %10s = %s' %
>(self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' +
>SkuInfo.SkuIdName + ')', '(' + DefaultStore + ')', '{'))
>+                                    if self.DefaultStoreSingle and self.SkuSingle:
>+                                        FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, ' ',
>TypeName, '(' + Pcd.DatumType + ')', '{'))
>+                                    elif self.DefaultStoreSingle and not self.SkuSingle:
>+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' %
>(self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', '{'))
>+                                    elif not self.DefaultStoreSingle and self.SkuSingle:
>+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' %
>(self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + DefaultStore + ')',
>'{'))
>+                                    else:
>+                                        FileWrite(File, ' %-*s   : %6s %10s %10s %10s = %s' %
>(self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', '('
>+ DefaultStore + ')', '{'))
>                                     for Array in ArrayList:
>                                         FileWrite(File, '%s' % (Array))
>                                 else:
>-                                    FileWrite(File, ' %-*s   : %6s %10s %10s %10s = %s' %
>(self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' +
>SkuInfo.SkuIdName + ')', '(' + DefaultStore + ')', Value))
>+                                    if self.DefaultStoreSingle and self.SkuSingle:
>+                                        FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, ' ',
>TypeName, '(' + Pcd.DatumType + ')',  Value))
>+                                    elif self.DefaultStoreSingle and not self.SkuSingle:
>+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' %
>(self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')',
>Value))
>+                                    elif not self.DefaultStoreSingle and self.SkuSingle:
>+                                        FileWrite(File, ' %-*s   : %6s %10s %10s = %s' %
>(self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + DefaultStore + ')',
>Value))
>+                                    else:
>+                                        FileWrite(File, ' %-*s   : %6s %10s %10s %10s = %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 = Pcd.SkuOverrideValues[Sku]
>                                 Struct = OverrideValues[DefaultStore]
>                                 self.PrintStructureInfo(File, Struct)
>                             self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch,
>DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)
>-                elif TypeName in ('DYNVPD', 'DEXVPD'):
>-                    Value = SkuInfo.DefaultValue
>-                    IsByteArray, ArrayList = ByteArrayForamt(Value)
>-                    if FirstPrint:
>-                        FirstPrint = False
>-                        if IsByteArray:
>-                            FileWrite(File, ' %-*s   : %6s %10s %10s = %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 = %s' % (self.MaxLen,
>Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' +
>SkuInfo.SkuIdName + ')', Value))
>-                    else:
>-                        if IsByteArray:
>-                            FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, ' ' ,
>TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', "{"))
>-                            for Array in ArrayList:
>-                                FileWrite(File, '%s' % (Array))
>-                        else:
>-                            FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, ' ' ,
>TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', Value))
>-                    FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo.VpdOffset))
>-                    if IsStructure:
>-                        OverrideValues = Pcd.SkuOverrideValues[Sku]
>-                        if OverrideValues:
>-                            Keys = OverrideValues.keys()
>-                            Struct = OverrideValues[Keys[0]]
>-                            self.PrintStructureInfo(File, Struct)
>-                    self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch,
>DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)
>                 else:
>                     Value = SkuInfo.DefaultValue
>                     IsByteArray, ArrayList = ByteArrayForamt(Value)
>                     if FirstPrint:
>                         FirstPrint = False
>                         if IsByteArray:
>-                            FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen,
>Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' +
>SkuInfo.SkuIdName + ')', '{'))
>+                            if self.SkuSingle:
>+                                FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, Flag +
>' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', "{"))
>+                            else:
>+                                FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen,
>Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' +
>SkuIdName + ')', "{"))
>                             for Array in ArrayList:
>                                 FileWrite(File, '%s' % (Array))
>                         else:
>-                            FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen,
>Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' +
>SkuInfo.SkuIdName + ')', Value))
>+                            if self.SkuSingle:
>+                                FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, Flag +
>' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', Value))
>+                            else:
>+                                FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen,
>Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '(' +
>SkuIdName + ')', Value))
>                     else:
>                         if IsByteArray:
>-                            FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, ' ',
>TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', '{'))
>+                            if self.SkuSingle:
>+                                FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, ' ' ,
>TypeName, '(' + Pcd.DatumType + ')', "{"))
>+                            else:
>+                                FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen,
>' ' , TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', "{"))
>                             for Array in ArrayList:
>                                 FileWrite(File, '%s' % (Array))
>                         else:
>-                            FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen, ' ',
>TypeName, '(' + Pcd.DatumType + ')', '(' + SkuInfo.SkuIdName + ')', Value))
>+                            if self.SkuSingle:
>+                                FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, ' ' ,
>TypeName, '(' + Pcd.DatumType + ')', Value))
>+                            else:
>+                                FileWrite(File, ' %-*s   : %6s %10s %10s = %s' % (self.MaxLen,
>' ' , TypeName, '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', Value))
>+                    if TypeName in ('DYNVPD', 'DEXVPD'):
>+                        FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo.VpdOffset))
>                     if IsStructure:
>                         OverrideValues = Pcd.SkuOverrideValues[Sku]
>                         if OverrideValues:
>                             Keys = OverrideValues.keys()
>                             Struct = 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


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

end of thread, other threads:[~2018-01-08  6:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-04  9:24 [Patch] BaseTools: Not print SKUID info for PCD when it is only Single SKUID Yonghong Zhu
2018-01-08  6:11 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox