From: "Ni, Ray" <ray.ni@intel.com>
To: "Wu, Jiaxin" <jiaxin.wu@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Wang, Jian J" <jian.j.wang@intel.com>,
"Gao, Liming" <gaoliming@byosoft.com.cn>
Subject: Re: [PATCH V2 3/6] MdeModulePkg/SmmCore: Add perf-logging for time-consuming procedures
Date: Mon, 12 Jun 2023 05:14:23 +0000 [thread overview]
Message-ID: <MN6PR11MB8244E5F9DD5C53CD23C28FC98C54A@MN6PR11MB8244.namprd11.prod.outlook.com> (raw)
In-Reply-To: <MN0PR11MB6158C71094A481EC4AC40075FE51A@MN0PR11MB6158.namprd11.prod.outlook.com>
We can add perf-logging for the two functions in a separate patch.
________________________________________
From: Wu, Jiaxin <jiaxin.wu@intel.com>
Sent: Friday, June 9, 2023 22:36
To: Ni, Ray; devel@edk2.groups.io
Cc: Wang, Jian J; Gao, Liming
Subject: RE: [PATCH V2 3/6] MdeModulePkg/SmmCore: Add perf-logging for time-consuming procedures
Could we also make below perf-logged?
PlatformHookBeforeSmmDispatch & PlatformHookAfterSmmDispatch
Others good to me.
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Thanks,
Jiaxin
> -----Original Message-----
> From: Ni, Ray <ray.ni@intel.com>
> Sent: Wednesday, May 31, 2023 7:35 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: [PATCH V2 3/6] MdeModulePkg/SmmCore: Add perf-logging for
> time-consuming procedures
>
> Following procedures are perf-logged:
> * SmmReadyToBootHandler
> * SmmReadyToLockHandler
> * SmmEndOfDxeHandler
> * SmmEntryPoint
> (It's the main routine run in BSP when SMI happens.)
> * SmiManage
>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> ---
> MdeModulePkg/Core/PiSmmCore/PiSmmCore.c | 14 +++++++++++++-
> MdeModulePkg/Core/PiSmmCore/Smi.c | 6 ++++++
> 2 files changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
> b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
> index 875c7c0258..a15afa8dd6 100644
> --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
> +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
> @@ -1,7 +1,7 @@
> /** @file
>
> SMM Core Main Entry Point
>
>
>
> - Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
>
> + Copyright (c) 2009 - 2023, Intel Corporation. All rights reserved.<BR>
>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
>
>
> **/
>
> @@ -304,6 +304,7 @@ SmmReadyToBootHandler (
> {
>
> EFI_STATUS Status;
>
> EFI_HANDLE SmmHandle;
>
> + PERF_CALLBACK_BEGIN (&gEfiEventReadyToBootGuid);
>
>
>
> //
>
> // Install SMM Ready To Boot protocol.
>
> @@ -318,6 +319,7 @@ SmmReadyToBootHandler (
>
>
> SmiHandlerUnRegister (DispatchHandle);
>
>
>
> + PERF_CALLBACK_END (&gEfiEventReadyToBootGuid);
>
> return Status;
>
> }
>
>
>
> @@ -352,6 +354,8 @@ SmmReadyToLockHandler (
> EFI_HANDLE SmmHandle;
>
> VOID *Interface;
>
>
>
> + PERF_CALLBACK_BEGIN (&gEfiDxeSmmReadyToLockProtocolGuid);
>
> +
>
> //
>
> // Unregister SMI Handlers that are no required after the SMM driver
> dispatch is stopped
>
> //
>
> @@ -408,6 +412,7 @@ SmmReadyToLockHandler (
>
>
> SmramProfileReadyToLock ();
>
>
>
> + PERF_CALLBACK_END (&gEfiDxeSmmReadyToLockProtocolGuid);
>
> return Status;
>
> }
>
>
>
> @@ -442,6 +447,8 @@ SmmEndOfDxeHandler (
>
>
> DEBUG ((DEBUG_INFO, "SmmEndOfDxeHandler\n"));
>
>
>
> + PERF_CALLBACK_BEGIN (&gEfiEndOfDxeEventGroupGuid);
>
> +
>
> //
>
> // Install SMM EndOfDxe protocol
>
> //
>
> @@ -479,6 +486,7 @@ SmmEndOfDxeHandler (
> }
>
> }
>
>
>
> + PERF_CALLBACK_END (&gEfiEndOfDxeEventGroupGuid);
>
> return EFI_SUCCESS;
>
> }
>
>
>
> @@ -669,6 +677,8 @@ SmmEntryPoint (
> VOID *CommunicationBuffer;
>
> UINTN BufferSize;
>
>
>
> + PERF_FUNCTION_BEGIN ();
>
> +
>
> //
>
> // Update SMST with contents of the SmmEntryContext structure
>
> //
>
> @@ -769,6 +779,8 @@ SmmEntryPoint (
> //
>
> gSmmCorePrivate->InSmm = FALSE;
>
> }
>
> +
>
> + PERF_FUNCTION_END ();
>
> }
>
>
>
> /**
>
> diff --git a/MdeModulePkg/Core/PiSmmCore/Smi.c
> b/MdeModulePkg/Core/PiSmmCore/Smi.c
> index 6d13969979..2985f989c3 100644
> --- a/MdeModulePkg/Core/PiSmmCore/Smi.c
> +++ b/MdeModulePkg/Core/PiSmmCore/Smi.c
> @@ -109,6 +109,8 @@ SmiManage (
> BOOLEAN SuccessReturn;
>
> EFI_STATUS Status;
>
>
>
> + PERF_FUNCTION_BEGIN ();
>
> +
>
> Status = EFI_NOT_FOUND;
>
> SuccessReturn = FALSE;
>
> if (HandlerType == NULL) {
>
> @@ -125,6 +127,7 @@ SmiManage (
> //
>
> // There is no handler registered for this interrupt source
>
> //
>
> + PERF_FUNCTION_END ();
>
> return Status;
>
> }
>
> }
>
> @@ -148,6 +151,7 @@ SmiManage (
> // no additional handlers will be processed and
> EFI_INTERRUPT_PENDING will be returned.
>
> //
>
> if (HandlerType != NULL) {
>
> + PERF_FUNCTION_END ();
>
> return EFI_INTERRUPT_PENDING;
>
> }
>
>
>
> @@ -160,6 +164,7 @@ SmiManage (
> // additional handlers will be processed.
>
> //
>
> if (HandlerType != NULL) {
>
> + PERF_FUNCTION_END ();
>
> return EFI_SUCCESS;
>
> }
>
>
>
> @@ -194,6 +199,7 @@ SmiManage (
> Status = EFI_SUCCESS;
>
> }
>
>
>
> + PERF_FUNCTION_END ();
>
> return Status;
>
> }
>
>
>
> --
> 2.39.1.windows.1
next prev parent reply other threads:[~2023-06-12 5:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-31 11:34 [PATCH V2 0/6] Enable perf-logging in SMM environment Ni, Ray
2023-05-31 11:34 ` [PATCH V2 1/6] UefiCpuPkg/CpuSmm: Add perf-logging for time-consuming BSP procedures Ni, Ray
2023-06-09 13:42 ` [edk2-devel] " Wu, Jiaxin
2023-06-12 5:16 ` Ni, Ray
2023-06-12 5:31 ` Ni, Ray
2023-05-31 11:34 ` [PATCH V2 2/6] UefiCpuPkg/CpuSmm: Add perf-logging for MP procedures Ni, Ray
2023-06-09 14:29 ` Wu, Jiaxin
2023-06-12 2:25 ` Ni, Ray
2023-05-31 11:34 ` [PATCH V2 3/6] MdeModulePkg/SmmCore: Add perf-logging for time-consuming procedures Ni, Ray
2023-06-09 14:36 ` Wu, Jiaxin
2023-06-12 5:14 ` Ni, Ray [this message]
2023-05-31 11:34 ` [PATCH V2 4/6] MdeModulePkg/SmmCore: Add perf-logging for SmmDriverDispatchHandler Ni, Ray
2023-06-09 14:37 ` Wu, Jiaxin
2023-05-31 11:34 ` [PATCH V2 5/6] MdeModulePkg/SmmPerformanceLib: Disable perf-logging after ExitBS Ni, Ray
2023-06-09 14:40 ` Wu, Jiaxin
2023-05-31 11:34 ` [PATCH V2 6/6] MdeModulePkg/SmmCorePerformanceLib: Disable perf-logging at runtime Ni, Ray
2023-06-09 14:43 ` Wu, Jiaxin
2023-06-09 3:22 ` [edk2-devel] [PATCH V2 0/6] Enable perf-logging in SMM environment Dong, Eric
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MN6PR11MB8244E5F9DD5C53CD23C28FC98C54A@MN6PR11MB8244.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox