/** @file\r
- * Declarations of objects defined internally to the Dp Application.\r
- *\r
- * Declarations of data and functions which are private to the Dp application.\r
- * This file should never be referenced by anything other than components of the\r
- * Dp application. In addition to global data, function declarations for\r
- * DpUtilities.c, DpTrace.c, and DpProfile.c are included here.\r
- *\r
- * Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
- * This program and the accompanying materials\r
- * are licensed and made available under the terms and conditions of the BSD License\r
- * which accompanies this distribution. The full text of the license may be found at\r
- * http://opensource.org/licenses/bsd-license.php\r
- *\r
- * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ Declarations of objects defined internally to the Dp Application.\r
+\r
+ Declarations of data and functions which are private to the Dp application.\r
+ This file should never be referenced by anything other than components of the\r
+ Dp application. In addition to global data, function declarations for\r
+ DpUtilities.c, DpTrace.c, and DpProfile.c are included here.\r
+\r
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
**/\r
#ifndef _DP_INTELNAL_H_\r
#define _DP_INTELNAL_H_\r
+\r
+#define DP_GAUGE_STRING_LENGTH 36\r
+\r
//\r
/// Module-Global Variables\r
///@{\r
extern EFI_HII_HANDLE gHiiHandle;\r
extern CHAR16 *mPrintTokenBuffer;\r
-extern CHAR16 mGaugeString[DXE_PERFORMANCE_STRING_SIZE];\r
-extern CHAR16 mUnicodeToken[PERF_TOKEN_LENGTH + 1];\r
+extern CHAR16 mGaugeString[DP_GAUGE_STRING_LENGTH + 1];\r
+extern CHAR16 mUnicodeToken[DXE_PERFORMANCE_STRING_SIZE];\r
extern UINT64 mInterestThreshold;\r
+extern BOOLEAN mShowId;\r
\r
extern PERF_SUMMARY_DATA SummaryData; ///< Create the SummaryData structure and init. to ZERO.\r
\r
UINT64\r
GetDuration (\r
IN OUT MEASUREMENT_RECORD *Measurement\r
-);\r
+ );\r
\r
/** \r
Determine whether the Measurement record is for an EFI Phase.\r
BOOLEAN\r
IsPhase(\r
IN MEASUREMENT_RECORD *Measurement\r
-);\r
+ );\r
\r
/** \r
Get the file name portion of the Pdb File Name.\r
GetShortPdbFileName (\r
IN CHAR8 *PdbFileName,\r
OUT CHAR16 *UnicodeBuffer\r
-);\r
+ );\r
\r
/** \r
Get a human readable name for an image handle.\r
+ The following methods will be tried orderly:\r
+ 1. Image PDB\r
+ 2. ComponentName2 protocol\r
+ 3. FFS UI section\r
+ 4. Image GUID\r
+ 5. Image DevicePath\r
+ 6. Unknown Driver Name\r
\r
@param[in] Handle\r
\r
VOID\r
GetNameFromHandle (\r
IN EFI_HANDLE Handle\r
-);\r
+ );\r
\r
/** \r
Calculate the Duration in microseconds.\r
UINT64\r
DurationInMicroSeconds (\r
IN UINT64 Duration\r
-);\r
+ );\r
\r
/** \r
Formatted Print using a Hii Token to reference the localized format string.\r
\r
**/\r
UINTN\r
+EFIAPI\r
PrintToken (\r
IN UINT16 Token,\r
...\r
-);\r
+ );\r
\r
/** \r
Get index of Measurement Record's match in the CumData array.\r
INTN\r
GetCumulativeItem(\r
IN MEASUREMENT_RECORD *Measurement\r
-);\r
+ );\r
\r
/** \r
Collect verbose statistics about the logged performance measurements.\r
VOID\r
GatherStatistics(\r
VOID\r
-);\r
+ );\r
\r
/** \r
Gather and print ALL Trace Records.\r
DumpAllTrace(\r
IN UINTN Limit,\r
IN BOOLEAN ExcludeFlag\r
-);\r
+ );\r
\r
/** \r
Gather and print Raw Trace Records.\r
DumpRawTrace(\r
IN UINTN Limit,\r
IN BOOLEAN ExcludeFlag\r
-);\r
+ );\r
\r
/** \r
Gather and print Major Phase metrics.\r
VOID\r
ProcessPhases(\r
IN UINT64 Ticker\r
-);\r
+ );\r
\r
\r
/** \r
EFI_STATUS\r
ProcessHandles(\r
IN BOOLEAN ExcludeFlag\r
-);\r
+ );\r
\r
\r
/** \r
VOID\r
ProcessPeims(\r
VOID\r
-);\r
+ );\r
\r
/** \r
Gather and print global data.\r
VOID\r
ProcessGlobal(\r
VOID\r
-);\r
+ );\r
\r
/** \r
Gather and print cumulative data.\r
VOID\r
ProcessCumulative(\r
VOID\r
-);\r
+ );\r
\r
/** \r
Gather and print ALL Profiling Records.\r
DumpAllProfile(\r
IN UINTN Limit,\r
IN BOOLEAN ExcludeFlag\r
-);\r
+ );\r
\r
/** \r
Gather and print Raw Profile Records.\r
DumpRawProfile(\r
IN UINTN Limit,\r
IN BOOLEAN ExcludeFlag\r
-);\r
+ );\r
+\r
+/**\r
+ Wrap original FreePool to check NULL pointer first.\r
+\r
+ @param[in] Buffer The pointer to the buffer to free.\r
+\r
+**/\r
+VOID\r
+SafeFreePool (\r
+ IN VOID *Buffer\r
+ );\r
+\r
#endif\r