mirror of https://github.com/acidanthera/audk.git
Add new extension PerformanceLib APIs to store ID info.
Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13216 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
f0da4d7d9a
commit
0b84f444de
|
@ -13,7 +13,7 @@
|
||||||
Dp uses this information to group records in different ways. It also uses
|
Dp uses this information to group records in different ways. It also uses
|
||||||
timer information to calculate elapsed time for each measurement.
|
timer information to calculate elapsed time for each measurement.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -49,6 +49,7 @@ CHAR16 *mPrintTokenBuffer = NULL;
|
||||||
CHAR16 mGaugeString[DP_GAUGE_STRING_LENGTH + 1];
|
CHAR16 mGaugeString[DP_GAUGE_STRING_LENGTH + 1];
|
||||||
CHAR16 mUnicodeToken[DXE_PERFORMANCE_STRING_SIZE];
|
CHAR16 mUnicodeToken[DXE_PERFORMANCE_STRING_SIZE];
|
||||||
UINT64 mInterestThreshold;
|
UINT64 mInterestThreshold;
|
||||||
|
BOOLEAN mShowId = FALSE;
|
||||||
|
|
||||||
PERF_SUMMARY_DATA SummaryData = { 0 }; ///< Create the SummaryData structure and init. to ZERO.
|
PERF_SUMMARY_DATA SummaryData = { 0 }; ///< Create the SummaryData structure and init. to ZERO.
|
||||||
|
|
||||||
|
@ -79,6 +80,7 @@ PARAM_ITEM_LIST ParamList[] = {
|
||||||
{STRING_TOKEN (STR_DP_OPTION_UT), TypeFlag}, // -T Dump Trace Data
|
{STRING_TOKEN (STR_DP_OPTION_UT), TypeFlag}, // -T Dump Trace Data
|
||||||
#endif
|
#endif
|
||||||
{STRING_TOKEN (STR_DP_OPTION_LX), TypeFlag}, // -x eXclude Cumulative Items
|
{STRING_TOKEN (STR_DP_OPTION_LX), TypeFlag}, // -x eXclude Cumulative Items
|
||||||
|
{STRING_TOKEN (STR_DP_OPTION_LI), TypeFlag}, // -i Display Identifier
|
||||||
{STRING_TOKEN (STR_DP_OPTION_LN), TypeValue}, // -n # Number of records to display for A and R
|
{STRING_TOKEN (STR_DP_OPTION_LN), TypeValue}, // -n # Number of records to display for A and R
|
||||||
{STRING_TOKEN (STR_DP_OPTION_LT), TypeValue} // -t # Threshold of interest
|
{STRING_TOKEN (STR_DP_OPTION_LT), TypeValue} // -t # Threshold of interest
|
||||||
};
|
};
|
||||||
|
@ -135,6 +137,7 @@ ShowHelp( void )
|
||||||
#endif // PROFILING_IMPLEMENTED
|
#endif // PROFILING_IMPLEMENTED
|
||||||
PrintToken (STRING_TOKEN (STR_DP_HELP_THRESHOLD));
|
PrintToken (STRING_TOKEN (STR_DP_HELP_THRESHOLD));
|
||||||
PrintToken (STRING_TOKEN (STR_DP_HELP_COUNT));
|
PrintToken (STRING_TOKEN (STR_DP_HELP_COUNT));
|
||||||
|
PrintToken (STRING_TOKEN (STR_DP_HELP_ID));
|
||||||
PrintToken (STRING_TOKEN (STR_DP_HELP_HELP));
|
PrintToken (STRING_TOKEN (STR_DP_HELP_HELP));
|
||||||
Print(L"\n");
|
Print(L"\n");
|
||||||
}
|
}
|
||||||
|
@ -214,6 +217,7 @@ InitializeDp (
|
||||||
EFI_STRING StringDpOptionLx;
|
EFI_STRING StringDpOptionLx;
|
||||||
EFI_STRING StringDpOptionLn;
|
EFI_STRING StringDpOptionLn;
|
||||||
EFI_STRING StringDpOptionLt;
|
EFI_STRING StringDpOptionLt;
|
||||||
|
EFI_STRING StringDpOptionLi;
|
||||||
|
|
||||||
SummaryMode = FALSE;
|
SummaryMode = FALSE;
|
||||||
VerboseMode = FALSE;
|
VerboseMode = FALSE;
|
||||||
|
@ -236,6 +240,7 @@ InitializeDp (
|
||||||
StringDpOptionLx = NULL;
|
StringDpOptionLx = NULL;
|
||||||
StringDpOptionLn = NULL;
|
StringDpOptionLn = NULL;
|
||||||
StringDpOptionLt = NULL;
|
StringDpOptionLt = NULL;
|
||||||
|
StringDpOptionLi = NULL;
|
||||||
StringPtr = NULL;
|
StringPtr = NULL;
|
||||||
|
|
||||||
// Get DP's entry time as soon as possible.
|
// Get DP's entry time as soon as possible.
|
||||||
|
@ -283,6 +288,7 @@ InitializeDp (
|
||||||
StringDpOptionLx = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_OPTION_LX), NULL);
|
StringDpOptionLx = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_OPTION_LX), NULL);
|
||||||
StringDpOptionLn = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_OPTION_LN), NULL);
|
StringDpOptionLn = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_OPTION_LN), NULL);
|
||||||
StringDpOptionLt = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_OPTION_LT), NULL);
|
StringDpOptionLt = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_OPTION_LT), NULL);
|
||||||
|
StringDpOptionLi = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_OPTION_LI), NULL);
|
||||||
|
|
||||||
// Boolean Options
|
// Boolean Options
|
||||||
//
|
//
|
||||||
|
@ -296,6 +302,7 @@ InitializeDp (
|
||||||
ProfileMode = ShellCommandLineGetFlag (ParamPackage, StringDpOptionUp);
|
ProfileMode = ShellCommandLineGetFlag (ParamPackage, StringDpOptionUp);
|
||||||
#endif // PROFILING_IMPLEMENTED
|
#endif // PROFILING_IMPLEMENTED
|
||||||
ExcludeMode = ShellCommandLineGetFlag (ParamPackage, StringDpOptionLx);
|
ExcludeMode = ShellCommandLineGetFlag (ParamPackage, StringDpOptionLx);
|
||||||
|
mShowId = ShellCommandLineGetFlag (ParamPackage, StringDpOptionLi);
|
||||||
|
|
||||||
// Options with Values
|
// Options with Values
|
||||||
CmdLineArg = ShellCommandLineGetValue (ParamPackage, StringDpOptionLn);
|
CmdLineArg = ShellCommandLineGetValue (ParamPackage, StringDpOptionLn);
|
||||||
|
@ -447,6 +454,7 @@ InitializeDp (
|
||||||
SafeFreePool (StringDpOptionLx);
|
SafeFreePool (StringDpOptionLx);
|
||||||
SafeFreePool (StringDpOptionLn);
|
SafeFreePool (StringDpOptionLn);
|
||||||
SafeFreePool (StringDpOptionLt);
|
SafeFreePool (StringDpOptionLt);
|
||||||
|
SafeFreePool (StringDpOptionLi);
|
||||||
SafeFreePool (StringPtr);
|
SafeFreePool (StringPtr);
|
||||||
SafeFreePool (mPrintTokenBuffer);
|
SafeFreePool (mPrintTokenBuffer);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Common declarations for the Dp Performance Reporting Utility.
|
Common declarations for the Dp Performance Reporting Utility.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -83,6 +83,7 @@ typedef struct {
|
||||||
CONST CHAR8 *Module; ///< Module string name.
|
CONST CHAR8 *Module; ///< Module string name.
|
||||||
UINT64 StartTimeStamp; ///< Start time point.
|
UINT64 StartTimeStamp; ///< Start time point.
|
||||||
UINT64 EndTimeStamp; ///< End time point.
|
UINT64 EndTimeStamp; ///< End time point.
|
||||||
|
UINT32 Identifier; ///< Identifier.
|
||||||
} MEASUREMENT_RECORD;
|
} MEASUREMENT_RECORD;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
Dp application. In addition to global data, function declarations for
|
Dp application. In addition to global data, function declarations for
|
||||||
DpUtilities.c, DpTrace.c, and DpProfile.c are included here.
|
DpUtilities.c, DpTrace.c, and DpProfile.c are included here.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -28,6 +28,7 @@ extern CHAR16 *mPrintTokenBuffer;
|
||||||
extern CHAR16 mGaugeString[DP_GAUGE_STRING_LENGTH + 1];
|
extern CHAR16 mGaugeString[DP_GAUGE_STRING_LENGTH + 1];
|
||||||
extern CHAR16 mUnicodeToken[DXE_PERFORMANCE_STRING_SIZE];
|
extern CHAR16 mUnicodeToken[DXE_PERFORMANCE_STRING_SIZE];
|
||||||
extern UINT64 mInterestThreshold;
|
extern UINT64 mInterestThreshold;
|
||||||
|
extern BOOLEAN mShowId;
|
||||||
|
|
||||||
extern PERF_SUMMARY_DATA SummaryData; ///< Create the SummaryData structure and init. to ZERO.
|
extern PERF_SUMMARY_DATA SummaryData; ///< Create the SummaryData structure and init. to ZERO.
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Trace reporting for the Dp utility.
|
Trace reporting for the Dp utility.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -54,13 +54,14 @@ GatherStatistics(
|
||||||
INTN TIndex;
|
INTN TIndex;
|
||||||
|
|
||||||
LogEntryKey = 0;
|
LogEntryKey = 0;
|
||||||
while ((LogEntryKey = GetPerformanceMeasurement (
|
while ((LogEntryKey = GetPerformanceMeasurementEx (
|
||||||
LogEntryKey,
|
LogEntryKey,
|
||||||
&Measurement.Handle,
|
&Measurement.Handle,
|
||||||
&Measurement.Token,
|
&Measurement.Token,
|
||||||
&Measurement.Module,
|
&Measurement.Module,
|
||||||
&Measurement.StartTimeStamp,
|
&Measurement.StartTimeStamp,
|
||||||
&Measurement.EndTimeStamp)) != 0)
|
&Measurement.EndTimeStamp,
|
||||||
|
&Measurement.Identifier)) != 0)
|
||||||
{
|
{
|
||||||
++SummaryData.NumTrace; // Count the number of TRACE Measurement records
|
++SummaryData.NumTrace; // Count the number of TRACE Measurement records
|
||||||
if (Measurement.EndTimeStamp == 0) {
|
if (Measurement.EndTimeStamp == 0) {
|
||||||
|
@ -168,27 +169,31 @@ DumpAllTrace(
|
||||||
// Display only records with Elapsed times >= mInterestThreshold
|
// Display only records with Elapsed times >= mInterestThreshold
|
||||||
// Display driver names in Module field for records with Handles.
|
// Display driver names in Module field for records with Handles.
|
||||||
//
|
//
|
||||||
|
if (mShowId) {
|
||||||
|
PrintToken (STRING_TOKEN (STR_DP_ALL_HEADR2) );
|
||||||
|
PrintToken (STRING_TOKEN (STR_DP_ALL_DASHES2) );
|
||||||
|
} else {
|
||||||
PrintToken (STRING_TOKEN (STR_DP_ALL_HEADR) );
|
PrintToken (STRING_TOKEN (STR_DP_ALL_HEADR) );
|
||||||
PrintToken (STRING_TOKEN (STR_DP_DASHES) );
|
PrintToken (STRING_TOKEN (STR_DP_DASHES) );
|
||||||
|
}
|
||||||
|
|
||||||
LogEntryKey = 0;
|
LogEntryKey = 0;
|
||||||
Count = 0;
|
Count = 0;
|
||||||
Index = 0;
|
Index = 0;
|
||||||
while ( WITHIN_LIMIT(Count, Limit) &&
|
while ( WITHIN_LIMIT(Count, Limit) &&
|
||||||
((LogEntryKey = GetPerformanceMeasurement (
|
((LogEntryKey = GetPerformanceMeasurementEx (
|
||||||
LogEntryKey,
|
LogEntryKey,
|
||||||
&Measurement.Handle,
|
&Measurement.Handle,
|
||||||
&Measurement.Token,
|
&Measurement.Token,
|
||||||
&Measurement.Module,
|
&Measurement.Module,
|
||||||
&Measurement.StartTimeStamp,
|
&Measurement.StartTimeStamp,
|
||||||
&Measurement.EndTimeStamp)) != 0)
|
&Measurement.EndTimeStamp,
|
||||||
|
&Measurement.Identifier)) != 0)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
++Index; // Count every record. First record is 1.
|
++Index; // Count every record. First record is 1.
|
||||||
ElapsedTime = 0;
|
ElapsedTime = 0;
|
||||||
if (IncFlag != NULL) {
|
SafeFreePool ((VOID *) IncFlag);
|
||||||
FreePool ((void *)IncFlag);
|
|
||||||
}
|
|
||||||
if (Measurement.EndTimeStamp != 0) {
|
if (Measurement.EndTimeStamp != 0) {
|
||||||
Duration = GetDuration (&Measurement);
|
Duration = GetDuration (&Measurement);
|
||||||
ElapsedTime = DurationInMicroSeconds ( Duration );
|
ElapsedTime = DurationInMicroSeconds ( Duration );
|
||||||
|
@ -225,6 +230,17 @@ DumpAllTrace(
|
||||||
mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;
|
mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;
|
||||||
mUnicodeToken[13] = 0;
|
mUnicodeToken[13] = 0;
|
||||||
|
|
||||||
|
if (mShowId) {
|
||||||
|
PrintToken( STRING_TOKEN (STR_DP_ALL_VARS2),
|
||||||
|
Index, // 1 based, Which measurement record is being printed
|
||||||
|
IncFlag,
|
||||||
|
Measurement.Handle,
|
||||||
|
mGaugeString,
|
||||||
|
mUnicodeToken,
|
||||||
|
ElapsedTime,
|
||||||
|
Measurement.Identifier
|
||||||
|
);
|
||||||
|
} else {
|
||||||
PrintToken( STRING_TOKEN (STR_DP_ALL_VARS),
|
PrintToken( STRING_TOKEN (STR_DP_ALL_VARS),
|
||||||
Index, // 1 based, Which measurement record is being printed
|
Index, // 1 based, Which measurement record is being printed
|
||||||
IncFlag,
|
IncFlag,
|
||||||
|
@ -235,10 +251,11 @@ DumpAllTrace(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (HandleBuffer != &TempHandle) {
|
if (HandleBuffer != &TempHandle) {
|
||||||
FreePool (HandleBuffer);
|
FreePool (HandleBuffer);
|
||||||
}
|
}
|
||||||
FreePool ((void *)IncFlag);
|
SafeFreePool ((VOID *) IncFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -282,20 +299,26 @@ DumpRawTrace(
|
||||||
FreePool (StringPtr);
|
FreePool (StringPtr);
|
||||||
FreePool (StringPtrUnknown);
|
FreePool (StringPtrUnknown);
|
||||||
|
|
||||||
|
if (mShowId) {
|
||||||
|
PrintToken (STRING_TOKEN (STR_DP_RAW_HEADR2) );
|
||||||
|
PrintToken (STRING_TOKEN (STR_DP_RAW_DASHES2) );
|
||||||
|
} else {
|
||||||
PrintToken (STRING_TOKEN (STR_DP_RAW_HEADR) );
|
PrintToken (STRING_TOKEN (STR_DP_RAW_HEADR) );
|
||||||
PrintToken (STRING_TOKEN (STR_DP_RAW_DASHES) );
|
PrintToken (STRING_TOKEN (STR_DP_RAW_DASHES) );
|
||||||
|
}
|
||||||
|
|
||||||
LogEntryKey = 0;
|
LogEntryKey = 0;
|
||||||
Count = 0;
|
Count = 0;
|
||||||
Index = 0;
|
Index = 0;
|
||||||
while ( WITHIN_LIMIT(Count, Limit) &&
|
while ( WITHIN_LIMIT(Count, Limit) &&
|
||||||
((LogEntryKey = GetPerformanceMeasurement (
|
((LogEntryKey = GetPerformanceMeasurementEx (
|
||||||
LogEntryKey,
|
LogEntryKey,
|
||||||
&Measurement.Handle,
|
&Measurement.Handle,
|
||||||
&Measurement.Token,
|
&Measurement.Token,
|
||||||
&Measurement.Module,
|
&Measurement.Module,
|
||||||
&Measurement.StartTimeStamp,
|
&Measurement.StartTimeStamp,
|
||||||
&Measurement.EndTimeStamp)) != 0)
|
&Measurement.EndTimeStamp,
|
||||||
|
&Measurement.Identifier)) != 0)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
++Index; // Count every record. First record is 1.
|
++Index; // Count every record. First record is 1.
|
||||||
|
@ -310,6 +333,18 @@ DumpRawTrace(
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
++Count; // Count the number of records printed
|
++Count; // Count the number of records printed
|
||||||
|
|
||||||
|
if (mShowId) {
|
||||||
|
PrintToken (STRING_TOKEN (STR_DP_RAW_VARS2),
|
||||||
|
Index, // 1 based, Which measurement record is being printed
|
||||||
|
Measurement.Handle,
|
||||||
|
Measurement.StartTimeStamp,
|
||||||
|
Measurement.EndTimeStamp,
|
||||||
|
Measurement.Token,
|
||||||
|
Measurement.Module,
|
||||||
|
Measurement.Identifier
|
||||||
|
);
|
||||||
|
} else {
|
||||||
PrintToken (STRING_TOKEN (STR_DP_RAW_VARS),
|
PrintToken (STRING_TOKEN (STR_DP_RAW_VARS),
|
||||||
Index, // 1 based, Which measurement record is being printed
|
Index, // 1 based, Which measurement record is being printed
|
||||||
Measurement.Handle,
|
Measurement.Handle,
|
||||||
|
@ -319,6 +354,7 @@ DumpRawTrace(
|
||||||
Measurement.Module
|
Measurement.Module
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -363,13 +399,14 @@ ProcessPhases(
|
||||||
FreePool (StringPtrUnknown);
|
FreePool (StringPtrUnknown);
|
||||||
|
|
||||||
LogEntryKey = 0;
|
LogEntryKey = 0;
|
||||||
while ((LogEntryKey = GetPerformanceMeasurement (
|
while ((LogEntryKey = GetPerformanceMeasurementEx (
|
||||||
LogEntryKey,
|
LogEntryKey,
|
||||||
&Measurement.Handle,
|
&Measurement.Handle,
|
||||||
&Measurement.Token,
|
&Measurement.Token,
|
||||||
&Measurement.Module,
|
&Measurement.Module,
|
||||||
&Measurement.StartTimeStamp,
|
&Measurement.StartTimeStamp,
|
||||||
&Measurement.EndTimeStamp)) != 0)
|
&Measurement.EndTimeStamp,
|
||||||
|
&Measurement.Identifier)) != 0)
|
||||||
{
|
{
|
||||||
if (AsciiStrnCmp (Measurement.Token, ALit_SHELL, PERF_TOKEN_LENGTH) == 0) {
|
if (AsciiStrnCmp (Measurement.Token, ALit_SHELL, PERF_TOKEN_LENGTH) == 0) {
|
||||||
Measurement.EndTimeStamp = Ticker;
|
Measurement.EndTimeStamp = Ticker;
|
||||||
|
@ -512,18 +549,23 @@ ProcessHandles(
|
||||||
Print (L"There are %,d Handles defined.\n", (Size / sizeof(HandleBuffer[0])));
|
Print (L"There are %,d Handles defined.\n", (Size / sizeof(HandleBuffer[0])));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (mShowId) {
|
||||||
|
PrintToken (STRING_TOKEN (STR_DP_HANDLE_SECTION2) );
|
||||||
|
} else {
|
||||||
PrintToken (STRING_TOKEN (STR_DP_HANDLE_SECTION) );
|
PrintToken (STRING_TOKEN (STR_DP_HANDLE_SECTION) );
|
||||||
|
}
|
||||||
PrintToken (STRING_TOKEN (STR_DP_DASHES) );
|
PrintToken (STRING_TOKEN (STR_DP_DASHES) );
|
||||||
|
|
||||||
LogEntryKey = 0;
|
LogEntryKey = 0;
|
||||||
Count = 0;
|
Count = 0;
|
||||||
while ((LogEntryKey = GetPerformanceMeasurement (
|
while ((LogEntryKey = GetPerformanceMeasurementEx (
|
||||||
LogEntryKey,
|
LogEntryKey,
|
||||||
&Measurement.Handle,
|
&Measurement.Handle,
|
||||||
&Measurement.Token,
|
&Measurement.Token,
|
||||||
&Measurement.Module,
|
&Measurement.Module,
|
||||||
&Measurement.StartTimeStamp,
|
&Measurement.StartTimeStamp,
|
||||||
&Measurement.EndTimeStamp)) != 0)
|
&Measurement.EndTimeStamp,
|
||||||
|
&Measurement.Identifier)) != 0)
|
||||||
{
|
{
|
||||||
Count++;
|
Count++;
|
||||||
Duration = GetDuration (&Measurement);
|
Duration = GetDuration (&Measurement);
|
||||||
|
@ -549,6 +591,17 @@ ProcessHandles(
|
||||||
mUnicodeToken[11] = 0;
|
mUnicodeToken[11] = 0;
|
||||||
if (mGaugeString[0] != 0) {
|
if (mGaugeString[0] != 0) {
|
||||||
// Display the record if it has a valid handle.
|
// Display the record if it has a valid handle.
|
||||||
|
if (mShowId) {
|
||||||
|
PrintToken (
|
||||||
|
STRING_TOKEN (STR_DP_HANDLE_VARS2),
|
||||||
|
Count, // 1 based, Which measurement record is being printed
|
||||||
|
Index + 1, // 1 based, Which handle is being printed
|
||||||
|
mGaugeString,
|
||||||
|
mUnicodeToken,
|
||||||
|
ElapsedTime,
|
||||||
|
Measurement.Identifier
|
||||||
|
);
|
||||||
|
} else {
|
||||||
PrintToken (
|
PrintToken (
|
||||||
STRING_TOKEN (STR_DP_HANDLE_VARS),
|
STRING_TOKEN (STR_DP_HANDLE_VARS),
|
||||||
Count, // 1 based, Which measurement record is being printed
|
Count, // 1 based, Which measurement record is being printed
|
||||||
|
@ -560,6 +613,7 @@ ProcessHandles(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (HandleBuffer != &TempHandle) {
|
if (HandleBuffer != &TempHandle) {
|
||||||
FreePool (HandleBuffer);
|
FreePool (HandleBuffer);
|
||||||
}
|
}
|
||||||
|
@ -592,17 +646,22 @@ ProcessPeims(
|
||||||
FreePool (StringPtr);
|
FreePool (StringPtr);
|
||||||
FreePool (StringPtrUnknown);
|
FreePool (StringPtrUnknown);
|
||||||
|
|
||||||
|
if (mShowId) {
|
||||||
|
PrintToken (STRING_TOKEN (STR_DP_PEIM_SECTION2));
|
||||||
|
} else {
|
||||||
PrintToken (STRING_TOKEN (STR_DP_PEIM_SECTION));
|
PrintToken (STRING_TOKEN (STR_DP_PEIM_SECTION));
|
||||||
|
}
|
||||||
PrintToken (STRING_TOKEN (STR_DP_DASHES));
|
PrintToken (STRING_TOKEN (STR_DP_DASHES));
|
||||||
TIndex = 0;
|
TIndex = 0;
|
||||||
LogEntryKey = 0;
|
LogEntryKey = 0;
|
||||||
while ((LogEntryKey = GetPerformanceMeasurement (
|
while ((LogEntryKey = GetPerformanceMeasurementEx (
|
||||||
LogEntryKey,
|
LogEntryKey,
|
||||||
&Measurement.Handle,
|
&Measurement.Handle,
|
||||||
&Measurement.Token,
|
&Measurement.Token,
|
||||||
&Measurement.Module,
|
&Measurement.Module,
|
||||||
&Measurement.StartTimeStamp,
|
&Measurement.StartTimeStamp,
|
||||||
&Measurement.EndTimeStamp)) != 0)
|
&Measurement.EndTimeStamp,
|
||||||
|
&Measurement.Identifier)) != 0)
|
||||||
{
|
{
|
||||||
TIndex++;
|
TIndex++;
|
||||||
if ((Measurement.EndTimeStamp == 0) ||
|
if ((Measurement.EndTimeStamp == 0) ||
|
||||||
|
@ -615,6 +674,15 @@ ProcessPeims(
|
||||||
ElapsedTime = DurationInMicroSeconds ( Duration ); // Calculate elapsed time in microseconds
|
ElapsedTime = DurationInMicroSeconds ( Duration ); // Calculate elapsed time in microseconds
|
||||||
if (ElapsedTime >= mInterestThreshold) {
|
if (ElapsedTime >= mInterestThreshold) {
|
||||||
// PEIM FILE Handle is the start address of its FFS file that contains its file guid.
|
// PEIM FILE Handle is the start address of its FFS file that contains its file guid.
|
||||||
|
if (mShowId) {
|
||||||
|
PrintToken (STRING_TOKEN (STR_DP_PEIM_VARS2),
|
||||||
|
TIndex, // 1 based, Which measurement record is being printed
|
||||||
|
Measurement.Handle, // base address
|
||||||
|
Measurement.Handle, // file guid
|
||||||
|
ElapsedTime,
|
||||||
|
Measurement.Identifier
|
||||||
|
);
|
||||||
|
} else {
|
||||||
PrintToken (STRING_TOKEN (STR_DP_PEIM_VARS),
|
PrintToken (STRING_TOKEN (STR_DP_PEIM_VARS),
|
||||||
TIndex, // 1 based, Which measurement record is being printed
|
TIndex, // 1 based, Which measurement record is being printed
|
||||||
Measurement.Handle, // base address
|
Measurement.Handle, // base address
|
||||||
|
@ -623,6 +691,7 @@ ProcessPeims(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -654,23 +723,28 @@ ProcessGlobal(
|
||||||
FreePool (StringPtr);
|
FreePool (StringPtr);
|
||||||
FreePool (StringPtrUnknown);
|
FreePool (StringPtrUnknown);
|
||||||
|
|
||||||
|
if (mShowId) {
|
||||||
|
PrintToken (STRING_TOKEN (STR_DP_GLOBAL_SECTION2));
|
||||||
|
} else {
|
||||||
PrintToken (STRING_TOKEN (STR_DP_GLOBAL_SECTION));
|
PrintToken (STRING_TOKEN (STR_DP_GLOBAL_SECTION));
|
||||||
|
}
|
||||||
PrintToken (STRING_TOKEN (STR_DP_DASHES));
|
PrintToken (STRING_TOKEN (STR_DP_DASHES));
|
||||||
|
|
||||||
Index = 1;
|
Index = 1;
|
||||||
LogEntryKey = 0;
|
LogEntryKey = 0;
|
||||||
|
|
||||||
while ((LogEntryKey = GetPerformanceMeasurement (
|
while ((LogEntryKey = GetPerformanceMeasurementEx (
|
||||||
LogEntryKey,
|
LogEntryKey,
|
||||||
&Measurement.Handle,
|
&Measurement.Handle,
|
||||||
&Measurement.Token,
|
&Measurement.Token,
|
||||||
&Measurement.Module,
|
&Measurement.Module,
|
||||||
&Measurement.StartTimeStamp,
|
&Measurement.StartTimeStamp,
|
||||||
&Measurement.EndTimeStamp)) != 0)
|
&Measurement.EndTimeStamp,
|
||||||
|
&Measurement.Identifier)) != 0)
|
||||||
{
|
{
|
||||||
AsciiStrToUnicodeStr (Measurement.Module, mGaugeString);
|
AsciiStrToUnicodeStr (Measurement.Module, mGaugeString);
|
||||||
AsciiStrToUnicodeStr (Measurement.Token, mUnicodeToken);
|
AsciiStrToUnicodeStr (Measurement.Token, mUnicodeToken);
|
||||||
mGaugeString[26] = 0;
|
mGaugeString[25] = 0;
|
||||||
mUnicodeToken[31] = 0;
|
mUnicodeToken[31] = 0;
|
||||||
if ( ! ( IsPhase( &Measurement) ||
|
if ( ! ( IsPhase( &Measurement) ||
|
||||||
(Measurement.Handle != NULL) ||
|
(Measurement.Handle != NULL) ||
|
||||||
|
@ -680,6 +754,16 @@ ProcessGlobal(
|
||||||
Duration = GetDuration (&Measurement);
|
Duration = GetDuration (&Measurement);
|
||||||
ElapsedTime = DurationInMicroSeconds ( Duration );
|
ElapsedTime = DurationInMicroSeconds ( Duration );
|
||||||
if (ElapsedTime >= mInterestThreshold) {
|
if (ElapsedTime >= mInterestThreshold) {
|
||||||
|
if (mShowId) {
|
||||||
|
PrintToken (
|
||||||
|
STRING_TOKEN (STR_DP_GLOBAL_VARS2),
|
||||||
|
Index,
|
||||||
|
mGaugeString,
|
||||||
|
mUnicodeToken,
|
||||||
|
ElapsedTime,
|
||||||
|
Measurement.Identifier
|
||||||
|
);
|
||||||
|
} else {
|
||||||
PrintToken (
|
PrintToken (
|
||||||
STRING_TOKEN (STR_DP_GLOBAL_VARS),
|
STRING_TOKEN (STR_DP_GLOBAL_VARS),
|
||||||
Index,
|
Index,
|
||||||
|
@ -689,6 +773,7 @@ ProcessGlobal(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Index++;
|
Index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue