]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Core/Pei/PeiMain/PeiMain.c
The performance data for PEI phase should be collected from pre-memory, so move PERF_...
[mirror_edk2.git] / EdkModulePkg / Core / Pei / PeiMain / PeiMain.c
index b6d57f96d5592498b122ffda76e4abb8b760d1e9..f8579600f61c4d213c2aaca536a94d4ce3339d7e 100644 (file)
@@ -107,11 +107,11 @@ Returns:
 \r
   mTick = 0;\r
 \r
-#ifdef EFI_PEI_PERFORMANCE\r
-  if (OldCoreData == NULL) {\r
-    mTick = GetPerformanceCounter ();\r
+  if (PerformanceMeasurementEnabled()) {\r
+    if (OldCoreData == NULL) {\r
+      mTick = GetPerformanceCounter ();\r
+    }\r
   }\r
-#endif\r
 \r
   //\r
   // For IPF in CAR mode the real memory access is uncached,in InstallPeiMemory()\r
@@ -150,10 +150,10 @@ Returns:
     //\r
     // The following code dumps out interesting cache as RAM usage information\r
     // so we can keep tabs on how the cache as RAM is being utilized.  The\r
-    // DEBUG_CODE macro is used to prevent this code from being compiled\r
+    // DEBUG_CODE_BEGIN macro is used to prevent this code from being compiled\r
     // on a debug build.\r
     //\r
-    DEBUG_CODE (\r
+    DEBUG_CODE_BEGIN ();\r
       UINTN  *StackPointer;\r
       UINTN  StackValue;\r
 \r
@@ -173,11 +173,12 @@ Returns:
         ((UINTN) OldCoreData->HobList.HandoffInformationTable->EfiFreeMemoryBottom -\r
         (UINTN) OldCoreData->HobList.Raw)\r
         ));\r
-    );\r
+    DEBUG_CODE_END ();\r
 \r
     //\r
     // Alert any listeners that there is permanent memory available\r
     //\r
+    \r
     PERF_START (NULL,"DisMem", NULL, 0);\r
     Status = PeiServicesInstallPpi (&mMemoryDiscoveredPpi);\r
     PERF_END (NULL,"DisMem", NULL, 0);\r
@@ -192,6 +193,7 @@ Returns:
       EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT\r
       );\r
 \r
+    PERF_START (NULL,"PEI", NULL, mTick);\r
     //\r
     // If first pass, start performance measurement.\r
     //\r