]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add Perf log for SMM driver Load and Start Image.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 16 May 2012 00:55:04 +0000 (00:55 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 16 May 2012 00:55:04 +0000 (00:55 +0000)
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Siddharth Shah <Siddharth.Shah@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13314 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/PiSmmCore/Dispatcher.c
MdeModulePkg/Core/PiSmmCore/PiSmmCore.h
MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf

index 651fe88c10f6ce9df97f01f87092244f1e8352e3..5edf184b927d7d6b8c343aec23fa7ac3ab5a47d0 100644 (file)
@@ -320,6 +320,12 @@ SmmLoadImage (
   EFI_DEVICE_PATH_PROTOCOL       *HandleFilePath;\r
   EFI_FIRMWARE_VOLUME2_PROTOCOL  *Fv;\r
   PE_COFF_LOADER_IMAGE_CONTEXT   ImageContext;\r
+  UINT64                         Tick;\r
+\r
+  Tick = 0;\r
+  PERF_CODE (\r
+    Tick = GetPerformanceCounter ();\r
+  );\r
    \r
   Buffer               = NULL;\r
   Size                 = 0;\r
@@ -575,6 +581,9 @@ SmmLoadImage (
                   NULL\r
                   );\r
 \r
+  PERF_START (DriverEntry->ImageHandle, "LoadImage:", NULL, Tick);\r
+  PERF_END (DriverEntry->ImageHandle, "LoadImage:", NULL, 0);\r
+\r
   //\r
   // Print the load address and the PDB file name if it is available\r
   //\r
@@ -836,7 +845,9 @@ SmmDispatcher (
       //\r
       // For each SMM driver, pass NULL as ImageHandle\r
       //\r
+      PERF_START (DriverEntry->ImageHandle, "StartImage:", NULL, 0);\r
       Status = ((EFI_IMAGE_ENTRY_POINT)(UINTN)DriverEntry->ImageEntryPoint)(DriverEntry->ImageHandle, gST);\r
+      PERF_END (DriverEntry->ImageHandle, "StartImage:", NULL, 0);\r
       if (EFI_ERROR(Status)){\r
         SmmFreePages(DriverEntry->ImageBuffer, DriverEntry->NumberOfPage);\r
       }\r
index 19af786612b177ac738c216a994c4c17c5cb5138..c63f5e2af0216d3e0cf455413a996e6ad355dd7e 100644 (file)
@@ -2,7 +2,7 @@
   The internal header file includes the common header files, defines\r
   internal structure and functions used by SmmCore module.\r
 \r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials are licensed and made available \r
   under the terms and conditions of the BSD License which accompanies this \r
   distribution.  The full text of the license may be found at        \r
@@ -45,6 +45,7 @@
 #include <Library/PcdLib.h>\r
 #include <Library/SmmCorePlatformHookLib.h>\r
 #include <Library/PerformanceLib.h>\r
+#include <Library/TimerLib.h>\r
 \r
 #include "PiSmmCorePrivateData.h"\r
 \r
index b226e3c9f76d25e529647ecc072fcd2de00854f9..1b25939e9c2bcb8aed7b27a320603653d6169b22 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This module provide an SMM CIS compliant implementation of SMM Core.\r
 #\r
-# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
@@ -56,6 +56,7 @@
   PcdLib\r
   SmmCorePlatformHookLib\r
   PerformanceLib\r
+  TimerLib\r
 \r
 [Protocols]\r
   gEfiDxeSmmReadyToLockProtocolGuid             # PROTOCOL ALWAYS_CONSUMED\r