From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: zhichao.gao@intel.com) Received: from mga17.intel.com (mga17.intel.com []) by groups.io with SMTP; Mon, 10 Jun 2019 00:29:18 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jun 2019 00:29:18 -0700 X-ExtLoop1: 1 Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 10 Jun 2019 00:29:17 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Bret Barkelew , Jian J Wang , Hao A Wu , Ray Ni , Star Zeng , Liming Gao Subject: [PATCH 2/6] MdeModule/PeiMain: Add performance code Date: Mon, 10 Jun 2019 15:28:51 +0800 Message-Id: <20190610072855.2800-3-zhichao.gao@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20190610072855.2800-1-zhichao.gao@intel.com> References: <20190610072855.2800-1-zhichao.gao@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Bret Barkelew REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1888 Add performance code for PeiDisaptcher function and Image function. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming Gao Signed-off-by: Zhichao Gao --- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index ba2fd0cae1..0caffe653b 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -983,6 +983,8 @@ PeiDispatcher ( EFI_FV_FILE_INFO FvFileInfo; PEI_CORE_FV_HANDLE *CoreFvHandle; + PERF_FUNCTION_BEGIN (); + PeiServices = (CONST EFI_PEI_SERVICES **) &Private->Ps; PeimEntryPoint = NULL; PeimFileHandle = NULL; @@ -1004,6 +1006,7 @@ PeiDispatcher ( Private->CurrentFileHandle = PeimFileHandle; Private->CurrentPeimFvCount = Index1; Private->CurrentPeimCount = Index2; + PERF_LOAD_IMAGE_BEGIN (NULL); Status = PeiLoadImage ( (CONST EFI_PEI_SERVICES **) &Private->Ps, PeimFileHandle, @@ -1012,6 +1015,7 @@ PeiDispatcher ( &AuthenticationState ); if (Status == EFI_SUCCESS) { + PERF_LOAD_IMAGE_END (PeimFileHandle); // // PEIM_STATE_REGISTER_FOR_SHADOW move to PEIM_STATE_DONE // @@ -1118,6 +1122,7 @@ PeiDispatcher ( // // For PEIM driver, Load its entry point // + PERF_LOAD_IMAGE_BEGIN (NULL); Status = PeiLoadImage ( PeiServices, PeimFileHandle, @@ -1126,6 +1131,7 @@ PeiDispatcher ( &AuthenticationState ); if (Status == EFI_SUCCESS) { + PERF_LOAD_IMAGE_END (PeimFileHandle); // // The PEIM has its dependencies satisfied, and its entry point // has been found, so invoke it. @@ -1197,6 +1203,7 @@ PeiDispatcher ( // // Load PEIM into Memory for Register for shadow PEIM. // + PERF_LOAD_IMAGE_BEGIN (NULL); Status = PeiLoadImage ( PeiServices, PeimFileHandle, @@ -1205,6 +1212,7 @@ PeiDispatcher ( &AuthenticationState ); if (Status == EFI_SUCCESS) { + PERF_LOAD_IMAGE_END (PeimFileHandle); PeimEntryPoint = (EFI_PEIM_ENTRY_POINT2)(UINTN)EntryPoint; } } @@ -1252,6 +1260,8 @@ PeiDispatcher ( // } while (Private->PeimNeedingDispatch && Private->PeimDispatchOnThisPass); + PERF_FUNCTION_END (); + } /** -- 2.21.0.windows.1