From 7cff25d649a16ae039940bc4065f710453e789a2 Mon Sep 17 00:00:00 2001 From: mdkinney Date: Thu, 30 Oct 2008 04:03:59 +0000 Subject: [PATCH] Measure time spent in Driver Binding Supported() calls Update time measurement of StartImage() calls to properly record the handle of the started Image git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6292 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Dxe/DxeMain.h | 1 + MdeModulePkg/Core/Dxe/Hand/DriverSupport.c | 2 ++ MdeModulePkg/Core/Dxe/Image/Image.c | 9 +++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/DxeMain.h b/MdeModulePkg/Core/Dxe/DxeMain.h index e46acf4147..13b0ee3e3d 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain.h +++ b/MdeModulePkg/Core/Dxe/DxeMain.h @@ -79,6 +79,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include // // attributes for reserved memory before it is promoted to system memory diff --git a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c index 203a6e6b04..d92eef7924 100644 --- a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c +++ b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c @@ -541,11 +541,13 @@ CoreConnectSingleController ( for (Index = 0; (Index < NumberOfSortedDriverBindingProtocols) && !DriverFound; Index++) { if (SortedDriverBindingProtocols[Index] != NULL) { DriverBinding = SortedDriverBindingProtocols[Index]; + PERF_START (DriverBinding->DriverBindingHandle, DRIVERBINDING_SUPPORT_TOK, NULL, 0); Status = DriverBinding->Supported( DriverBinding, ControllerHandle, RemainingDevicePath ); + PERF_END (DriverBinding->DriverBindingHandle, DRIVERBINDING_SUPPORT_TOK, NULL, 0); if (!EFI_ERROR (Status)) { SortedDriverBindingProtocols[Index] = NULL; DriverFound = TRUE; diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index 0719d4b690..00f6bdced5 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -997,8 +997,12 @@ CoreLoadImage ( ) { EFI_STATUS Status; + UINT64 Tick; - PERF_START (NULL, "LoadImage", NULL, 0); + Tick = 0; + PERF_CODE ( + Tick = GetPerformanceCounter (); + ); Status = CoreLoadImageCommon ( BootPolicy, @@ -1013,7 +1017,8 @@ CoreLoadImage ( EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION | EFI_LOAD_PE_IMAGE_ATTRIBUTE_DEBUG_IMAGE_INFO_TABLE_REGISTRATION ); - PERF_END (NULL, "LoadImage", NULL, 0); + PERF_START (*ImageHandle, LOAD_IMAGE_TOK, NULL, Tick); + PERF_END (*ImageHandle, LOAD_IMAGE_TOK, NULL, 0); return Status; }