53 OUT UINT64 *StartTimeStamp,
54 OUT UINT64 *EndTimeStamp,
55 OUT UINT32 *Identifier
58 if (LogEntryKey == mMeasurementNum) {
62 *Handle = (VOID *)(
UINTN)mMeasurementList[LogEntryKey].Handle;
63 *Token = mMeasurementList[LogEntryKey].
Token;
64 *Module = mMeasurementList[LogEntryKey].
Module;
66 *EndTimeStamp = mMeasurementList[LogEntryKey].
EndTimeStamp;
67 *Identifier = mMeasurementList[LogEntryKey].
Identifier;
118 if (Measurement.Handle !=
NULL) {
126 if (Measurement.Handle ==
NULL) {
140 if ( Duration <
CumData[TIndex].MinDur ) {
144 if ( Duration >
CumData[TIndex].MaxDur ) {
152 if ((CustomCumulativeData !=
NULL) && (
AsciiStrCmp (Measurement.
Token, CustomCumulativeData->Name) == 0)) {
153 CustomCumulativeData->Duration += Duration;
154 CustomCumulativeData->Count++;
155 if (Duration < CustomCumulativeData->MinDur) {
156 CustomCumulativeData->MinDur = Duration;
159 if (Duration > CustomCumulativeData->MaxDur) {
160 CustomCumulativeData->MaxDur = Duration;
190 IN BOOLEAN ExcludeFlag
205 EFI_STRING StringPtrUnknown;
215 (IncFlag ==
NULL) ? StringPtrUnknown : IncFlag
222 if (EFI_ERROR (Status)) {
256 SHELL_FREE_NON_NULL (IncFlag);
265 if (((Measurement.
EndTimeStamp != 0) && (ElapsedTime < mInterestThreshold)) ||
277 if (Measurement.Handle !=
NULL) {
279 for (TIndex = 0; TIndex < HandleCount; TIndex++) {
280 if (Measurement.Handle == HandleBuffer[TIndex]) {
293 mUnicodeToken[13] = 0;
327 Status = EFI_ABORTED;
333 if (HandleBuffer !=
NULL) {
337 SHELL_FREE_NON_NULL (IncFlag);
365 IN BOOLEAN ExcludeFlag
375 EFI_STRING StringPtr;
376 EFI_STRING StringPtrUnknown;
389 (StringPtr ==
NULL) ? StringPtrUnknown : StringPtr
424 if ((ElapsedTime < mInterestThreshold) ||
465 Status = EFI_ABORTED;
483 UINT64 BdsTimeoutValue;
491 EFI_STRING StringPtr;
493 EFI_STRING StringPtrUnknown;
511 (StringPtr ==
NULL) ? StringPtrUnknown : StringPtr
533 if ( (Measurement.Handle !=
NULL)
537 BdsTimeoutValue = Duration;
553 if (SecTime > mResetEnd) {
554 SecTime = SecTime - mResetEnd;
571 ElapsedTime =
DivU64x32 (PeiTime, 1000000);
572 Total += ElapsedTime;
579 ElapsedTime =
DivU64x32 (DxeTime, 1000000);
580 Total += ElapsedTime;
587 ElapsedTime =
DivU64x32 (BdsTime, 1000000);
588 Total += ElapsedTime;
592 if (BdsTimeoutValue > 0) {
593 ElapsedTime =
DivU64x32 (BdsTimeoutValue, 1000000);
611 IN BOOLEAN ExcludeFlag
618 EFI_STRING StringPtr;
624 EFI_STRING StringPtrUnknown;
634 (StringPtr ==
NULL) ? StringPtrUnknown : StringPtr
640 if (EFI_ERROR (Status)) {
644 Print (L
"There are %,d Handles defined.\n", (Size /
sizeof (HandleBuffer[0])));
670 if ((ElapsedTime < mInterestThreshold) ||
682 for (Index = 0; Index < HandleCount; Index++) {
683 if (Measurement.Handle == HandleBuffer[Index]) {
691 mUnicodeToken[11] = 0;
725 Status = EFI_ABORTED;
731 if (HandleBuffer !=
NULL) {
754 EFI_STRING StringPtr;
757 EFI_STRING StringPtrUnknown;
770 (StringPtr ==
NULL) ? StringPtrUnknown : StringPtr
804 if (ElapsedTime >= mInterestThreshold) {
833 Status = EFI_ABORTED;
860 EFI_STRING StringPtr;
863 EFI_STRING StringPtrUnknown;
876 (StringPtr ==
NULL) ? StringPtrUnknown : StringPtr
905 mUnicodeToken[31] = 0;
906 if ( !(
IsPhase (&Measurement) ||
913 if (ElapsedTime >= mInterestThreshold) {
944 Status = EFI_ABORTED;
974 EFI_STRING StringPtr;
976 EFI_STRING StringPtrUnknown;
986 (StringPtr ==
NULL) ? StringPtrUnknown : StringPtr
995 for ( TIndex = 0; TIndex <
NumCum; ++TIndex) {
996 if (
CumData[TIndex].Count != 0) {
1022 if (CustomCumulativeData !=
NULL) {
1023 if (CustomCumulativeData->Count != 0) {
1024 AvgDur =
DivU64x32 (CustomCumulativeData->Duration, CustomCumulativeData->Count);
1042 CustomCumulativeData->Name,
1043 CustomCumulativeData->Count,
UINT64 EFIAPI DivU64x32(IN UINT64 Dividend, IN UINT32 Divisor)
INTN EFIAPI AsciiStrCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
RETURN_STATUS EFIAPI AsciiStrToUnicodeStrS(IN CONST CHAR8 *Source, OUT CHAR16 *Destination, IN UINTN DestMax)
PERF_CUM_DATA CumData[]
Items for which to gather cumulative statistics.
PERF_SUMMARY_DATA SummaryData
Create the SummaryData structure and init. to ZERO.
CHAR16 mGaugeString[DP_GAUGE_STRING_LENGTH+1]
UINT32 const NumCum
Number of items for which we are gathering cumulative statistics.
EFI_HII_HANDLE mDpHiiHandle
#define WITHIN_LIMIT(C, L)
Determine whether 0 <= C < L. If L == 0, return true regardless of C.
INTN GetCumulativeItem(IN MEASUREMENT_RECORD *Measurement)
BOOLEAN IsPhase(IN MEASUREMENT_RECORD *Measurement)
VOID DpGetNameFromHandle(IN EFI_HANDLE Handle)
UINT64 GetDuration(IN OUT MEASUREMENT_RECORD *Measurement)
BOOLEAN IsCorePerf(IN MEASUREMENT_RECORD *Measurement)
UINT64 DurationInMicroSeconds(IN UINT64 Duration)
UINTN GetPerformanceMeasurementRecord(IN UINTN LogEntryKey, OUT CONST VOID **Handle, OUT CONST CHAR8 **Token, OUT CONST CHAR8 **Module, OUT UINT64 *StartTimeStamp, OUT UINT64 *EndTimeStamp, OUT UINT32 *Identifier)
VOID GatherStatistics(IN OUT PERF_CUM_DATA *CustomCumulativeData OPTIONAL)
EFI_STATUS ProcessGlobal(VOID)
EFI_STATUS DumpRawTrace(IN UINTN Limit, IN BOOLEAN ExcludeFlag)
EFI_STATUS ProcessPeims(VOID)
EFI_STATUS DumpAllTrace(IN UINTN Limit, IN BOOLEAN ExcludeFlag)
EFI_STATUS ProcessHandles(IN BOOLEAN ExcludeFlag)
VOID ProcessCumulative(IN PERF_CUM_DATA *CustomCumulativeData OPTIONAL)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STRING EFIAPI HiiGetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language OPTIONAL)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
#define ARRAY_SIZE(Array)
BOOLEAN EFIAPI ShellGetExecutionBreakFlag(VOID)
EFI_STATUS EFIAPI ShellPrintHiiEx(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR8 *Language OPTIONAL, IN CONST EFI_STRING_ID HiiFormatStringId, IN CONST EFI_HII_HANDLE HiiFormatHandle,...)
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)
UINT32 Identifier
Identifier.
CONST CHAR8 * Module
Module string name.
UINT64 StartTimeStamp
Start time point.
CONST CHAR8 * Token
Measured token string name.
UINT64 EndTimeStamp
End time point.
UINT64 MaxDur
Largest duration encountered.
UINT64 MinDur
Smallest duration encountered.
UINT64 Duration
Cumulative duration for this item.
UINT32 Count
Total number of measurements accumulated.
UINT32 NumSummary
Number of summary section measurements.
UINT32 NumHandles
Number of measurements with handles.
UINT32 NumPEIMs
Number of measurements of PEIMs.
UINT32 NumTrace
Number of recorded TRACE performance measurements.
UINT32 NumGlobal
Number of measurements with END value and NULL handle.
UINT32 NumIncomplete
Number of measurements with no END value.