Refine code to make code follow the coding style.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11011 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -29,18 +29,19 @@
|
||||
#include "Literals.h"
|
||||
#include "DpInternal.h"
|
||||
|
||||
/** Collect verbose statistics about the logged performance measurements.
|
||||
*
|
||||
* General Summary information for all Trace measurements is gathered and
|
||||
* stored within the SummaryData structure. This information is both
|
||||
* used internally by subsequent reporting functions, and displayed
|
||||
* at the end of verbose reports.
|
||||
*
|
||||
* @pre The SummaryData and CumData structures must be initialized
|
||||
* prior to calling this function.
|
||||
*
|
||||
* @post The SummaryData and CumData structures contain statistics for the
|
||||
* current performance logs.
|
||||
/**
|
||||
Collect verbose statistics about the logged performance measurements.
|
||||
|
||||
General Summary information for all Trace measurements is gathered and
|
||||
stored within the SummaryData structure. This information is both
|
||||
used internally by subsequent reporting functions, and displayed
|
||||
at the end of verbose reports.
|
||||
|
||||
@pre The SummaryData and CumData structures must be initialized
|
||||
prior to calling this function.
|
||||
|
||||
@post The SummaryData and CumData structures contain statistics for the
|
||||
current performance logs.
|
||||
**/
|
||||
VOID
|
||||
GatherStatistics(
|
||||
@@ -99,22 +100,23 @@ GatherStatistics(
|
||||
}
|
||||
}
|
||||
|
||||
/** Gather and print ALL Trace Records.
|
||||
*
|
||||
* Displays all "interesting" Trace measurements in order.<BR>
|
||||
* The number of records displayed is controlled by:
|
||||
* - records with a duration less than mInterestThreshold microseconds are not displayed.
|
||||
* - No more than Limit records are displayed. A Limit of zero will not limit the output.
|
||||
* - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not
|
||||
* displayed.
|
||||
*
|
||||
* @pre The mInterestThreshold global variable is set to the shortest duration to be printed.
|
||||
* The mGaugeString and mUnicodeToken global arrays are used for temporary string storage.
|
||||
* They must not be in use by a calling function.
|
||||
*
|
||||
* @param[in] Limit The number of records to print. Zero is ALL.
|
||||
* @param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
|
||||
*
|
||||
/**
|
||||
Gather and print ALL Trace Records.
|
||||
|
||||
Displays all "interesting" Trace measurements in order.<BR>
|
||||
The number of records displayed is controlled by:
|
||||
- records with a duration less than mInterestThreshold microseconds are not displayed.
|
||||
- No more than Limit records are displayed. A Limit of zero will not limit the output.
|
||||
- If the ExcludeFlag is TRUE, records matching entries in the CumData array are not
|
||||
displayed.
|
||||
|
||||
@pre The mInterestThreshold global variable is set to the shortest duration to be printed.
|
||||
The mGaugeString and mUnicodeToken global arrays are used for temporary string storage.
|
||||
They must not be in use by a calling function.
|
||||
|
||||
@param[in] Limit The number of records to print. Zero is ALL.
|
||||
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
|
||||
|
||||
**/
|
||||
VOID
|
||||
DumpAllTrace(
|
||||
@@ -230,22 +232,23 @@ DumpAllTrace(
|
||||
}
|
||||
}
|
||||
|
||||
/** Gather and print Raw Trace Records.
|
||||
*
|
||||
* All Trace measurements with a duration greater than or equal to
|
||||
* mInterestThreshold are printed without interpretation.
|
||||
*
|
||||
* The number of records displayed is controlled by:
|
||||
* - records with a duration less than mInterestThreshold microseconds are not displayed.
|
||||
* - No more than Limit records are displayed. A Limit of zero will not limit the output.
|
||||
* - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not
|
||||
* displayed.
|
||||
*
|
||||
* @pre The mInterestThreshold global variable is set to the shortest duration to be printed.
|
||||
*
|
||||
* @param[in] Limit The number of records to print. Zero is ALL.
|
||||
* @param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
|
||||
*
|
||||
/**
|
||||
Gather and print Raw Trace Records.
|
||||
|
||||
All Trace measurements with a duration greater than or equal to
|
||||
mInterestThreshold are printed without interpretation.
|
||||
|
||||
The number of records displayed is controlled by:
|
||||
- records with a duration less than mInterestThreshold microseconds are not displayed.
|
||||
- No more than Limit records are displayed. A Limit of zero will not limit the output.
|
||||
- If the ExcludeFlag is TRUE, records matching entries in the CumData array are not
|
||||
displayed.
|
||||
|
||||
@pre The mInterestThreshold global variable is set to the shortest duration to be printed.
|
||||
|
||||
@param[in] Limit The number of records to print. Zero is ALL.
|
||||
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
|
||||
|
||||
**/
|
||||
VOID
|
||||
DumpRawTrace(
|
||||
@@ -305,10 +308,11 @@ DumpRawTrace(
|
||||
}
|
||||
}
|
||||
|
||||
/** Gather and print Major Phase metrics.
|
||||
*
|
||||
* @param[in] Ticker The timer value for the END of Shell phase
|
||||
*
|
||||
/**
|
||||
Gather and print Major Phase metrics.
|
||||
|
||||
@param[in] Ticker The timer value for the END of Shell phase
|
||||
|
||||
**/
|
||||
VOID
|
||||
ProcessPhases(
|
||||
@@ -316,18 +320,24 @@ ProcessPhases(
|
||||
)
|
||||
{
|
||||
MEASUREMENT_RECORD Measurement;
|
||||
UINT64 BdsTimeoutValue = 0;
|
||||
UINT64 SecTime = 0;
|
||||
UINT64 PeiTime = 0;
|
||||
UINT64 DxeTime = 0;
|
||||
UINT64 BdsTime = 0;
|
||||
UINT64 ShellTime = 0;
|
||||
UINT64 BdsTimeoutValue;
|
||||
UINT64 SecTime;
|
||||
UINT64 PeiTime;
|
||||
UINT64 DxeTime;
|
||||
UINT64 BdsTime;
|
||||
UINT64 ShellTime;
|
||||
UINT64 ElapsedTime;
|
||||
UINT64 Duration;
|
||||
UINT64 Total;
|
||||
EFI_STRING StringPtr;
|
||||
UINTN LogEntryKey;
|
||||
|
||||
BdsTimeoutValue = 0;
|
||||
SecTime = 0;
|
||||
PeiTime = 0;
|
||||
DxeTime = 0;
|
||||
BdsTime = 0;
|
||||
ShellTime = 0;
|
||||
//
|
||||
// Get Execution Phase Statistics
|
||||
//
|
||||
@@ -434,11 +444,12 @@ ProcessPhases(
|
||||
PrintToken (STRING_TOKEN (STR_DP_TOTAL_DURATION), Total);
|
||||
}
|
||||
|
||||
/** Gather and print Handle data.
|
||||
*
|
||||
* @param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
|
||||
*
|
||||
* @return Status from a call to gBS->LocateHandle().
|
||||
/**
|
||||
Gather and print Handle data.
|
||||
|
||||
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
|
||||
|
||||
@return Status from a call to gBS->LocateHandle().
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProcessHandles(
|
||||
@@ -534,10 +545,11 @@ ProcessHandles(
|
||||
return Status;
|
||||
}
|
||||
|
||||
/** Gather and print PEIM data.
|
||||
*
|
||||
* Only prints complete PEIM records
|
||||
*
|
||||
/**
|
||||
Gather and print PEIM data.
|
||||
|
||||
Only prints complete PEIM records
|
||||
|
||||
**/
|
||||
VOID
|
||||
ProcessPeims(
|
||||
@@ -589,14 +601,14 @@ ProcessPeims(
|
||||
}
|
||||
}
|
||||
|
||||
/** Gather and print global data.
|
||||
*
|
||||
* Strips out incomplete or "Execution Phase" records
|
||||
* Only prints records where Handle is NULL
|
||||
* Increment TIndex for every record, even skipped ones, so that we have an
|
||||
* indication of every measurement record taken.
|
||||
*
|
||||
*
|
||||
/**
|
||||
Gather and print global data.
|
||||
|
||||
Strips out incomplete or "Execution Phase" records
|
||||
Only prints records where Handle is NULL
|
||||
Increment TIndex for every record, even skipped ones, so that we have an
|
||||
indication of every measurement record taken.
|
||||
|
||||
**/
|
||||
VOID
|
||||
ProcessGlobal(
|
||||
@@ -651,20 +663,21 @@ ProcessGlobal(
|
||||
}
|
||||
}
|
||||
|
||||
/** Gather and print cumulative data.
|
||||
*
|
||||
* Traverse the measurement records and:<BR>
|
||||
* For each record with a Token listed in the CumData array:<BR>
|
||||
* - Update the instance count and the total, minimum, and maximum durations.
|
||||
* Finally, print the gathered cumulative statistics.
|
||||
*
|
||||
/**
|
||||
Gather and print cumulative data.
|
||||
|
||||
Traverse the measurement records and:<BR>
|
||||
For each record with a Token listed in the CumData array:<BR>
|
||||
- Update the instance count and the total, minimum, and maximum durations.
|
||||
Finally, print the gathered cumulative statistics.
|
||||
|
||||
**/
|
||||
VOID
|
||||
ProcessCumulative(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
UINT64 avgval; // the computed average duration
|
||||
UINT64 Avgval; // the computed average duration
|
||||
EFI_STRING StringPtr;
|
||||
UINTN TIndex;
|
||||
|
||||
@@ -678,12 +691,12 @@ ProcessCumulative(
|
||||
PrintToken (STRING_TOKEN (STR_DP_DASHES));
|
||||
|
||||
for ( TIndex = 0; TIndex < NumCum; ++TIndex) {
|
||||
avgval = DivU64x32 (CumData[TIndex].Duration, CumData[TIndex].Count);
|
||||
Avgval = DivU64x32 (CumData[TIndex].Duration, CumData[TIndex].Count);
|
||||
PrintToken (STRING_TOKEN (STR_DP_CUMULATIVE_STATS),
|
||||
CumData[TIndex].Name,
|
||||
CumData[TIndex].Count,
|
||||
DurationInMicroSeconds(CumData[TIndex].Duration),
|
||||
DurationInMicroSeconds(avgval),
|
||||
DurationInMicroSeconds(Avgval),
|
||||
DurationInMicroSeconds(CumData[TIndex].MinDur),
|
||||
DurationInMicroSeconds(CumData[TIndex].MaxDur)
|
||||
);
|
||||
|
Reference in New Issue
Block a user