]> 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 f27b0274f5366b8588361b160351e1b2881e650c..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,13 +173,14 @@ 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 = PeiCoreInstallPpi (&mMemoryDiscoveredPpi);\r
+    Status = PeiServicesInstallPpi (&mMemoryDiscoveredPpi);\r
     PERF_END (NULL,"DisMem", NULL, 0);\r
 \r
   } else {\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
@@ -201,7 +203,7 @@ Returns:
     // If SEC provided any PPI services to PEI, install them.\r
     //\r
     if (PeiStartupDescriptor->DispatchTable != NULL) {\r
-      Status = PeiCoreInstallPpi (PeiStartupDescriptor->DispatchTable);\r
+      Status = PeiServicesInstallPpi (PeiStartupDescriptor->DispatchTable);\r
       ASSERT_EFI_ERROR (Status);\r
     }\r
   }\r
@@ -220,7 +222,7 @@ Returns:
 \r
   PERF_END (NULL, "PostMem", NULL, 0);\r
 \r
-  Status = PeiCoreLocatePpi (\r
+  Status = PeiServicesLocatePpi (\r
              &gEfiDxeIplPpiGuid,\r
              0,\r
              NULL,\r