ShellPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the ShellPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
c411b485b6
commit
47d20b54f9
File diff suppressed because it is too large
Load Diff
@ -9,7 +9,6 @@
|
||||
#ifndef _DP_H_
|
||||
#define _DP_H_
|
||||
|
||||
|
||||
#include <Uefi.h>
|
||||
|
||||
#include <Guid/Performance.h>
|
||||
@ -36,32 +35,32 @@
|
||||
#include <Library/UefiHiiServicesLib.h>
|
||||
#include <Library/PerformanceLib.h>
|
||||
|
||||
extern EFI_HII_HANDLE mDpHiiHandle;
|
||||
extern EFI_HII_HANDLE mDpHiiHandle;
|
||||
|
||||
#define DP_MAJOR_VERSION 2
|
||||
#define DP_MINOR_VERSION 5
|
||||
#define DP_MAJOR_VERSION 2
|
||||
#define DP_MINOR_VERSION 5
|
||||
|
||||
/**
|
||||
* The value assigned to DP_DEBUG controls which debug output
|
||||
* is generated. Set it to ZERO to disable.
|
||||
**/
|
||||
#define DP_DEBUG 0
|
||||
#define DP_DEBUG 0
|
||||
|
||||
#define DEFAULT_THRESHOLD 1000 ///< One millisecond.
|
||||
#define DEFAULT_DISPLAYCOUNT 50
|
||||
#define MAXIMUM_DISPLAYCOUNT 999999 ///< Arbitrary maximum reasonable number.
|
||||
#define DEFAULT_THRESHOLD 1000 ///< One millisecond.
|
||||
#define DEFAULT_DISPLAYCOUNT 50
|
||||
#define MAXIMUM_DISPLAYCOUNT 999999 ///< Arbitrary maximum reasonable number.
|
||||
|
||||
#define PERF_MAXDUR 0xFFFFFFFFFFFFFFFFULL
|
||||
#define PERF_MAXDUR 0xFFFFFFFFFFFFFFFFULL
|
||||
|
||||
/// Determine whether 0 <= C < L. If L == 0, return true regardless of C.
|
||||
#define WITHIN_LIMIT( C, L) ( ((L) == 0) || ((C) < (L)) )
|
||||
#define WITHIN_LIMIT(C, L) ( ((L) == 0) || ((C) < (L)) )
|
||||
|
||||
/// Structure for storing Timer specific information.
|
||||
typedef struct {
|
||||
UINT64 StartCount; ///< Value timer is initialized with.
|
||||
UINT64 EndCount; ///< Value timer has just before it wraps.
|
||||
UINT32 Frequency; ///< Timer count frequency in KHz.
|
||||
BOOLEAN CountUp; ///< TRUE if the counter counts up.
|
||||
UINT64 StartCount; ///< Value timer is initialized with.
|
||||
UINT64 EndCount; ///< Value timer has just before it wraps.
|
||||
UINT32 Frequency; ///< Timer count frequency in KHz.
|
||||
BOOLEAN CountUp; ///< TRUE if the counter counts up.
|
||||
} TIMER_INFO;
|
||||
|
||||
/** Initialize one PERF_CUM_DATA structure instance for token t.
|
||||
@ -73,40 +72,40 @@ typedef struct {
|
||||
* - PERF_INIT_CUM_DATA(pointer) A pointer -- CHAR8 *pointer;
|
||||
* - PERF_INIT_CUM_DATA(array) Address of an array -- CHAR8 array[N];
|
||||
**/
|
||||
#define PERF_INIT_CUM_DATA(t) { 0ULL, PERF_MAXDUR, 0ULL, (t), 0U }
|
||||
#define PERF_INIT_CUM_DATA(t) { 0ULL, PERF_MAXDUR, 0ULL, (t), 0U }
|
||||
|
||||
typedef struct {
|
||||
UINT64 Duration; ///< Cumulative duration for this item.
|
||||
UINT64 MinDur; ///< Smallest duration encountered.
|
||||
UINT64 MaxDur; ///< Largest duration encountered.
|
||||
CHAR8 *Name; ///< ASCII name of this item.
|
||||
UINT32 Count; ///< Total number of measurements accumulated.
|
||||
UINT64 Duration; ///< Cumulative duration for this item.
|
||||
UINT64 MinDur; ///< Smallest duration encountered.
|
||||
UINT64 MaxDur; ///< Largest duration encountered.
|
||||
CHAR8 *Name; ///< ASCII name of this item.
|
||||
UINT32 Count; ///< Total number of measurements accumulated.
|
||||
} PERF_CUM_DATA;
|
||||
|
||||
typedef struct {
|
||||
UINT32 NumTrace; ///< Number of recorded TRACE performance measurements.
|
||||
UINT32 NumIncomplete; ///< Number of measurements with no END value.
|
||||
UINT32 NumSummary; ///< Number of summary section measurements.
|
||||
UINT32 NumHandles; ///< Number of measurements with handles.
|
||||
UINT32 NumPEIMs; ///< Number of measurements of PEIMs.
|
||||
UINT32 NumGlobal; ///< Number of measurements with END value and NULL handle.
|
||||
UINT32 NumTrace; ///< Number of recorded TRACE performance measurements.
|
||||
UINT32 NumIncomplete; ///< Number of measurements with no END value.
|
||||
UINT32 NumSummary; ///< Number of summary section measurements.
|
||||
UINT32 NumHandles; ///< Number of measurements with handles.
|
||||
UINT32 NumPEIMs; ///< Number of measurements of PEIMs.
|
||||
UINT32 NumGlobal; ///< Number of measurements with END value and NULL handle.
|
||||
} PERF_SUMMARY_DATA;
|
||||
|
||||
typedef struct {
|
||||
CONST VOID *Handle;
|
||||
CONST CHAR8 *Token; ///< Measured token string name.
|
||||
CONST CHAR8 *Module; ///< Module string name.
|
||||
UINT64 StartTimeStamp; ///< Start time point.
|
||||
UINT64 EndTimeStamp; ///< End time point.
|
||||
UINT32 Identifier; ///< Identifier.
|
||||
CONST VOID *Handle;
|
||||
CONST CHAR8 *Token; ///< Measured token string name.
|
||||
CONST CHAR8 *Module; ///< Module string name.
|
||||
UINT64 StartTimeStamp; ///< Start time point.
|
||||
UINT64 EndTimeStamp; ///< End time point.
|
||||
UINT32 Identifier; ///< Identifier.
|
||||
} MEASUREMENT_RECORD;
|
||||
|
||||
typedef struct {
|
||||
CHAR8 *Name; ///< Measured token string name.
|
||||
UINT64 CumulativeTime; ///< Accumulated Elapsed Time.
|
||||
UINT64 MinTime; ///< Minimum Elapsed Time.
|
||||
UINT64 MaxTime; ///< Maximum Elapsed Time.
|
||||
UINT32 Count; ///< Number of measurements accumulated.
|
||||
CHAR8 *Name; ///< Measured token string name.
|
||||
UINT64 CumulativeTime; ///< Accumulated Elapsed Time.
|
||||
UINT64 MinTime; ///< Minimum Elapsed Time.
|
||||
UINT64 MaxTime; ///< Maximum Elapsed Time.
|
||||
UINT32 Count; ///< Number of measurements accumulated.
|
||||
} PROFILE_RECORD;
|
||||
|
||||
/**
|
||||
@ -122,8 +121,8 @@ typedef struct {
|
||||
**/
|
||||
SHELL_STATUS
|
||||
RunDp (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
);
|
||||
|
||||
/**
|
||||
@ -135,6 +134,7 @@ RunDp (
|
||||
**/
|
||||
EFI_HII_HANDLE
|
||||
InitializeHiiPackage (
|
||||
EFI_HANDLE ImageHandle
|
||||
EFI_HANDLE ImageHandle
|
||||
);
|
||||
#endif // _DP_H_
|
||||
|
||||
#endif // _DP_H_
|
||||
|
@ -16,7 +16,7 @@
|
||||
// the resource section. Thus the application can use '-?' option to show help message in
|
||||
// Shell.
|
||||
//
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringHelpTokenId = STRING_TOKEN (STR_GET_HELP_DP);
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringHelpTokenId = STRING_TOKEN (STR_GET_HELP_DP);
|
||||
|
||||
/**
|
||||
Entry point of Tftp standalone application.
|
||||
@ -31,11 +31,12 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringHelpTokenId = STRING_TOKEN (S
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DpAppInitialize (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
mDpHiiHandle = InitializeHiiPackage (ImageHandle);
|
||||
if (mDpHiiHandle == NULL) {
|
||||
return EFI_ABORTED;
|
||||
|
@ -25,10 +25,10 @@
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
DpCommandHandler (
|
||||
IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable,
|
||||
IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
|
||||
IN EFI_SHELL_PROTOCOL *Shell
|
||||
IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable,
|
||||
IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
|
||||
IN EFI_SHELL_PROTOCOL *Shell
|
||||
)
|
||||
{
|
||||
gEfiShellParametersProtocol = ShellParameters;
|
||||
@ -49,14 +49,14 @@ DpCommandHandler (
|
||||
CHAR16 *
|
||||
EFIAPI
|
||||
DpCommandGetHelp (
|
||||
IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
|
||||
IN CONST CHAR8 *Language
|
||||
IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
|
||||
IN CONST CHAR8 *Language
|
||||
)
|
||||
{
|
||||
return HiiGetString (mDpHiiHandle, STRING_TOKEN (STR_GET_HELP_DP), Language);
|
||||
}
|
||||
|
||||
EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL mDpDynamicCommand = {
|
||||
EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL mDpDynamicCommand = {
|
||||
L"dp",
|
||||
DpCommandHandler,
|
||||
DpCommandGetHelp
|
||||
@ -77,11 +77,12 @@ EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL mDpDynamicCommand = {
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DpCommandInitialize (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
mDpHiiHandle = InitializeHiiPackage (ImageHandle);
|
||||
if (mDpHiiHandle == NULL) {
|
||||
return EFI_ABORTED;
|
||||
@ -108,10 +109,11 @@ DpCommandInitialize (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DpUnload (
|
||||
IN EFI_HANDLE ImageHandle
|
||||
)
|
||||
IN EFI_HANDLE ImageHandle
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = gBS->UninstallProtocolInterface (
|
||||
ImageHandle,
|
||||
&gEfiShellDynamicCommandProtocolGuid,
|
||||
@ -120,6 +122,7 @@ DpUnload (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
HiiRemovePackages (mDpHiiHandle);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
@ -10,31 +10,32 @@
|
||||
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
**/
|
||||
|
||||
#ifndef _DP_INTELNAL_H_
|
||||
#define _DP_INTELNAL_H_
|
||||
|
||||
#define DP_GAUGE_STRING_LENGTH 36
|
||||
#define DP_GAUGE_STRING_LENGTH 36
|
||||
|
||||
//
|
||||
/// Module-Global Variables
|
||||
///@{
|
||||
extern EFI_HII_HANDLE mDpHiiHandle;
|
||||
extern CHAR16 mGaugeString[DP_GAUGE_STRING_LENGTH + 1];
|
||||
extern CHAR16 mUnicodeToken[DXE_PERFORMANCE_STRING_SIZE];
|
||||
extern UINT64 mInterestThreshold;
|
||||
extern BOOLEAN mShowId;
|
||||
extern UINT8 *mBootPerformanceTable;
|
||||
extern UINTN mBootPerformanceTableLength;
|
||||
extern MEASUREMENT_RECORD *mMeasurementList;
|
||||
extern UINTN mMeasurementNum;
|
||||
extern EFI_HII_HANDLE mDpHiiHandle;
|
||||
extern CHAR16 mGaugeString[DP_GAUGE_STRING_LENGTH + 1];
|
||||
extern CHAR16 mUnicodeToken[DXE_PERFORMANCE_STRING_SIZE];
|
||||
extern UINT64 mInterestThreshold;
|
||||
extern BOOLEAN mShowId;
|
||||
extern UINT8 *mBootPerformanceTable;
|
||||
extern UINTN mBootPerformanceTableLength;
|
||||
extern MEASUREMENT_RECORD *mMeasurementList;
|
||||
extern UINTN mMeasurementNum;
|
||||
|
||||
extern PERF_SUMMARY_DATA SummaryData; ///< Create the SummaryData structure and init. to ZERO.
|
||||
|
||||
/// Items for which to gather cumulative statistics.
|
||||
extern PERF_CUM_DATA CumData[];
|
||||
extern PERF_CUM_DATA CumData[];
|
||||
|
||||
/// Number of items for which we are gathering cumulative statistics.
|
||||
extern UINT32 const NumCum;
|
||||
extern UINT32 const NumCum;
|
||||
|
||||
///@}
|
||||
|
||||
@ -60,7 +61,7 @@ extern UINT32 const NumCum;
|
||||
**/
|
||||
UINT64
|
||||
GetDuration (
|
||||
IN OUT MEASUREMENT_RECORD *Measurement
|
||||
IN OUT MEASUREMENT_RECORD *Measurement
|
||||
);
|
||||
|
||||
/**
|
||||
@ -75,8 +76,8 @@ GetDuration (
|
||||
@retval FALSE The measurement record is NOT for an EFI Phase.
|
||||
**/
|
||||
BOOLEAN
|
||||
IsPhase(
|
||||
IN MEASUREMENT_RECORD *Measurement
|
||||
IsPhase (
|
||||
IN MEASUREMENT_RECORD *Measurement
|
||||
);
|
||||
|
||||
/**
|
||||
@ -89,8 +90,8 @@ IsPhase(
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsCorePerf(
|
||||
IN MEASUREMENT_RECORD *Measurement
|
||||
IsCorePerf (
|
||||
IN MEASUREMENT_RECORD *Measurement
|
||||
);
|
||||
|
||||
/**
|
||||
@ -107,8 +108,8 @@ IsCorePerf(
|
||||
**/
|
||||
VOID
|
||||
DpGetShortPdbFileName (
|
||||
IN CHAR8 *PdbFileName,
|
||||
OUT CHAR16 *UnicodeBuffer
|
||||
IN CHAR8 *PdbFileName,
|
||||
OUT CHAR16 *UnicodeBuffer
|
||||
);
|
||||
|
||||
/**
|
||||
@ -129,7 +130,7 @@ DpGetShortPdbFileName (
|
||||
**/
|
||||
VOID
|
||||
DpGetNameFromHandle (
|
||||
IN EFI_HANDLE Handle
|
||||
IN EFI_HANDLE Handle
|
||||
);
|
||||
|
||||
/**
|
||||
@ -147,7 +148,7 @@ DpGetNameFromHandle (
|
||||
**/
|
||||
UINT64
|
||||
DurationInMicroSeconds (
|
||||
IN UINT64 Duration
|
||||
IN UINT64 Duration
|
||||
);
|
||||
|
||||
/**
|
||||
@ -164,8 +165,8 @@ DurationInMicroSeconds (
|
||||
@retval >=0 Return value is the index into CumData where Token is found.
|
||||
**/
|
||||
INTN
|
||||
GetCumulativeItem(
|
||||
IN MEASUREMENT_RECORD *Measurement
|
||||
GetCumulativeItem (
|
||||
IN MEASUREMENT_RECORD *Measurement
|
||||
);
|
||||
|
||||
/**
|
||||
@ -186,8 +187,8 @@ GetCumulativeItem(
|
||||
|
||||
**/
|
||||
VOID
|
||||
GatherStatistics(
|
||||
IN OUT PERF_CUM_DATA *CustomCumulativeData OPTIONAL
|
||||
GatherStatistics (
|
||||
IN OUT PERF_CUM_DATA *CustomCumulativeData OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
@ -212,9 +213,9 @@ GatherStatistics(
|
||||
@return Others from a call to gBS->LocateHandleBuffer().
|
||||
**/
|
||||
EFI_STATUS
|
||||
DumpAllTrace(
|
||||
IN UINTN Limit,
|
||||
IN BOOLEAN ExcludeFlag
|
||||
DumpAllTrace (
|
||||
IN UINTN Limit,
|
||||
IN BOOLEAN ExcludeFlag
|
||||
);
|
||||
|
||||
/**
|
||||
@ -237,9 +238,9 @@ DumpAllTrace(
|
||||
@retval EFI_ABORTED The user aborts the operation.
|
||||
**/
|
||||
EFI_STATUS
|
||||
DumpRawTrace(
|
||||
IN UINTN Limit,
|
||||
IN BOOLEAN ExcludeFlag
|
||||
DumpRawTrace (
|
||||
IN UINTN Limit,
|
||||
IN BOOLEAN ExcludeFlag
|
||||
);
|
||||
|
||||
/**
|
||||
@ -247,11 +248,10 @@ DumpRawTrace(
|
||||
|
||||
**/
|
||||
VOID
|
||||
ProcessPhases(
|
||||
ProcessPhases (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Gather and print Handle data.
|
||||
|
||||
@ -262,11 +262,10 @@ ProcessPhases(
|
||||
@return Others from a call to gBS->LocateHandleBuffer().
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProcessHandles(
|
||||
IN BOOLEAN ExcludeFlag
|
||||
ProcessHandles (
|
||||
IN BOOLEAN ExcludeFlag
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Gather and print PEIM data.
|
||||
|
||||
@ -276,7 +275,7 @@ ProcessHandles(
|
||||
@retval EFI_ABORTED The user aborts the operation.
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProcessPeims(
|
||||
ProcessPeims (
|
||||
VOID
|
||||
);
|
||||
|
||||
@ -292,7 +291,7 @@ ProcessPeims(
|
||||
@retval EFI_ABORTED The user aborts the operation.
|
||||
**/
|
||||
EFI_STATUS
|
||||
ProcessGlobal(
|
||||
ProcessGlobal (
|
||||
VOID
|
||||
);
|
||||
|
||||
@ -308,8 +307,8 @@ ProcessGlobal(
|
||||
|
||||
**/
|
||||
VOID
|
||||
ProcessCumulative(
|
||||
IN PERF_CUM_DATA *CustomCumulativeData OPTIONAL
|
||||
ProcessCumulative (
|
||||
IN PERF_CUM_DATA *CustomCumulativeData OPTIONAL
|
||||
);
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -55,23 +55,24 @@
|
||||
**/
|
||||
UINT64
|
||||
GetDuration (
|
||||
IN OUT MEASUREMENT_RECORD *Measurement
|
||||
IN OUT MEASUREMENT_RECORD *Measurement
|
||||
)
|
||||
{
|
||||
UINT64 Duration;
|
||||
BOOLEAN Error;
|
||||
UINT64 Duration;
|
||||
BOOLEAN Error;
|
||||
|
||||
if (Measurement->EndTimeStamp == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Duration = Measurement->EndTimeStamp - Measurement->StartTimeStamp;
|
||||
Error = (BOOLEAN)(Duration > Measurement->EndTimeStamp);
|
||||
Error = (BOOLEAN)(Duration > Measurement->EndTimeStamp);
|
||||
|
||||
if (Error) {
|
||||
DEBUG ((DEBUG_ERROR, ALit_TimerLibError));
|
||||
Duration = 0;
|
||||
}
|
||||
|
||||
return Duration;
|
||||
}
|
||||
|
||||
@ -87,18 +88,18 @@ GetDuration (
|
||||
@retval FALSE The measurement record is NOT for an EFI Phase.
|
||||
**/
|
||||
BOOLEAN
|
||||
IsPhase(
|
||||
IN MEASUREMENT_RECORD *Measurement
|
||||
IsPhase (
|
||||
IN MEASUREMENT_RECORD *Measurement
|
||||
)
|
||||
{
|
||||
BOOLEAN RetVal;
|
||||
BOOLEAN RetVal;
|
||||
|
||||
RetVal = (BOOLEAN)(
|
||||
((AsciiStrCmp (Measurement->Token, ALit_SEC) == 0) ||
|
||||
(AsciiStrCmp (Measurement->Token, ALit_PEI) == 0) ||
|
||||
(AsciiStrCmp (Measurement->Token, ALit_DXE) == 0) ||
|
||||
(AsciiStrCmp (Measurement->Token, ALit_BDS) == 0))
|
||||
);
|
||||
((AsciiStrCmp (Measurement->Token, ALit_SEC) == 0) ||
|
||||
(AsciiStrCmp (Measurement->Token, ALit_PEI) == 0) ||
|
||||
(AsciiStrCmp (Measurement->Token, ALit_DXE) == 0) ||
|
||||
(AsciiStrCmp (Measurement->Token, ALit_BDS) == 0))
|
||||
);
|
||||
return RetVal;
|
||||
}
|
||||
|
||||
@ -112,24 +113,24 @@ IsPhase(
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsCorePerf(
|
||||
IN MEASUREMENT_RECORD *Measurement
|
||||
IsCorePerf (
|
||||
IN MEASUREMENT_RECORD *Measurement
|
||||
)
|
||||
{
|
||||
BOOLEAN RetVal;
|
||||
BOOLEAN RetVal;
|
||||
|
||||
RetVal = (BOOLEAN)(
|
||||
((Measurement->Identifier == MODULE_START_ID) ||
|
||||
(Measurement->Identifier == MODULE_END_ID) ||
|
||||
(Measurement->Identifier == MODULE_LOADIMAGE_START_ID) ||
|
||||
(Measurement->Identifier == MODULE_LOADIMAGE_END_ID) ||
|
||||
(Measurement->Identifier == MODULE_DB_START_ID) ||
|
||||
(Measurement->Identifier == MODULE_DB_END_ID) ||
|
||||
(Measurement->Identifier == MODULE_DB_SUPPORT_START_ID) ||
|
||||
(Measurement->Identifier == MODULE_DB_SUPPORT_END_ID) ||
|
||||
(Measurement->Identifier == MODULE_DB_STOP_START_ID) ||
|
||||
(Measurement->Identifier == MODULE_DB_STOP_START_ID))
|
||||
);
|
||||
((Measurement->Identifier == MODULE_START_ID) ||
|
||||
(Measurement->Identifier == MODULE_END_ID) ||
|
||||
(Measurement->Identifier == MODULE_LOADIMAGE_START_ID) ||
|
||||
(Measurement->Identifier == MODULE_LOADIMAGE_END_ID) ||
|
||||
(Measurement->Identifier == MODULE_DB_START_ID) ||
|
||||
(Measurement->Identifier == MODULE_DB_END_ID) ||
|
||||
(Measurement->Identifier == MODULE_DB_SUPPORT_START_ID) ||
|
||||
(Measurement->Identifier == MODULE_DB_SUPPORT_END_ID) ||
|
||||
(Measurement->Identifier == MODULE_DB_STOP_START_ID) ||
|
||||
(Measurement->Identifier == MODULE_DB_STOP_START_ID))
|
||||
);
|
||||
return RetVal;
|
||||
}
|
||||
|
||||
@ -147,14 +148,14 @@ IsCorePerf(
|
||||
**/
|
||||
VOID
|
||||
DpGetShortPdbFileName (
|
||||
IN CHAR8 *PdbFileName,
|
||||
OUT CHAR16 *UnicodeBuffer
|
||||
IN CHAR8 *PdbFileName,
|
||||
OUT CHAR16 *UnicodeBuffer
|
||||
)
|
||||
{
|
||||
UINTN IndexA; // Current work location within an ASCII string.
|
||||
UINTN IndexU; // Current work location within a Unicode string.
|
||||
UINTN StartIndex;
|
||||
UINTN EndIndex;
|
||||
UINTN IndexA; // Current work location within an ASCII string.
|
||||
UINTN IndexU; // Current work location within a Unicode string.
|
||||
UINTN StartIndex;
|
||||
UINTN EndIndex;
|
||||
|
||||
ZeroMem (UnicodeBuffer, (DP_GAUGE_STRING_LENGTH + 1) * sizeof (CHAR16));
|
||||
|
||||
@ -162,8 +163,9 @@ DpGetShortPdbFileName (
|
||||
StrnCpyS (UnicodeBuffer, DP_GAUGE_STRING_LENGTH + 1, L" ", 1);
|
||||
} else {
|
||||
StartIndex = 0;
|
||||
for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++)
|
||||
;
|
||||
for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++) {
|
||||
}
|
||||
|
||||
for (IndexA = 0; PdbFileName[IndexA] != 0; IndexA++) {
|
||||
if ((PdbFileName[IndexA] == '\\') || (PdbFileName[IndexA] == '/')) {
|
||||
StartIndex = IndexA + 1;
|
||||
@ -176,7 +178,7 @@ DpGetShortPdbFileName (
|
||||
|
||||
IndexU = 0;
|
||||
for (IndexA = StartIndex; IndexA < EndIndex; IndexA++) {
|
||||
UnicodeBuffer[IndexU] = (CHAR16) PdbFileName[IndexA];
|
||||
UnicodeBuffer[IndexU] = (CHAR16)PdbFileName[IndexA];
|
||||
IndexU++;
|
||||
if (IndexU >= DP_GAUGE_STRING_LENGTH) {
|
||||
UnicodeBuffer[DP_GAUGE_STRING_LENGTH] = 0;
|
||||
@ -204,26 +206,26 @@ DpGetShortPdbFileName (
|
||||
**/
|
||||
VOID
|
||||
DpGetNameFromHandle (
|
||||
IN EFI_HANDLE Handle
|
||||
IN EFI_HANDLE Handle
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_LOADED_IMAGE_PROTOCOL *Image;
|
||||
CHAR8 *PdbFileName;
|
||||
EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
|
||||
EFI_STRING StringPtr;
|
||||
EFI_DEVICE_PATH_PROTOCOL *LoadedImageDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
EFI_GUID *NameGuid;
|
||||
CHAR16 *NameString;
|
||||
UINTN StringSize;
|
||||
CHAR8 *PlatformLanguage;
|
||||
CHAR8 *BestLanguage;
|
||||
EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
|
||||
EFI_STATUS Status;
|
||||
EFI_LOADED_IMAGE_PROTOCOL *Image;
|
||||
CHAR8 *PdbFileName;
|
||||
EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
|
||||
EFI_STRING StringPtr;
|
||||
EFI_DEVICE_PATH_PROTOCOL *LoadedImageDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
EFI_GUID *NameGuid;
|
||||
CHAR16 *NameString;
|
||||
UINTN StringSize;
|
||||
CHAR8 *PlatformLanguage;
|
||||
CHAR8 *BestLanguage;
|
||||
EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
|
||||
|
||||
Image = NULL;
|
||||
Image = NULL;
|
||||
LoadedImageDevicePath = NULL;
|
||||
DevicePath = NULL;
|
||||
DevicePath = NULL;
|
||||
|
||||
//
|
||||
// Method 1: Get the name string from image PDB
|
||||
@ -231,14 +233,14 @@ DpGetNameFromHandle (
|
||||
Status = gBS->HandleProtocol (
|
||||
Handle,
|
||||
&gEfiLoadedImageProtocolGuid,
|
||||
(VOID **) &Image
|
||||
(VOID **)&Image
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
Status = gBS->OpenProtocol (
|
||||
Handle,
|
||||
&gEfiDriverBindingProtocolGuid,
|
||||
(VOID **) &DriverBinding,
|
||||
(VOID **)&DriverBinding,
|
||||
NULL,
|
||||
NULL,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
@ -247,7 +249,7 @@ DpGetNameFromHandle (
|
||||
Status = gBS->HandleProtocol (
|
||||
DriverBinding->ImageHandle,
|
||||
&gEfiLoadedImageProtocolGuid,
|
||||
(VOID **) &Image
|
||||
(VOID **)&Image
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -267,14 +269,14 @@ DpGetNameFromHandle (
|
||||
Status = gBS->HandleProtocol (
|
||||
Handle,
|
||||
&gEfiComponentName2ProtocolGuid,
|
||||
(VOID **) &ComponentName2
|
||||
(VOID **)&ComponentName2
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// Firstly use platform language setting, secondly use driver's first supported language.
|
||||
//
|
||||
GetVariable2 (L"PlatformLang", &gEfiGlobalVariableGuid, (VOID**)&PlatformLanguage, NULL);
|
||||
BestLanguage = GetBestLanguage(
|
||||
GetVariable2 (L"PlatformLang", &gEfiGlobalVariableGuid, (VOID **)&PlatformLanguage, NULL);
|
||||
BestLanguage = GetBestLanguage (
|
||||
ComponentName2->SupportedLanguages,
|
||||
FALSE,
|
||||
(PlatformLanguage != NULL) ? PlatformLanguage : "",
|
||||
@ -299,7 +301,7 @@ DpGetNameFromHandle (
|
||||
Status = gBS->HandleProtocol (
|
||||
Handle,
|
||||
&gEfiLoadedImageDevicePathProtocolGuid,
|
||||
(VOID **) &LoadedImageDevicePath
|
||||
(VOID **)&LoadedImageDevicePath
|
||||
);
|
||||
if (!EFI_ERROR (Status) && (LoadedImageDevicePath != NULL)) {
|
||||
DevicePath = LoadedImageDevicePath;
|
||||
@ -313,10 +315,11 @@ DpGetNameFromHandle (
|
||||
//
|
||||
NameGuid = NULL;
|
||||
while (!IsDevicePathEndType (DevicePath)) {
|
||||
NameGuid = EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) DevicePath);
|
||||
NameGuid = EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *)DevicePath);
|
||||
if (NameGuid != NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
DevicePath = NextDevicePathNode (DevicePath);
|
||||
}
|
||||
|
||||
@ -326,13 +329,13 @@ DpGetNameFromHandle (
|
||||
//
|
||||
NameString = NULL;
|
||||
StringSize = 0;
|
||||
Status = GetSectionFromAnyFv (
|
||||
NameGuid,
|
||||
EFI_SECTION_USER_INTERFACE,
|
||||
0,
|
||||
(VOID **) &NameString,
|
||||
&StringSize
|
||||
);
|
||||
Status = GetSectionFromAnyFv (
|
||||
NameGuid,
|
||||
EFI_SECTION_USER_INTERFACE,
|
||||
0,
|
||||
(VOID **)&NameString,
|
||||
&StringSize
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
@ -347,6 +350,7 @@ DpGetNameFromHandle (
|
||||
//
|
||||
UnicodeSPrint (mGaugeString, sizeof (mGaugeString), L"%g", NameGuid);
|
||||
}
|
||||
|
||||
return;
|
||||
} else {
|
||||
//
|
||||
@ -386,7 +390,7 @@ DpGetNameFromHandle (
|
||||
**/
|
||||
UINT64
|
||||
DurationInMicroSeconds (
|
||||
IN UINT64 Duration
|
||||
IN UINT64 Duration
|
||||
)
|
||||
{
|
||||
return DivU64x32 (Duration, 1000);
|
||||
@ -406,17 +410,18 @@ DurationInMicroSeconds (
|
||||
@retval >=0 Return value is the index into CumData where Token is found.
|
||||
**/
|
||||
INTN
|
||||
GetCumulativeItem(
|
||||
IN MEASUREMENT_RECORD *Measurement
|
||||
GetCumulativeItem (
|
||||
IN MEASUREMENT_RECORD *Measurement
|
||||
)
|
||||
{
|
||||
INTN Index;
|
||||
INTN Index;
|
||||
|
||||
for( Index = 0; Index < (INTN)NumCum; ++Index) {
|
||||
for ( Index = 0; Index < (INTN)NumCum; ++Index) {
|
||||
if (AsciiStrCmp (Measurement->Token, CumData[Index].Name) == 0) {
|
||||
return Index; // Exit, we found a match
|
||||
}
|
||||
}
|
||||
|
||||
// If the for loop exits, Token was not found.
|
||||
return -1; // Indicate failure
|
||||
}
|
||||
|
@ -7,16 +7,16 @@
|
||||
#include <Guid/ExtendedFirmwarePerformance.h>
|
||||
|
||||
// ASCII String literals which probably don't need translation
|
||||
CHAR8 const ALit_TimerLibError[] = "Timer library instance error!\n";
|
||||
CHAR8 const ALit_SEC[] = SEC_TOK;
|
||||
CHAR8 const ALit_DXE[] = DXE_TOK;
|
||||
CHAR8 const ALit_PEI[] = PEI_TOK;
|
||||
CHAR8 const ALit_BDS[] = BDS_TOK;
|
||||
CHAR8 const ALit_START_IMAGE[] = START_IMAGE_TOK;
|
||||
CHAR8 const ALit_LOAD_IMAGE[] = LOAD_IMAGE_TOK;
|
||||
CHAR8 const ALit_DB_START[] = DRIVERBINDING_START_TOK;
|
||||
CHAR8 const ALit_DB_SUPPORT[] = DRIVERBINDING_SUPPORT_TOK;
|
||||
CHAR8 const ALit_DB_STOP[] = DRIVERBINDING_STOP_TOK;
|
||||
CHAR8 const ALit_TimerLibError[] = "Timer library instance error!\n";
|
||||
CHAR8 const ALit_SEC[] = SEC_TOK;
|
||||
CHAR8 const ALit_DXE[] = DXE_TOK;
|
||||
CHAR8 const ALit_PEI[] = PEI_TOK;
|
||||
CHAR8 const ALit_BDS[] = BDS_TOK;
|
||||
CHAR8 const ALit_START_IMAGE[] = START_IMAGE_TOK;
|
||||
CHAR8 const ALit_LOAD_IMAGE[] = LOAD_IMAGE_TOK;
|
||||
CHAR8 const ALit_DB_START[] = DRIVERBINDING_START_TOK;
|
||||
CHAR8 const ALit_DB_SUPPORT[] = DRIVERBINDING_SUPPORT_TOK;
|
||||
CHAR8 const ALit_DB_STOP[] = DRIVERBINDING_STOP_TOK;
|
||||
|
||||
CHAR8 const ALit_BdsTO[] = "BdsTimeOut";
|
||||
CHAR8 const ALit_PEIM[] = "PEIM";
|
||||
CHAR8 const ALit_BdsTO[] = "BdsTimeOut";
|
||||
CHAR8 const ALit_PEIM[] = "PEIM";
|
||||
|
@ -4,23 +4,24 @@
|
||||
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
**/
|
||||
|
||||
#ifndef _LITERALS_H_
|
||||
#define _LITERALS_H_
|
||||
|
||||
// ASCII String literals which probably don't need translation
|
||||
extern CHAR8 const ALit_TimerLibError[];
|
||||
extern CHAR8 const ALit_SEC[];
|
||||
extern CHAR8 const ALit_DXE[];
|
||||
extern CHAR8 const ALit_SHELL[];
|
||||
extern CHAR8 const ALit_PEI[];
|
||||
extern CHAR8 const ALit_BDS[];
|
||||
extern CHAR8 const ALit_PEIM[];
|
||||
extern CHAR8 const ALit_START_IMAGE[];
|
||||
extern CHAR8 const ALit_LOAD_IMAGE[];
|
||||
extern CHAR8 const ALit_DB_START[];
|
||||
extern CHAR8 const ALit_DB_SUPPORT[];
|
||||
extern CHAR8 const ALit_DB_STOP[];
|
||||
extern CHAR8 const ALit_BdsTO[];
|
||||
extern CHAR8 const ALit_PEIM[];
|
||||
extern CHAR8 const ALit_TimerLibError[];
|
||||
extern CHAR8 const ALit_SEC[];
|
||||
extern CHAR8 const ALit_DXE[];
|
||||
extern CHAR8 const ALit_SHELL[];
|
||||
extern CHAR8 const ALit_PEI[];
|
||||
extern CHAR8 const ALit_BDS[];
|
||||
extern CHAR8 const ALit_PEIM[];
|
||||
extern CHAR8 const ALit_START_IMAGE[];
|
||||
extern CHAR8 const ALit_LOAD_IMAGE[];
|
||||
extern CHAR8 const ALit_DB_START[];
|
||||
extern CHAR8 const ALit_DB_SUPPORT[];
|
||||
extern CHAR8 const ALit_DB_STOP[];
|
||||
extern CHAR8 const ALit_BdsTO[];
|
||||
extern CHAR8 const ALit_PEIM[];
|
||||
|
||||
#endif // _LITERALS_H_
|
||||
#endif // _LITERALS_H_
|
||||
|
Reference in New Issue
Block a user