summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library/DxeCorePerformanceLib
diff options
context:
space:
mode:
authorBi, Dandan <dandan.bi@intel.com>2018-06-22 16:56:16 +0800
committerLiming Gao <liming.gao@intel.com>2018-06-26 15:36:39 +0800
commit137fb13deb0bb75241b10dc1d676d45230aa73b7 (patch)
tree6531a7bd9b3d940b65a5023e6f2e497c97add272 /MdeModulePkg/Library/DxeCorePerformanceLib
parent56f7741e277349dd9227e08d5aa78e3d049514dd (diff)
downloadedk2-137fb13deb0bb75241b10dc1d676d45230aa73b7.tar.gz
edk2-137fb13deb0bb75241b10dc1d676d45230aa73b7.tar.bz2
edk2-137fb13deb0bb75241b10dc1d676d45230aa73b7.zip
MdeModulePkg: Update Performance instances to use new protocol
Update Performance instances in MdeModulePkg to use new PerformanceMeasurement protocol. Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdeModulePkg/Library/DxeCorePerformanceLib')
-rw-r--r--MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c325
-rw-r--r--MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf6
-rw-r--r--MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h216
3 files changed, 104 insertions, 443 deletions
diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
index 68b29ac5a9..7982060518 100644
--- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
+++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
@@ -82,21 +82,10 @@ BOOLEAN mLockInsertRecord = FALSE;
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *mDevicePathToText = NULL;
//
-// Interfaces for Performance Protocol.
+// Interfaces for PerformanceMeasurement Protocol.
//
-PERFORMANCE_PROTOCOL mPerformanceInterface = {
- StartGauge,
- EndGauge,
- GetGauge
- };
-
-//
-// Interfaces for PerformanceEx Protocol.
-//
-PERFORMANCE_EX_PROTOCOL mPerformanceExInterface = {
- StartGaugeEx,
- EndGaugeEx,
- GetGaugeEx
+EDKII_PERFORMANCE_MEASUREMENT_PROTOCOL mPerformanceMeasurementInterface = {
+ CreatePerformanceMeasurement,
};
PERFORMANCE_PROPERTY mPerformanceProperty;
@@ -799,18 +788,11 @@ InsertFpdtMeasurement (
UseModuleName = FALSE;
ZeroMem (ModuleName, sizeof (ModuleName));
- if (mLockInsertRecord) {
- return EFI_UNSUPPORTED;
- }
-
- mLockInsertRecord = TRUE;
-
//
// Get record info (type, size, ProgressID and Module Guid).
//
Status = GetFpdtRecordInfo (IsStart, Handle, Token, Module, &RecordInfo, &UseModuleName);
if (EFI_ERROR (Status)) {
- mLockInsertRecord = FALSE;
return Status;
}
@@ -824,7 +806,6 @@ InsertFpdtMeasurement (
// If input ID doesn't follow the rule, we will adjust it.
//
if ((Identifier != 0) && (IsKnownID (Identifier)) && (!IsKnownTokens (Token))) {
- mLockInsertRecord = FALSE;
return EFI_UNSUPPORTED;
} else if ((Identifier != 0) && (!IsKnownID (Identifier)) && (!IsKnownTokens (Token))) {
if (IsStart && ((Identifier & 0x000F) != 0)) {
@@ -844,7 +825,6 @@ InsertFpdtMeasurement (
DEBUG ((DEBUG_INFO, "DxeCorePerformanceLib: No enough space to save boot records\n"));
mLackSpaceIsReported = TRUE;
}
- mLockInsertRecord = FALSE;
return EFI_OUT_OF_RESOURCES;
} else {
//
@@ -866,7 +846,6 @@ InsertFpdtMeasurement (
);
if (mPerformancePointer == NULL) {
- mLockInsertRecord = FALSE;
return EFI_OUT_OF_RESOURCES;
}
mMaxPerformanceLength = mPerformanceLength + RecordInfo.RecordSize + FIRMWARE_RECORD_BUFFER;
@@ -963,11 +942,9 @@ InsertFpdtMeasurement (
//
// Record is not supported in current DXE phase, return EFI_ABORTED
//
- mLockInsertRecord = FALSE;
return EFI_UNSUPPORTED;
}
- mLockInsertRecord = FALSE;
return EFI_SUCCESS;
}
@@ -1064,219 +1041,6 @@ ReportFpdtRecordBuffer (
}
/**
- 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.
-
- @param Handle Pointer to environment specific context used
- to identify the component being measured.
- @param Token Pointer to a Null-terminated ASCII string
- that identifies the component being measured.
- @param Module Pointer to a Null-terminated ASCII string
- that identifies the module being measured.
- @param TimeStamp 64-bit time stamp.
- @param Identifier 32-bit identifier. If the value is 0, the created record
- is same as the one created by StartGauge of PERFORMANCE_PROTOCOL.
-
- @retval EFI_SUCCESS The data was read correctly from the device.
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
-
-**/
-EFI_STATUS
-EFIAPI
-StartGaugeEx (
- IN CONST VOID *Handle, OPTIONAL
- IN CONST CHAR8 *Token, OPTIONAL
- IN CONST CHAR8 *Module, OPTIONAL
- IN UINT64 TimeStamp,
- IN UINT32 Identifier
- )
-{
- return InsertFpdtMeasurement (TRUE, Handle, Token, Module, TimeStamp, 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 EFI_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.
-
- @param Handle Pointer to environment specific context used
- to identify the component being measured.
- @param Token Pointer to a Null-terminated ASCII string
- that identifies the component being measured.
- @param Module Pointer to a Null-terminated ASCII string
- that identifies the module being measured.
- @param TimeStamp 64-bit time stamp.
- @param Identifier 32-bit identifier. If the value is 0, the found record
- is same as the one found by EndGauge of PERFORMANCE_PROTOCOL.
-
- @retval EFI_SUCCESS The end of the measurement was recorded.
- @retval EFI_NOT_FOUND The specified measurement record could not be found.
-
-**/
-EFI_STATUS
-EFIAPI
-EndGaugeEx (
- IN CONST VOID *Handle, OPTIONAL
- IN CONST CHAR8 *Token, OPTIONAL
- IN CONST CHAR8 *Module, OPTIONAL
- IN UINT64 TimeStamp,
- IN UINT32 Identifier
- )
-{
- return InsertFpdtMeasurement (FALSE, Handle, Token, Module, TimeStamp, Identifier);
-}
-
-/**
- Retrieves a previously logged performance measurement.
- It can also retrieve the log created by StartGauge and EndGauge of PERFORMANCE_PROTOCOL,
- and then assign the Identifier with 0.
-
- !!! Not support!!!
-
- Retrieves the performance log entry from the performance log specified by LogEntryKey.
- If it stands for a valid entry, then EFI_SUCCESS is returned and
- GaugeDataEntryEx stores the pointer to that entry.
-
- @param LogEntryKey The key for the previous performance measurement log entry.
- If 0, then the first performance measurement log entry is retrieved.
- @param GaugeDataEntryEx The indirect pointer to the extended gauge data entry specified by LogEntryKey
- if the retrieval is successful.
-
- @retval EFI_SUCCESS The GuageDataEntryEx is successfully found based on LogEntryKey.
- @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
- @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
- @retval EFI_INVALIDE_PARAMETER GaugeDataEntryEx is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-GetGaugeEx (
- IN UINTN LogEntryKey,
- OUT GAUGE_DATA_ENTRY_EX **GaugeDataEntryEx
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-/**
- 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.
-
- @param Handle Pointer to environment specific context used
- to identify the component being measured.
- @param Token Pointer to a Null-terminated ASCII string
- that identifies the component being measured.
- @param Module Pointer to a Null-terminated ASCII string
- that identifies the module being measured.
- @param TimeStamp 64-bit time stamp.
-
- @retval EFI_SUCCESS The data was read correctly from the device.
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
-
-**/
-EFI_STATUS
-EFIAPI
-StartGauge (
- IN CONST VOID *Handle, OPTIONAL
- IN CONST CHAR8 *Token, OPTIONAL
- IN CONST CHAR8 *Module, OPTIONAL
- IN UINT64 TimeStamp
- )
-{
- return StartGaugeEx (Handle, Token, Module, TimeStamp, 0);
-}
-
-/**
- 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 EFI_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.
-
- @param Handle Pointer to environment specific context used
- to identify the component being measured.
- @param Token Pointer to a Null-terminated ASCII string
- that identifies the component being measured.
- @param Module Pointer to a Null-terminated ASCII string
- that identifies the module being measured.
- @param TimeStamp 64-bit time stamp.
-
- @retval EFI_SUCCESS The end of the measurement was recorded.
- @retval EFI_NOT_FOUND The specified measurement record could not be found.
-
-**/
-EFI_STATUS
-EFIAPI
-EndGauge (
- IN CONST VOID *Handle, OPTIONAL
- IN CONST CHAR8 *Token, OPTIONAL
- IN CONST CHAR8 *Module, OPTIONAL
- IN UINT64 TimeStamp
- )
-{
- return EndGaugeEx (Handle, Token, Module, TimeStamp, 0);
-}
-
-/**
- Retrieves a previously logged performance measurement.
- It can also retrieve the log created by StartGaugeEx and EndGaugeEx of PERFORMANCE_EX_PROTOCOL,
- and then eliminate the Identifier.
-
- !!! Not support!!!
-
- Retrieves the performance log entry from the performance log specified by LogEntryKey.
- If it stands for a valid entry, then EFI_SUCCESS is returned and
- GaugeDataEntry stores the pointer to that entry.
-
- @param LogEntryKey The key for the previous performance measurement log entry.
- If 0, then the first performance measurement log entry is retrieved.
- @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey
- if the retrieval is successful.
-
- @retval EFI_SUCCESS The GuageDataEntry is successfully found based on LogEntryKey.
- @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
- @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
- @retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-GetGauge (
- IN UINTN LogEntryKey,
- OUT GAUGE_DATA_ENTRY **GaugeDataEntry
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-
-/**
The constructor function initializes Performance infrastructure for DXE phase.
The constructor function publishes Performance and PerformanceEx protocol, allocates memory to log DXE performance
@@ -1319,10 +1083,8 @@ DxeCorePerformanceLibConstructor (
Handle = NULL;
Status = gBS->InstallMultipleProtocolInterfaces (
&Handle,
- &gPerformanceProtocolGuid,
- &mPerformanceInterface,
- &gPerformanceExProtocolGuid,
- &mPerformanceExInterface,
+ &gEdkiiPerformanceMeasurementProtocolGuid,
+ &mPerformanceMeasurementInterface,
NULL
);
ASSERT_EFI_ERROR (Status);
@@ -1360,6 +1122,55 @@ DxeCorePerformanceLibConstructor (
}
/**
+ Create performance record with event description and a timestamp.
+
+ @param CallerIdentifier - Image handle or pointer to caller ID GUID.
+ @param Guid - Pointer to a GUID.
+ @param String - Pointer to a string describing the measurement.
+ @param TimeStamp - 64-bit time stamp.
+ @param Address - Pointer to a location in memory relevant to the measurement.
+ @param Identifier - Performance identifier describing the type of measurement.
+ @param 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.
+
+ @retval EFI_SUCCESS - Successfully created performance record.
+ @retval EFI_OUT_OF_RESOURCES - Ran out of space to store the records.
+ @retval EFI_INVALID_PARAMETER - Invalid parameter passed to function - NULL
+ pointer or invalid PerfId.
+**/
+EFI_STATUS
+EFIAPI
+CreatePerformanceMeasurement (
+ IN CONST VOID *CallerIdentifier,
+ IN CONST VOID *Guid, OPTIONAL
+ IN CONST CHAR8 *String, OPTIONAL
+ IN UINT64 TimeStamp,
+ IN UINT64 Address, OPTIONAL
+ IN UINT32 Identifier,
+ IN PERF_MEASUREMENT_ATTRIBUTE Attribute
+ )
+{
+ EFI_STATUS Status;
+
+ Status = EFI_SUCCESS;
+
+ if (mLockInsertRecord) {
+ return EFI_INVALID_PARAMETER;
+ }
+ mLockInsertRecord = TRUE;
+
+ if (Attribute == PerfStartEntry) {
+ Status = InsertFpdtMeasurement (TRUE, CallerIdentifier, String, String, TimeStamp, Identifier);
+ } else if (Attribute == PerfEndEntry) {
+ Status = InsertFpdtMeasurement (FALSE, CallerIdentifier, String, String, TimeStamp, Identifier);
+ }
+ mLockInsertRecord = FALSE;
+
+ return Status;
+}
+
+/**
Adds a record at the end of the performance measurement log
that records the start time of a performance measurement.
@@ -1394,7 +1205,17 @@ StartPerformanceMeasurementEx (
IN UINT32 Identifier
)
{
- return InsertFpdtMeasurement (TRUE, Handle, Token, Module, TimeStamp, Identifier);
+ CONST CHAR8 *String;
+
+ if (Token != NULL) {
+ String = Token;
+ } else if (Module != NULL) {
+ String = Module;
+ } else {
+ String = NULL;
+ }
+
+ return (RETURN_STATUS)CreatePerformanceMeasurement (Handle, NULL, String, TimeStamp, 0, Identifier, PerfStartEntry);
}
/**
@@ -1433,7 +1254,17 @@ EndPerformanceMeasurementEx (
IN UINT32 Identifier
)
{
- return InsertFpdtMeasurement (FALSE, Handle, Token, Module, TimeStamp, Identifier);
+ CONST CHAR8 *String;
+
+ if (Token != NULL) {
+ String = Token;
+ } else if (Module != NULL) {
+ String = Module;
+ } else {
+ String = NULL;
+ }
+
+ return (RETURN_STATUS)CreatePerformanceMeasurement (Handle, NULL, String, TimeStamp, 0, Identifier, PerfEndEntry);
}
/**
@@ -1527,7 +1358,7 @@ StartPerformanceMeasurement (
IN UINT64 TimeStamp
)
{
- return InsertFpdtMeasurement (TRUE, Handle, Token, Module, TimeStamp, 0);
+ return StartPerformanceMeasurementEx (Handle, Token, Module, TimeStamp, 0);
}
/**
@@ -1563,7 +1394,7 @@ EndPerformanceMeasurement (
IN UINT64 TimeStamp
)
{
- return InsertFpdtMeasurement (FALSE, Handle, Token, Module, TimeStamp, 0);
+ return EndPerformanceMeasurementEx (Handle, Token, Module, TimeStamp, 0);
}
/**
diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf
index e752a93d83..68cd76da5b 100644
--- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf
+++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf
@@ -67,18 +67,14 @@
[Guids]
- ## SOMETIMES_CONSUMES ## HOB
- ## PRODUCES ## UNDEFINED # Install protocol
## PRODUCES ## SystemTable
gPerformanceProtocolGuid
- ## SOMETIMES_CONSUMES ## HOB
- ## PRODUCES ## UNDEFINED # Install protocol
- gPerformanceExProtocolGuid
gZeroGuid ## SOMETIMES_CONSUMES ## GUID
gEfiFirmwarePerformanceGuid ## SOMETIMES_PRODUCES ## UNDEFINED # StatusCode Data
gEdkiiFpdtExtendedFirmwarePerformanceGuid ## SOMETIMES_CONSUMES ## HOB # StatusCode Data
gEfiEventReadyToBootGuid ## CONSUMES ## Event
gEdkiiPiSmmCommunicationRegionTableGuid ## SOMETIMES_CONSUMES ## SystemTable
+ gEdkiiPerformanceMeasurementProtocolGuid ## PRODUCES ## UNDEFINED # Install protocol
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask ## CONSUMES
diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h
index 7e79675f94..f9800e3494 100644
--- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h
+++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h
@@ -22,6 +22,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <PiDxe.h>
#include <Guid/Performance.h>
+#include <Guid/PerformanceMeasurement.h>
#include <Guid/ExtendedFirmwarePerformance.h>
#include <Guid/ZeroGuid.h>
#include <Guid/EventGroup.h>
@@ -49,201 +50,34 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/DxeServicesLib.h>
#include <Library/PeCoffGetEntryPointLib.h>
-//
-// Interface declarations for PerformanceEx Protocol.
-//
/**
- 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.
-
- @param Handle Pointer to environment specific context used
- to identify the component being measured.
- @param Token Pointer to a Null-terminated ASCII string
- that identifies the component being measured.
- @param Module Pointer to a Null-terminated ASCII string
- that identifies the module being measured.
- @param TimeStamp 64-bit time stamp.
- @param Identifier 32-bit identifier. If the value is 0, the created record
- is same as the one created by StartGauge of PERFORMANCE_PROTOCOL.
-
- @retval EFI_SUCCESS The data was read correctly from the device.
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
-
-**/
-EFI_STATUS
-EFIAPI
-StartGaugeEx (
- 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 EFI_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.
-
- @param Handle Pointer to environment specific context used
- to identify the component being measured.
- @param Token Pointer to a Null-terminated ASCII string
- that identifies the component being measured.
- @param Module Pointer to a Null-terminated ASCII string
- that identifies the module being measured.
- @param TimeStamp 64-bit time stamp.
- @param Identifier 32-bit identifier. If the value is 0, the found record
- is same as the one found by EndGauge of PERFORMANCE_PROTOCOL.
-
- @retval EFI_SUCCESS The end of the measurement was recorded.
- @retval EFI_NOT_FOUND The specified measurement record could not be found.
-
+ Create performance record with event description and a timestamp.
+
+ @param CallerIdentifier - Image handle or pointer to caller ID GUID.
+ @param Guid - Pointer to a GUID.
+ @param String - Pointer to a string describing the measurement.
+ @param TimeStamp - 64-bit time stamp.
+ @param Address - Pointer to a location in memory relevant to the measurement.
+ @param Identifier - Performance identifier describing the type of measurement.
+ @param 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.
+
+ @retval EFI_SUCCESS - Successfully created performance record.
+ @retval EFI_OUT_OF_RESOURCES - Ran out of space to store the records.
+ @retval EFI_INVALID_PARAMETER - Invalid parameter passed to function - NULL
+ pointer or invalid PerfId.
**/
EFI_STATUS
EFIAPI
-EndGaugeEx (
- IN CONST VOID *Handle, OPTIONAL
- IN CONST CHAR8 *Token, OPTIONAL
- IN CONST CHAR8 *Module, OPTIONAL
- IN UINT64 TimeStamp,
- IN UINT32 Identifier
+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
);
-/**
- Retrieves a previously logged performance measurement.
- It can also retrieve the log created by StartGauge and EndGauge of PERFORMANCE_PROTOCOL,
- and then assign the Identifier with 0.
-
- Retrieves the performance log entry from the performance log specified by LogEntryKey.
- If it stands for a valid entry, then EFI_SUCCESS is returned and
- GaugeDataEntryEx stores the pointer to that entry.
-
- @param LogEntryKey The key for the previous performance measurement log entry.
- If 0, then the first performance measurement log entry is retrieved.
- @param GaugeDataEntryEx The indirect pointer to the extended gauge data entry specified by LogEntryKey
- if the retrieval is successful.
-
- @retval EFI_SUCCESS The GuageDataEntryEx is successfully found based on LogEntryKey.
- @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
- @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
- @retval EFI_INVALIDE_PARAMETER GaugeDataEntryEx is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-GetGaugeEx (
- IN UINTN LogEntryKey,
- OUT GAUGE_DATA_ENTRY_EX **GaugeDataEntryEx
- );
-
-//
-// Interface declarations for Performance Protocol.
-//
-/**
- 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.
-
- @param Handle Pointer to environment specific context used
- to identify the component being measured.
- @param Token Pointer to a Null-terminated ASCII string
- that identifies the component being measured.
- @param Module Pointer to a Null-terminated ASCII string
- that identifies the module being measured.
- @param TimeStamp 64-bit time stamp.
-
- @retval EFI_SUCCESS The data was read correctly from the device.
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
-
-**/
-EFI_STATUS
-EFIAPI
-StartGauge (
- 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 EFI_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.
-
- @param Handle Pointer to environment specific context used
- to identify the component being measured.
- @param Token Pointer to a Null-terminated ASCII string
- that identifies the component being measured.
- @param Module Pointer to a Null-terminated ASCII string
- that identifies the module being measured.
- @param TimeStamp 64-bit time stamp.
-
- @retval EFI_SUCCESS The end of the measurement was recorded.
- @retval EFI_NOT_FOUND The specified measurement record could not be found.
-
-**/
-EFI_STATUS
-EFIAPI
-EndGauge (
- IN CONST VOID *Handle, OPTIONAL
- IN CONST CHAR8 *Token, OPTIONAL
- IN CONST CHAR8 *Module, OPTIONAL
- IN UINT64 TimeStamp
- );
-
-/**
- Retrieves a previously logged performance measurement.
- It can also retrieve the log created by StartGaugeEx and EndGaugeEx of PERFORMANCE_EX_PROTOCOL,
- and then eliminate the Identifier.
-
- Retrieves the performance log entry from the performance log specified by LogEntryKey.
- If it stands for a valid entry, then EFI_SUCCESS is returned and
- GaugeDataEntry stores the pointer to that entry.
-
- @param LogEntryKey The key for the previous performance measurement log entry.
- If 0, then the first performance measurement log entry is retrieved.
- @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey
- if the retrieval is successful.
-
- @retval EFI_SUCCESS The GuageDataEntry is successfully found based on LogEntryKey.
- @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
- @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
- @retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-GetGauge (
- IN UINTN LogEntryKey,
- OUT GAUGE_DATA_ENTRY **GaugeDataEntry
- );
-
-
#endif