mirror of https://github.com/acidanthera/audk.git
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 Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
This commit is contained in:
parent
ad6c8540cc
commit
e4ff852136
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
SMM Core Main Entry Point
|
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
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
@ -305,6 +305,8 @@ SmmReadyToBootHandler (
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_HANDLE SmmHandle;
|
EFI_HANDLE SmmHandle;
|
||||||
|
|
||||||
|
PERF_CALLBACK_BEGIN (&gEfiEventReadyToBootGuid);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Install SMM Ready To Boot protocol.
|
// Install SMM Ready To Boot protocol.
|
||||||
//
|
//
|
||||||
|
@ -318,6 +320,7 @@ SmmReadyToBootHandler (
|
||||||
|
|
||||||
SmiHandlerUnRegister (DispatchHandle);
|
SmiHandlerUnRegister (DispatchHandle);
|
||||||
|
|
||||||
|
PERF_CALLBACK_END (&gEfiEventReadyToBootGuid);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,6 +355,8 @@ SmmReadyToLockHandler (
|
||||||
EFI_HANDLE SmmHandle;
|
EFI_HANDLE SmmHandle;
|
||||||
VOID *Interface;
|
VOID *Interface;
|
||||||
|
|
||||||
|
PERF_CALLBACK_BEGIN (&gEfiDxeSmmReadyToLockProtocolGuid);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Unregister SMI Handlers that are no required after the SMM driver dispatch is stopped
|
// Unregister SMI Handlers that are no required after the SMM driver dispatch is stopped
|
||||||
//
|
//
|
||||||
|
@ -408,6 +413,7 @@ SmmReadyToLockHandler (
|
||||||
|
|
||||||
SmramProfileReadyToLock ();
|
SmramProfileReadyToLock ();
|
||||||
|
|
||||||
|
PERF_CALLBACK_END (&gEfiDxeSmmReadyToLockProtocolGuid);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -442,6 +448,8 @@ SmmEndOfDxeHandler (
|
||||||
|
|
||||||
DEBUG ((DEBUG_INFO, "SmmEndOfDxeHandler\n"));
|
DEBUG ((DEBUG_INFO, "SmmEndOfDxeHandler\n"));
|
||||||
|
|
||||||
|
PERF_CALLBACK_BEGIN (&gEfiEndOfDxeEventGroupGuid);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Install SMM EndOfDxe protocol
|
// Install SMM EndOfDxe protocol
|
||||||
//
|
//
|
||||||
|
@ -479,6 +487,7 @@ SmmEndOfDxeHandler (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PERF_CALLBACK_END (&gEfiEndOfDxeEventGroupGuid);
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -669,6 +678,8 @@ SmmEntryPoint (
|
||||||
VOID *CommunicationBuffer;
|
VOID *CommunicationBuffer;
|
||||||
UINTN BufferSize;
|
UINTN BufferSize;
|
||||||
|
|
||||||
|
PERF_FUNCTION_BEGIN ();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Update SMST with contents of the SmmEntryContext structure
|
// Update SMST with contents of the SmmEntryContext structure
|
||||||
//
|
//
|
||||||
|
@ -769,6 +780,8 @@ SmmEntryPoint (
|
||||||
//
|
//
|
||||||
gSmmCorePrivate->InSmm = FALSE;
|
gSmmCorePrivate->InSmm = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PERF_FUNCTION_END ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -109,6 +109,8 @@ SmiManage (
|
||||||
BOOLEAN SuccessReturn;
|
BOOLEAN SuccessReturn;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
|
PERF_FUNCTION_BEGIN ();
|
||||||
|
|
||||||
Status = EFI_NOT_FOUND;
|
Status = EFI_NOT_FOUND;
|
||||||
SuccessReturn = FALSE;
|
SuccessReturn = FALSE;
|
||||||
if (HandlerType == NULL) {
|
if (HandlerType == NULL) {
|
||||||
|
@ -125,6 +127,7 @@ SmiManage (
|
||||||
//
|
//
|
||||||
// There is no handler registered for this interrupt source
|
// There is no handler registered for this interrupt source
|
||||||
//
|
//
|
||||||
|
PERF_FUNCTION_END ();
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,6 +151,7 @@ SmiManage (
|
||||||
// no additional handlers will be processed and EFI_INTERRUPT_PENDING will be returned.
|
// no additional handlers will be processed and EFI_INTERRUPT_PENDING will be returned.
|
||||||
//
|
//
|
||||||
if (HandlerType != NULL) {
|
if (HandlerType != NULL) {
|
||||||
|
PERF_FUNCTION_END ();
|
||||||
return EFI_INTERRUPT_PENDING;
|
return EFI_INTERRUPT_PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,6 +164,7 @@ SmiManage (
|
||||||
// additional handlers will be processed.
|
// additional handlers will be processed.
|
||||||
//
|
//
|
||||||
if (HandlerType != NULL) {
|
if (HandlerType != NULL) {
|
||||||
|
PERF_FUNCTION_END ();
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,6 +199,7 @@ SmiManage (
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PERF_FUNCTION_END ();
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue