TianoCore EDK2 master
|
#include "SmmCorePerformanceLibInternal.h"
Go to the source code of this file.
Data Structures | |
struct | HANDLE_GUID_MAP |
Macros | |
#define | STRING_SIZE (FPDT_STRING_EVENT_RECORD_NAME_LENGTH * sizeof (CHAR8)) |
#define | FIRMWARE_RECORD_BUFFER 0x1000 |
#define | CACHE_HANDLE_GUID_COUNT 0x100 |
Functions | |
EFI_STATUS | GetFpdtRecordPtr (IN UINT8 RecordSize, IN OUT FPDT_RECORD_PTR *FpdtRecordPtr) |
BOOLEAN | IsKnownTokens (IN CONST CHAR8 *Token) |
BOOLEAN | IsKnownID (IN UINT32 Identifier) |
EFI_STATUS | GetFpdtRecordId (IN PERF_MEASUREMENT_ATTRIBUTE Attribute, IN CONST VOID *Handle, IN CONST CHAR8 *String, OUT UINT16 *ProgressID) |
EFI_STATUS EFIAPI | GetModuleInfoFromHandle (IN EFI_HANDLE Handle, OUT CHAR8 *NameString, IN UINTN BufferSize, OUT EFI_GUID *ModuleGuid OPTIONAL) |
VOID | CopyStringIntoPerfRecordAndUpdateLength (IN OUT CHAR8 *Destination, IN CONST CHAR8 *Source, IN OUT UINT8 *Length) |
EFI_STATUS | InsertFpdtRecord (IN CONST VOID *CallerIdentifier OPTIONAL, IN CONST VOID *Guid OPTIONAL, IN CONST CHAR8 *String OPTIONAL, IN UINT64 Ticker, IN UINT64 Address OPTIONAL, IN UINT16 PerfId, IN PERF_MEASUREMENT_ATTRIBUTE Attribute) |
EFI_STATUS EFIAPI | FpdtSmiHandler (IN EFI_HANDLE DispatchHandle, IN CONST VOID *RegisterContext, IN OUT VOID *CommBuffer, IN OUT UINTN *CommBufferSize) |
EFI_STATUS EFIAPI | SmmCorePerformanceLibExitBootServicesCallback (IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle) |
VOID EFIAPI | InitializeSmmCorePerformanceLib (IN EFI_EVENT Event, IN VOID *Context) |
EFI_STATUS EFIAPI | SmmCorePerformanceLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
EFI_STATUS EFIAPI | CreatePerformanceMeasurement (IN CONST VOID *CallerIdentifier OPTIONAL, IN CONST VOID *Guid OPTIONAL, IN CONST CHAR8 *String OPTIONAL, IN UINT64 TimeStamp OPTIONAL, IN UINT64 Address OPTIONAL, IN UINT32 Identifier, IN PERF_MEASUREMENT_ATTRIBUTE Attribute) |
RETURN_STATUS EFIAPI | StartPerformanceMeasurementEx (IN CONST VOID *Handle OPTIONAL, IN CONST CHAR8 *Token OPTIONAL, IN CONST CHAR8 *Module OPTIONAL, IN UINT64 TimeStamp, IN UINT32 Identifier) |
RETURN_STATUS EFIAPI | EndPerformanceMeasurementEx (IN CONST VOID *Handle OPTIONAL, IN CONST CHAR8 *Token OPTIONAL, IN CONST CHAR8 *Module OPTIONAL, IN UINT64 TimeStamp, IN UINT32 Identifier) |
UINTN EFIAPI | GetPerformanceMeasurementEx (IN UINTN LogEntryKey, OUT CONST VOID **Handle, OUT CONST CHAR8 **Token, OUT CONST CHAR8 **Module, OUT UINT64 *StartTimeStamp, OUT UINT64 *EndTimeStamp, OUT UINT32 *Identifier) |
RETURN_STATUS EFIAPI | StartPerformanceMeasurement (IN CONST VOID *Handle OPTIONAL, IN CONST CHAR8 *Token OPTIONAL, IN CONST CHAR8 *Module OPTIONAL, IN UINT64 TimeStamp) |
RETURN_STATUS EFIAPI | EndPerformanceMeasurement (IN CONST VOID *Handle OPTIONAL, IN CONST CHAR8 *Token OPTIONAL, IN CONST CHAR8 *Module OPTIONAL, IN UINT64 TimeStamp) |
UINTN EFIAPI | GetPerformanceMeasurement (IN UINTN LogEntryKey, OUT CONST VOID **Handle, OUT CONST CHAR8 **Token, OUT CONST CHAR8 **Module, OUT UINT64 *StartTimeStamp, OUT UINT64 *EndTimeStamp) |
BOOLEAN EFIAPI | PerformanceMeasurementEnabled (VOID) |
RETURN_STATUS EFIAPI | LogPerformanceMeasurement (IN CONST VOID *CallerIdentifier, IN CONST VOID *Guid OPTIONAL, IN CONST CHAR8 *String OPTIONAL, IN UINT64 Address OPTIONAL, IN UINT32 Identifier) |
BOOLEAN EFIAPI | LogPerformanceMeasurementEnabled (IN CONST UINTN Type) |
Variables | |
SMM_BOOT_PERFORMANCE_TABLE * | mSmmBootPerformanceTable = NULL |
HANDLE_GUID_MAP | mCacheHandleGuidTable [CACHE_HANDLE_GUID_COUNT] |
UINTN | mCachePairCount = 0 |
UINT32 | mPerformanceLength = sizeof (SMM_BOOT_PERFORMANCE_TABLE) |
UINT32 | mMaxPerformanceLength = 0 |
UINT32 | mLoadImageCount = 0 |
BOOLEAN | mFpdtDataIsReported = FALSE |
BOOLEAN | mLackSpaceIsReport = FALSE |
CHAR8 * | mPlatformLanguage = NULL |
SPIN_LOCK | mSmmFpdtLock |
PERFORMANCE_PROPERTY | mPerformanceProperty |
UINT32 | mCachedLength = 0 |
UINT32 | mBootRecordSize = 0 |
BOOLEAN | mPerformanceMeasurementEnabled |
EDKII_PERFORMANCE_MEASUREMENT_PROTOCOL | mPerformanceMeasurementInterface |
Performance library instance used by SMM Core.
This library provides the performance measurement interfaces and initializes performance logging for the SMM phase. It initializes SMM phase performance logging by publishing the SMM Performance and PerformanceEx Protocol, which is consumed by SmmPerformanceLib to logging performance data in SMM phase.
This library is mainly used by SMM Core to start performance logging to ensure that SMM Performance and PerformanceEx Protocol are installed at the very beginning of SMM phase.
Caution: This module requires additional review when modified. This driver will have external input - performance data and communicate buffer in SMM mode. This external input must be validated carefully to avoid security issue like buffer overflow, integer overflow.
SmmPerformanceHandlerEx(), SmmPerformanceHandler() will receive untrusted input and do basic validation.
Copyright (c) 2011 - 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SmmCorePerformanceLib.c.
#define CACHE_HANDLE_GUID_COUNT 0x100 |
Definition at line 28 of file SmmCorePerformanceLib.c.
#define FIRMWARE_RECORD_BUFFER 0x1000 |
Definition at line 27 of file SmmCorePerformanceLib.c.
#define STRING_SIZE (FPDT_STRING_EVENT_RECORD_NAME_LENGTH * sizeof (CHAR8)) |
Definition at line 26 of file SmmCorePerformanceLib.c.
VOID CopyStringIntoPerfRecordAndUpdateLength | ( | IN OUT CHAR8 * | Destination, |
IN CONST CHAR8 * | Source, | ||
IN OUT UINT8 * | Length | ||
) |
Copies the string from Source into Destination and updates Length with the size of the string.
Destination | - destination of the string copy |
Source | - pointer to the source string which will get copied |
Length | - pointer to a length variable to be updated |
Definition at line 464 of file SmmCorePerformanceLib.c.
EFI_STATUS EFIAPI CreatePerformanceMeasurement | ( | IN CONST VOID *CallerIdentifier | OPTIONAL, |
IN CONST VOID *Guid | OPTIONAL, | ||
IN CONST CHAR8 *String | OPTIONAL, | ||
IN UINT64 TimeStamp | OPTIONAL, | ||
IN UINT64 Address | OPTIONAL, | ||
IN UINT32 | Identifier, | ||
IN PERF_MEASUREMENT_ATTRIBUTE | Attribute | ||
) |
Create performance record with event description and a timestamp.
CallerIdentifier | - Image handle or pointer to caller ID GUID. |
Guid | - Pointer to a GUID. |
String | - Pointer to a string describing the measurement. |
TimeStamp | - 64-bit time stamp. |
Address | - Pointer to a location in memory relevant to the measurement. |
Identifier | - Performance identifier describing the type of measurement. |
Attribute | - The attribute of the measurement. According to attribute can create a start record for PERF_START/PERF_START_EX, or a end record for PERF_END/PERF_END_EX, or a general record for other Perf macros. |
EFI_SUCCESS | - Successfully created performance record. |
EFI_OUT_OF_RESOURCES | - Ran out of space to store the records. |
EFI_INVALID_PARAMETER | - Invalid parameter passed to function - NULL pointer or invalid PerfId. |
Definition at line 1110 of file SmmCorePerformanceLib.c.
RETURN_STATUS EFIAPI EndPerformanceMeasurement | ( | IN CONST VOID *Handle | OPTIONAL, |
IN CONST CHAR8 *Token | OPTIONAL, | ||
IN CONST CHAR8 *Module | OPTIONAL, | ||
IN UINT64 | TimeStamp | ||
) |
Searches the performance measurement log from the beginning of the log for the first matching record that contains a zero end time and fills in a valid end time.
Searches the performance measurement log from the beginning of the log for the first record that matches Handle, Token, and Module and has an end time value of zero. If the record can not be found then return RETURN_NOT_FOUND. If the record is found and TimeStamp is not zero, then the end time in the record is filled in with the value specified by TimeStamp. If the record is found and TimeStamp is zero, then the end time in the matching record is filled in with the current time stamp value.
Handle | Pointer to environment specific context used to identify the component being measured. |
Token | Pointer to a Null-terminated ASCII string that identifies the component being measured. |
Module | Pointer to a Null-terminated ASCII string that identifies the module being measured. |
TimeStamp | 64-bit time stamp. |
RETURN_SUCCESS | The end of the measurement was recorded. |
RETURN_NOT_FOUND | The specified measurement record could not be found. |
Definition at line 1346 of file SmmCorePerformanceLib.c.
RETURN_STATUS EFIAPI EndPerformanceMeasurementEx | ( | IN CONST VOID *Handle | OPTIONAL, |
IN CONST CHAR8 *Token | OPTIONAL, | ||
IN CONST CHAR8 *Module | OPTIONAL, | ||
IN UINT64 | TimeStamp, | ||
IN UINT32 | Identifier | ||
) |
Searches the performance measurement log from the beginning of the log for the first matching record that contains a zero end time and fills in a valid end time.
Searches the performance measurement log from the beginning of the log for the first record that matches Handle, Token, Module and Identifier and has an end time value of zero. If the record can not be found then return RETURN_NOT_FOUND. If the record is found and TimeStamp is not zero, then the end time in the record is filled in with the value specified by TimeStamp. If the record is found and TimeStamp is zero, then the end time in the matching record is filled in with the current time stamp value.
Handle | Pointer to environment specific context used to identify the component being measured. |
Token | Pointer to a Null-terminated ASCII string that identifies the component being measured. |
Module | Pointer to a Null-terminated ASCII string that identifies the module being measured. |
TimeStamp | 64-bit time stamp. |
Identifier | 32-bit identifier. If the value is 0, the found record is same as the one found by EndPerformanceMeasurement. |
RETURN_SUCCESS | The end of the measurement was recorded. |
RETURN_NOT_FOUND | The specified measurement record could not be found. |
Definition at line 1206 of file SmmCorePerformanceLib.c.
EFI_STATUS EFIAPI FpdtSmiHandler | ( | IN EFI_HANDLE | DispatchHandle, |
IN CONST VOID * | RegisterContext, | ||
IN OUT VOID * | CommBuffer, | ||
IN OUT UINTN * | CommBufferSize | ||
) |
Communication service SMI Handler entry.
This SMI handler provides services for report MM boot records.
Caution: This function may receive untrusted input. Communicate buffer and buffer size are external input, so this function will do basic validation.
[in] | DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
[in] | RegisterContext | Points to an optional handler context which was specified when the handler was registered. |
[in,out] | CommBuffer | A pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment. |
[in,out] | CommBufferSize | The size of the CommBuffer. |
EFI_SUCCESS | The interrupt was handled and quiesced. No other handlers should still be called. |
EFI_WARN_INTERRUPT_SOURCE_QUIESCED | The interrupt has been quiesced but other handlers should still be called. |
EFI_WARN_INTERRUPT_SOURCE_PENDING | The interrupt is still pending and other handlers should still be called. |
EFI_INTERRUPT_PENDING | The interrupt could not be quiesced. |
Definition at line 842 of file SmmCorePerformanceLib.c.
EFI_STATUS GetFpdtRecordId | ( | IN PERF_MEASUREMENT_ATTRIBUTE | Attribute, |
IN CONST VOID * | Handle, | ||
IN CONST CHAR8 * | String, | ||
OUT UINT16 * | ProgressID | ||
) |
Get the FPDT record identifier.
Attribute | The attribute of the Record. PerfStartEntry: Start Record. PerfEndEntry: End Record. |
Handle | Pointer to environment specific context used to identify the component being measured. |
String | Pointer to a Null-terminated ASCII string that identifies the component being measured. |
ProgressID | On return, pointer to the ProgressID. |
EFI_SUCCESS | Get record info successfully. |
EFI_INVALID_PARAMETER | No matched FPDT record. |
Definition at line 202 of file SmmCorePerformanceLib.c.
EFI_STATUS GetFpdtRecordPtr | ( | IN UINT8 | RecordSize, |
IN OUT FPDT_RECORD_PTR * | FpdtRecordPtr | ||
) |
Return the pointer to the FPDT record in the allocated memory.
RecordSize | The size of FPDT record. |
FpdtRecordPtr | Pointer the FPDT record in the allocated memory. |
EFI_SUCCESS | Successfully get the pointer to the FPDT record. |
EFI_OUT_OF_RESOURCES | Ran out of space to store the records. |
Definition at line 70 of file SmmCorePerformanceLib.c.
EFI_STATUS EFIAPI GetModuleInfoFromHandle | ( | IN EFI_HANDLE | Handle, |
OUT CHAR8 * | NameString, | ||
IN UINTN | BufferSize, | ||
OUT EFI_GUID *ModuleGuid | OPTIONAL | ||
) |
Get a human readable module name and module guid for the given image handle. If module name can't be found, "" string will return. If module guid can't be found, Zero Guid will return.
Handle | Image handle or Controller handle. |
NameString | The ascii string will be filled into it. If not found, null string will return. |
BufferSize | Size of the input NameString buffer. |
ModuleGuid | Point to the guid buffer to store the got module guid value. |
EFI_SUCCESS | Successfully get module name and guid. |
EFI_INVALID_PARAMETER | The input parameter NameString is NULL. |
other | value Module Name can't be got. |
Definition at line 265 of file SmmCorePerformanceLib.c.
UINTN EFIAPI GetPerformanceMeasurement | ( | IN UINTN | LogEntryKey, |
OUT CONST VOID ** | Handle, | ||
OUT CONST CHAR8 ** | Token, | ||
OUT CONST CHAR8 ** | Module, | ||
OUT UINT64 * | StartTimeStamp, | ||
OUT UINT64 * | EndTimeStamp | ||
) |
Attempts to retrieve a performance measurement log entry from the performance measurement log. It can also retrieve the log created by StartPerformanceMeasurementEx and EndPerformanceMeasurementEx, and then eliminate the Identifier.
!!! Not Support!!!
Attempts to retrieve the performance log entry specified by LogEntryKey. If LogEntryKey is zero on entry, then an attempt is made to retrieve the first entry from the performance log, and the key for the second entry in the log is returned. If the performance log is empty, then no entry is retrieved and zero is returned. If LogEntryKey is not zero, then the performance log entry associated with LogEntryKey is retrieved, and the key for the next entry in the log is returned. If LogEntryKey is the key for the last entry in the log, then the last log entry is retrieved and an implementation specific non-zero key value that specifies the end of the performance log is returned. If LogEntryKey is equal this implementation specific non-zero key value, then no entry is retrieved and zero is returned. In the cases where a performance log entry can be returned, the log entry is returned in Handle, Token, Module, StartTimeStamp, and EndTimeStamp. If LogEntryKey is not a valid log entry key for the performance measurement log, then ASSERT(). If Handle is NULL, then ASSERT(). If Token is NULL, then ASSERT(). If Module is NULL, then ASSERT(). If StartTimeStamp is NULL, then ASSERT(). If EndTimeStamp is NULL, then ASSERT().
LogEntryKey | On entry, the key of the performance measurement log entry to retrieve. 0, then the first performance measurement log entry is retrieved. On exit, the key of the next performance log entry. |
Handle | Pointer to environment specific context used to identify the component being measured. |
Token | Pointer to a Null-terminated ASCII string that identifies the component being measured. |
Module | Pointer to a Null-terminated ASCII string that identifies the module being measured. |
StartTimeStamp | Pointer to the 64-bit time stamp that was recorded when the measurement was started. |
EndTimeStamp | Pointer to the 64-bit time stamp that was recorded when the measurement was ended. |
Definition at line 1399 of file SmmCorePerformanceLib.c.
UINTN EFIAPI GetPerformanceMeasurementEx | ( | IN UINTN | LogEntryKey, |
OUT CONST VOID ** | Handle, | ||
OUT CONST CHAR8 ** | Token, | ||
OUT CONST CHAR8 ** | Module, | ||
OUT UINT64 * | StartTimeStamp, | ||
OUT UINT64 * | EndTimeStamp, | ||
OUT UINT32 * | Identifier | ||
) |
Attempts to retrieve a performance measurement log entry from the performance measurement log. It can also retrieve the log created by StartPerformanceMeasurement and EndPerformanceMeasurement, and then assign the Identifier with 0.
!!! Not Support!!!
Attempts to retrieve the performance log entry specified by LogEntryKey. If LogEntryKey is zero on entry, then an attempt is made to retrieve the first entry from the performance log, and the key for the second entry in the log is returned. If the performance log is empty, then no entry is retrieved and zero is returned. If LogEntryKey is not zero, then the performance log entry associated with LogEntryKey is retrieved, and the key for the next entry in the log is returned. If LogEntryKey is the key for the last entry in the log, then the last log entry is retrieved and an implementation specific non-zero key value that specifies the end of the performance log is returned. If LogEntryKey is equal this implementation specific non-zero key value, then no entry is retrieved and zero is returned. In the cases where a performance log entry can be returned, the log entry is returned in Handle, Token, Module, StartTimeStamp, EndTimeStamp and Identifier. If LogEntryKey is not a valid log entry key for the performance measurement log, then ASSERT(). If Handle is NULL, then ASSERT(). If Token is NULL, then ASSERT(). If Module is NULL, then ASSERT(). If StartTimeStamp is NULL, then ASSERT(). If EndTimeStamp is NULL, then ASSERT(). If Identifier is NULL, then ASSERT().
LogEntryKey | On entry, the key of the performance measurement log entry to retrieve. 0, then the first performance measurement log entry is retrieved. On exit, the key of the next performance log entry. |
Handle | Pointer to environment specific context used to identify the component being measured. |
Token | Pointer to a Null-terminated ASCII string that identifies the component being measured. |
Module | Pointer to a Null-terminated ASCII string that identifies the module being measured. |
StartTimeStamp | Pointer to the 64-bit time stamp that was recorded when the measurement was started. |
EndTimeStamp | Pointer to the 64-bit time stamp that was recorded when the measurement was ended. |
Identifier | Pointer to the 32-bit identifier that was recorded. |
Definition at line 1272 of file SmmCorePerformanceLib.c.
SmmBase2 protocol notify callback function, when SMST and SMM memory service get initialized this function is callbacked to initialize the Smm Performance Lib
Event | The event of notify protocol. |
Context | Notify event context. |
Definition at line 972 of file SmmCorePerformanceLib.c.
EFI_STATUS InsertFpdtRecord | ( | IN CONST VOID *CallerIdentifier | OPTIONAL, |
IN CONST VOID *Guid | OPTIONAL, | ||
IN CONST CHAR8 *String | OPTIONAL, | ||
IN UINT64 | Ticker, | ||
IN UINT64 Address | OPTIONAL, | ||
IN UINT16 | PerfId, | ||
IN PERF_MEASUREMENT_ATTRIBUTE | Attribute | ||
) |
Create performance record with event description and a timestamp.
CallerIdentifier | - Image handle or pointer to caller ID GUID. |
Guid | - Pointer to a GUID. |
String | - Pointer to a string describing the measurement. |
Ticker | - 64-bit time stamp. |
Address | - Pointer to a location in memory relevant to the measurement. |
PerfId | - Performance identifier describing the type of measurement. |
Attribute | - The attribute of the measurement. According to attribute can create a start record for PERF_START/PERF_START_EX, or a end record for PERF_END/PERF_END_EX, or a general record for other Perf macros. |
EFI_SUCCESS | - Successfully created performance record. |
EFI_OUT_OF_RESOURCES | - Ran out of space to store the records. |
EFI_INVALID_PARAMETER | - Invalid parameter passed to function - NULL pointer or invalid PerfId. |
EFI_SUCCESS | - Successfully created performance record |
EFI_OUT_OF_RESOURCES | - Ran out of space to store the records |
EFI_INVALID_PARAMETER | - Invalid parameter passed to function - NULL pointer or invalid PerfId |
Definition at line 520 of file SmmCorePerformanceLib.c.
BOOLEAN IsKnownID | ( | IN UINT32 | Identifier | ) |
Check whether the ID is a known one which map to the known Token.
Identifier | 32-bit identifier. |
TRUE | Is a known one used by core. |
FALSE | Not a known one. |
Definition at line 166 of file SmmCorePerformanceLib.c.
Check whether the Token is a known one which is uesed by core.
Token | Pointer to a Null-terminated ASCII string |
TRUE | Is a known one used by core. |
FALSE | Not a known one. |
Definition at line 131 of file SmmCorePerformanceLib.c.
RETURN_STATUS EFIAPI LogPerformanceMeasurement | ( | IN CONST VOID * | CallerIdentifier, |
IN CONST VOID *Guid | OPTIONAL, | ||
IN CONST CHAR8 *String | OPTIONAL, | ||
IN UINT64 Address | OPTIONAL, | ||
IN UINT32 | Identifier | ||
) |
Create performance record with event description and a timestamp.
CallerIdentifier | - Image handle or pointer to caller ID GUID |
Guid | - Pointer to a GUID |
String | - Pointer to a string describing the measurement |
Address | - Pointer to a location in memory relevant to the measurement |
Identifier | - Performance identifier describing the type of measurement |
RETURN_SUCCESS | - Successfully created performance record |
RETURN_OUT_OF_RESOURCES | - Ran out of space to store the records |
RETURN_INVALID_PARAMETER | - Invalid parameter passed to function - NULL pointer or invalid PerfId |
Definition at line 1449 of file SmmCorePerformanceLib.c.
Check whether the specified performance measurement can be logged.
This function returns TRUE when the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is set and the Type disable bit in PcdPerformanceLibraryPropertyMask is not set.
Type | - Type of the performance measurement entry. |
TRUE | The performance measurement can be logged. |
FALSE | The performance measurement can NOT be logged. |
Definition at line 1474 of file SmmCorePerformanceLib.c.
BOOLEAN EFIAPI PerformanceMeasurementEnabled | ( | VOID | ) |
Returns TRUE if the performance measurement macros are enabled.
This function returns TRUE if the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is set. Otherwise FALSE is returned.
TRUE | The PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is set. |
FALSE | The PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is clear. |
Definition at line 1425 of file SmmCorePerformanceLib.c.
EFI_STATUS EFIAPI SmmCorePerformanceLibConstructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The constructor function initializes the Performance Measurement Enable flag and registers SmmBase2 protocol notify callback. It will ASSERT() if one of these operations fails and it will always return EFI_SUCCESS.
ImageHandle | The firmware allocated handle for the EFI image. |
SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The constructor always returns EFI_SUCCESS. |
Definition at line 1046 of file SmmCorePerformanceLib.c.
EFI_STATUS EFIAPI SmmCorePerformanceLibExitBootServicesCallback | ( | IN CONST EFI_GUID * | Protocol, |
IN VOID * | Interface, | ||
IN EFI_HANDLE | Handle | ||
) |
This is the Event call back function is triggered in SMM to notify the Library the system is entering runtime phase.
[in] | Protocol | Points to the protocol's unique identifier |
[in] | Interface | Points to the interface instance |
[in] | Handle | The handle on which the interface was installed |
EFI_SUCCESS | SmmAtRuntimeCallBack runs successfully |
Definition at line 945 of file SmmCorePerformanceLib.c.
RETURN_STATUS EFIAPI StartPerformanceMeasurement | ( | IN CONST VOID *Handle | OPTIONAL, |
IN CONST CHAR8 *Token | OPTIONAL, | ||
IN CONST CHAR8 *Module | OPTIONAL, | ||
IN UINT64 | TimeStamp | ||
) |
Adds a record at the end of the performance measurement log that records the start time of a performance measurement.
Adds a record to the end of the performance measurement log that contains the Handle, Token, and Module. The end time of the new record must be set to zero. If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record. If TimeStamp is zero, the start time in the record is filled in with the value read from the current time stamp.
Handle | Pointer to environment specific context used to identify the component being measured. |
Token | Pointer to a Null-terminated ASCII string that identifies the component being measured. |
Module | Pointer to a Null-terminated ASCII string that identifies the module being measured. |
TimeStamp | 64-bit time stamp. |
RETURN_SUCCESS | The start of the measurement was recorded. |
RETURN_OUT_OF_RESOURCES | There are not enough resources to record the measurement. |
Definition at line 1310 of file SmmCorePerformanceLib.c.
RETURN_STATUS EFIAPI StartPerformanceMeasurementEx | ( | IN CONST VOID *Handle | OPTIONAL, |
IN CONST CHAR8 *Token | OPTIONAL, | ||
IN CONST CHAR8 *Module | OPTIONAL, | ||
IN UINT64 | TimeStamp, | ||
IN UINT32 | Identifier | ||
) |
Adds a record at the end of the performance measurement log that records the start time of a performance measurement.
Adds a record to the end of the performance measurement log that contains the Handle, Token, Module and Identifier. The end time of the new record must be set to zero. If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record. If TimeStamp is zero, the start time in the record is filled in with the value read from the current time stamp.
Handle | Pointer to environment specific context used to identify the component being measured. |
Token | Pointer to a Null-terminated ASCII string that identifies the component being measured. |
Module | Pointer to a Null-terminated ASCII string that identifies the module being measured. |
TimeStamp | 64-bit time stamp. |
Identifier | 32-bit identifier. If the value is 0, the created record is same as the one created by StartPerformanceMeasurement. |
RETURN_SUCCESS | The start of the measurement was recorded. |
RETURN_OUT_OF_RESOURCES | There are not enough resources to record the measurement. |
Definition at line 1157 of file SmmCorePerformanceLib.c.
UINT32 mBootRecordSize = 0 |
Definition at line 50 of file SmmCorePerformanceLib.c.
UINT32 mCachedLength = 0 |
Definition at line 49 of file SmmCorePerformanceLib.c.
HANDLE_GUID_MAP mCacheHandleGuidTable[CACHE_HANDLE_GUID_COUNT] |
Definition at line 38 of file SmmCorePerformanceLib.c.
UINTN mCachePairCount = 0 |
Definition at line 39 of file SmmCorePerformanceLib.c.
BOOLEAN mFpdtDataIsReported = FALSE |
Definition at line 44 of file SmmCorePerformanceLib.c.
BOOLEAN mLackSpaceIsReport = FALSE |
Definition at line 45 of file SmmCorePerformanceLib.c.
UINT32 mLoadImageCount = 0 |
Definition at line 43 of file SmmCorePerformanceLib.c.
UINT32 mMaxPerformanceLength = 0 |
Definition at line 42 of file SmmCorePerformanceLib.c.
UINT32 mPerformanceLength = sizeof (SMM_BOOT_PERFORMANCE_TABLE) |
Definition at line 41 of file SmmCorePerformanceLib.c.
BOOLEAN mPerformanceMeasurementEnabled |
Definition at line 51 of file SmmCorePerformanceLib.c.
EDKII_PERFORMANCE_MEASUREMENT_PROTOCOL mPerformanceMeasurementInterface |
Definition at line 56 of file SmmCorePerformanceLib.c.
PERFORMANCE_PROPERTY mPerformanceProperty |
Definition at line 48 of file SmmCorePerformanceLib.c.
CHAR8* mPlatformLanguage = NULL |
Definition at line 46 of file SmmCorePerformanceLib.c.
SMM_BOOT_PERFORMANCE_TABLE* mSmmBootPerformanceTable = NULL |
Definition at line 30 of file SmmCorePerformanceLib.c.
SPIN_LOCK mSmmFpdtLock |
Definition at line 47 of file SmmCorePerformanceLib.c.