From 217f1d11c3767575a5c26f89cedb765caaeecc4f Mon Sep 17 00:00:00 2001 From: klu2 Date: Tue, 10 Oct 2006 07:30:40 +0000 Subject: Add pair of performance macro function to measure the whole PEI phase's performance. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1704 6f19259b-4bc3-4df7-8a09-765794883524 --- EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c | 2 +- EdkModulePkg/Core/Pei/PeiMain/PeiMain.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'EdkModulePkg') diff --git a/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c b/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c index db25fcf..5e5b95a 100644 --- a/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c +++ b/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c @@ -423,7 +423,7 @@ Returns: // Call constructor for all libraries // ProcessLibraryConstructorList (gDxeCoreImageHandle, gST); - + PERF_END (0,PEI_TOK, NULL, 0) ; PERF_START (0,DXE_TOK, NULL, 0) ; // diff --git a/EdkModulePkg/Core/Pei/PeiMain/PeiMain.c b/EdkModulePkg/Core/Pei/PeiMain/PeiMain.c index c94331c..924336b 100644 --- a/EdkModulePkg/Core/Pei/PeiMain/PeiMain.c +++ b/EdkModulePkg/Core/Pei/PeiMain/PeiMain.c @@ -107,11 +107,11 @@ Returns: mTick = 0; -#ifdef EFI_PEI_PERFORMANCE - if (OldCoreData == NULL) { - mTick = GetPerformanceCounter (); + if (PerformanceMeasurementEnabled()) { + if (OldCoreData == NULL) { + mTick = GetPerformanceCounter (); + } } -#endif // // For IPF in CAR mode the real memory access is uncached,in InstallPeiMemory() @@ -178,6 +178,7 @@ Returns: // // Alert any listeners that there is permanent memory available // + PERF_START (NULL,"PEI", NULL, mTick); PERF_START (NULL,"DisMem", NULL, 0); Status = PeiServicesInstallPpi (&mMemoryDiscoveredPpi); PERF_END (NULL,"DisMem", NULL, 0); -- cgit v1.1