Add a Pcd to define the maximum number of performance log entries during PEI phase.
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 29 Aug 2006 01:52:19 +0000 (01:52 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 29 Aug 2006 01:52:19 +0000 (01:52 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1398 6f19259b-4bc3-4df7-8a09-765794883524

EdkModulePkg/EdkModulePkg.spd
EdkModulePkg/Include/Guid/PeiPerformanceHob.h
EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.msa
EdkModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
EdkModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.msa

index 37a1a1fc6db627bee5c8f7681bfdfdcc1f83c494..86d33e69cd149f7d551a7aef5ab27835908b4194 100644 (file)
       <DefaultValue>4</DefaultValue>\r
       <HelpText>kbytes size of runtime memory.</HelpText>\r
     </PcdEntry>\r
+    <PcdEntry>\r
+      <C_Name>PcdMaxPeiPerformanceLogEntries</C_Name>\r
+      <Token>0x0001002f</Token>\r
+      <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <DatumType>UINT8</DatumType>\r
+      <ValidUsage>FIXED_AT_BUILD PATCHABLE_IN_MODULE</ValidUsage>\r
+      <DefaultValue>28</DefaultValue>\r
+      <HelpText>Maximun number of performance log entries during PEI phase.</HelpText>\r
+    </PcdEntry>\r
     <PcdEntry>\r
       <C_Name>PcdFlashFvBaseArray</C_Name>\r
       <Token>0x31000001</Token>\r
index 33a2dc90895ae428f502240b50c24e198e563c78..c3bfc1f77a28b455836395bf91e1460c418d07da 100644 (file)
@@ -33,10 +33,6 @@ Abstract:
 //\r
 #define PEI_PERFORMANCE_STRING_SIZE     8\r
 #define PEI_PERFORMANCE_STRING_LENGTH   (PEI_PERFORMANCE_STRING_SIZE - 1)\r
-//\r
-// Bugbug: This macro will be replaced by a binary patchable PCD entry in EdkModulePkg\r
-//\r
-#define MAX_PEI_PERFORMANCE_LOG_ENTRIES 28\r
 \r
 typedef struct {\r
   EFI_PHYSICAL_ADDRESS  Handle;\r
index 64c7454c662631a9b97282493bbab4a0d9849542..268a6a04f24b445a33098040489710fba4c40cb7 100644 (file)
@@ -438,7 +438,7 @@ DxeCorePerformanceLibConstructor (
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  mMaxGaugeRecords = INIT_DXE_GAUGE_DATA_ENTRIES + MAX_PEI_PERFORMANCE_LOG_ENTRIES;\r
+  mMaxGaugeRecords = INIT_DXE_GAUGE_DATA_ENTRIES + PcdGet8 (PcdMaxPeiPerformanceLogEntries);\r
 \r
   mGaugeData = AllocateZeroPool (sizeof (GAUGE_DATA_HEADER) + (sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords));\r
   ASSERT (mGaugeData != NULL);\r
index f00b9da4a8db278c94a4f1c85c4840793a30c84c..ab6edcb912ffb291fa0b4de396dff0d255c743d2 100644 (file)
@@ -91,5 +91,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
       <HelpText>The bitmask of flags that specify the enable/disable of\r
                 Performance Measurement.</HelpText>\r
     </PcdEntry>\r
+    <PcdEntry PcdItemType="DYNAMIC">\r
+      <C_Name>PcdMaxPeiPerformanceLogEntries</C_Name>\r
+      <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <HelpText>Maximun number of performance log entries during PEI phase.</HelpText>\r
+    </PcdEntry>\r
   </PcdCoded>\r
 </ModuleSurfaceArea>
\ No newline at end of file
index b97849fa35dd2a603a1c06fd3c54b403274cf7bc..dcb360c5e70379b0b22fc4d813bdc9e4136065bd 100644 (file)
@@ -57,7 +57,7 @@ InternalGetPerformanceHobLog (
     // PEI Performance HOB was not found, then build one.\r
     //\r
     PeiPerformanceLogSize = sizeof (PEI_PERFORMANCE_LOG_HEADER) + \r
-                            sizeof (PEI_PERFORMANCE_LOG_ENTRY) * MAX_PEI_PERFORMANCE_LOG_ENTRIES;\r
+                            sizeof (PEI_PERFORMANCE_LOG_ENTRY) * PcdGet8 (PcdMaxPeiPerformanceLogEntries);\r
     PeiPerformanceLog     = BuildGuidHob (&gPeiPerformanceHobGuid, PeiPerformanceLogSize);\r
     PeiPerformanceLog     = ZeroMem (PeiPerformanceLog, PeiPerformanceLogSize);\r
   }\r
@@ -152,7 +152,7 @@ StartPerformanceMeasurement (
 \r
   PeiPerformanceLog = InternalGetPerformanceHobLog ();\r
   \r
-  if (PeiPerformanceLog->NumberOfEntries >= MAX_PEI_PERFORMANCE_LOG_ENTRIES) {\r
+  if (PeiPerformanceLog->NumberOfEntries >= PcdGet8 (PcdMaxPeiPerformanceLogEntries)) {\r
     return RETURN_OUT_OF_RESOURCES;\r
   }\r
   Index                       = PeiPerformanceLog->NumberOfEntries++;\r
index 834bd347800f2016765747de4dd9b4740c3eee6a..90126acf91d135490b7f3d36ef2edc2f3af982b8 100644 (file)
@@ -77,5 +77,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
       <HelpText>The bitmask of flags that specify the enable/disable of\r
                 Performance Measurement.</HelpText>\r
     </PcdEntry>\r
+    <PcdEntry PcdItemType="DYNAMIC">\r
+      <C_Name>PcdMaxPeiPerformanceLogEntries</C_Name>\r
+      <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <HelpText>Maximun number of performance log entries during PEI phase.</HelpText>\r
+    </PcdEntry>\r
   </PcdCoded>\r
 </ModuleSurfaceArea>
\ No newline at end of file