]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
Add a Pcd to define the maximum number of performance log entries during PEI phase.
[mirror_edk2.git] / EdkModulePkg / Library / PeiPerformanceLib / PeiPerformanceLib.c
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