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 37a1a1f..86d33e6 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 33a2dc9..c3bfc1f 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 64c7454..268a6a0 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 f00b9da..ab6edcb 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 b97849f..dcb360c 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 834bd34..90126ac 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