From c2cb08df473b9269bace69e21266218fcc817703 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Wed, 16 May 2012 00:55:04 +0000 Subject: [PATCH] Add Perf log for SMM driver Load and Start Image. Signed-off-by: Liming Gao Reviewed-by: Siddharth Shah git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13314 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/PiSmmCore/Dispatcher.c | 11 +++++++++++ MdeModulePkg/Core/PiSmmCore/PiSmmCore.h | 3 ++- MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Core/PiSmmCore/Dispatcher.c b/MdeModulePkg/Core/PiSmmCore/Dispatcher.c index 651fe88c10..5edf184b92 100644 --- a/MdeModulePkg/Core/PiSmmCore/Dispatcher.c +++ b/MdeModulePkg/Core/PiSmmCore/Dispatcher.c @@ -320,6 +320,12 @@ SmmLoadImage ( EFI_DEVICE_PATH_PROTOCOL *HandleFilePath; EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv; PE_COFF_LOADER_IMAGE_CONTEXT ImageContext; + UINT64 Tick; + + Tick = 0; + PERF_CODE ( + Tick = GetPerformanceCounter (); + ); Buffer = NULL; Size = 0; @@ -575,6 +581,9 @@ SmmLoadImage ( NULL ); + PERF_START (DriverEntry->ImageHandle, "LoadImage:", NULL, Tick); + PERF_END (DriverEntry->ImageHandle, "LoadImage:", NULL, 0); + // // Print the load address and the PDB file name if it is available // @@ -836,7 +845,9 @@ SmmDispatcher ( // // For each SMM driver, pass NULL as ImageHandle // + PERF_START (DriverEntry->ImageHandle, "StartImage:", NULL, 0); Status = ((EFI_IMAGE_ENTRY_POINT)(UINTN)DriverEntry->ImageEntryPoint)(DriverEntry->ImageHandle, gST); + PERF_END (DriverEntry->ImageHandle, "StartImage:", NULL, 0); if (EFI_ERROR(Status)){ SmmFreePages(DriverEntry->ImageBuffer, DriverEntry->NumberOfPage); } diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h index 19af786612..c63f5e2af0 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h @@ -2,7 +2,7 @@ The internal header file includes the common header files, defines internal structure and functions used by SmmCore module. - Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -45,6 +45,7 @@ #include #include #include +#include #include "PiSmmCorePrivateData.h" diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf index b226e3c9f7..1b25939e9c 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf @@ -1,7 +1,7 @@ ## @file # This module provide an SMM CIS compliant implementation of SMM Core. # -# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -56,6 +56,7 @@ PcdLib SmmCorePlatformHookLib PerformanceLib + TimerLib [Protocols] gEfiDxeSmmReadyToLockProtocolGuid # PROTOCOL ALWAYS_CONSUMED -- 2.39.2