]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PerformancePkg/Dp_App/DpInternal.h
BaseTools: Update Python Makefile to include the new added python files
[mirror_edk2.git] / PerformancePkg / Dp_App / DpInternal.h
index d2454060bcbd8ddb5835a752c1e79f9d08636954..1ab36ba7ede9d3ad5c40a47e7dde25f9b232bae1 100644 (file)
@@ -1,30 +1,35 @@
 /** @file\r
 /** @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 - 2017, Intel Corporation. All rights reserved.<BR>\r
+  (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<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
 #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
 //\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 UINT64             mInterestThreshold;\r
+extern BOOLEAN            mShowId;\r
 \r
 extern PERF_SUMMARY_DATA  SummaryData;    ///< Create the SummaryData structure and init. to ZERO.\r
 \r
 \r
 extern PERF_SUMMARY_DATA  SummaryData;    ///< Create the SummaryData structure and init. to ZERO.\r
 \r
@@ -100,6 +105,13 @@ GetShortPdbFileName (
 \r
 /** \r
   Get a human readable name for an image handle.\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
   \r
   @param[in]    Handle\r
   \r
@@ -140,6 +152,7 @@ DurationInMicroSeconds (
   \r
 **/\r
 UINTN\r
   \r
 **/\r
 UINTN\r
+EFIAPI\r
 PrintToken (\r
   IN UINT16 Token,\r
   ...\r
 PrintToken (\r
   IN UINT16 Token,\r
   ...\r
@@ -176,10 +189,13 @@ GetCumulativeItem(
   \r
   @post The SummaryData and CumData structures contain statistics for the\r
         current performance logs.\r
   \r
   @post The SummaryData and CumData structures contain statistics for the\r
         current performance logs.\r
+\r
+  @param[in, out] CustomCumulativeData  The pointer to the custom cumulative data.\r
+\r
 **/\r
 VOID\r
 GatherStatistics(\r
 **/\r
 VOID\r
 GatherStatistics(\r
-  VOID\r
+  IN OUT PERF_CUM_DATA              *CustomCumulativeData OPTIONAL\r
   );\r
 \r
 /** \r
   );\r
 \r
 /** \r
@@ -199,8 +215,11 @@ GatherStatistics(
   @param[in]    Limit       The number of records to print.  Zero is ALL.\r
   @param[in]    ExcludeFlag TRUE to exclude individual Cumulative items from display.\r
   \r
   @param[in]    Limit       The number of records to print.  Zero is ALL.\r
   @param[in]    ExcludeFlag TRUE to exclude individual Cumulative items from display.\r
   \r
+  @retval EFI_SUCCESS           The operation was successful.\r
+  @retval EFI_ABORTED           The user aborts the operation.\r
+  @return Others                from a call to gBS->LocateHandleBuffer().\r
 **/\r
 **/\r
-VOID\r
+EFI_STATUS\r
 DumpAllTrace(\r
   IN UINTN             Limit,\r
   IN BOOLEAN           ExcludeFlag\r
 DumpAllTrace(\r
   IN UINTN             Limit,\r
   IN BOOLEAN           ExcludeFlag\r
@@ -222,9 +241,11 @@ DumpAllTrace(
   \r
   @param[in]    Limit       The number of records to print.  Zero is ALL.\r
   @param[in]    ExcludeFlag TRUE to exclude individual Cumulative items from display.\r
   \r
   @param[in]    Limit       The number of records to print.  Zero is ALL.\r
   @param[in]    ExcludeFlag TRUE to exclude individual Cumulative items from display.\r
-  \r
+\r
+  @retval EFI_SUCCESS           The operation was successful.\r
+  @retval EFI_ABORTED           The user aborts the operation.\r
 **/\r
 **/\r
-VOID\r
+EFI_STATUS\r
 DumpRawTrace(\r
   IN UINTN          Limit,\r
   IN BOOLEAN        ExcludeFlag\r
 DumpRawTrace(\r
   IN UINTN          Limit,\r
   IN BOOLEAN        ExcludeFlag\r
@@ -233,12 +254,10 @@ DumpRawTrace(
 /** \r
   Gather and print Major Phase metrics.\r
   \r
 /** \r
   Gather and print Major Phase metrics.\r
   \r
-  @param[in]    Ticker      The timer value for the END of Shell phase\r
-  \r
 **/\r
 VOID\r
 ProcessPhases(\r
 **/\r
 VOID\r
 ProcessPhases(\r
-  IN UINT64 Ticker\r
+  VOID\r
   );\r
 \r
 \r
   );\r
 \r
 \r
@@ -246,8 +265,10 @@ ProcessPhases(
   Gather and print Handle data.\r
   \r
   @param[in]    ExcludeFlag   TRUE to exclude individual Cumulative items from display.\r
   Gather and print Handle data.\r
   \r
   @param[in]    ExcludeFlag   TRUE to exclude individual Cumulative items from display.\r
-  \r
-  @return       Status from a call to gBS->LocateHandle().\r
+\r
+  @retval EFI_SUCCESS             The operation was successful.\r
+  @retval EFI_ABORTED             The user aborts the operation.\r
+  @return Others                  from a call to gBS->LocateHandleBuffer().\r
 **/\r
 EFI_STATUS\r
 ProcessHandles(\r
 **/\r
 EFI_STATUS\r
 ProcessHandles(\r
@@ -260,8 +281,10 @@ ProcessHandles(
   \r
   Only prints complete PEIM records\r
   \r
   \r
   Only prints complete PEIM records\r
   \r
+  @retval EFI_SUCCESS           The operation was successful.\r
+  @retval EFI_ABORTED           The user aborts the operation.\r
 **/\r
 **/\r
-VOID\r
+EFI_STATUS\r
 ProcessPeims(\r
   VOID\r
   );\r
 ProcessPeims(\r
   VOID\r
   );\r
@@ -274,8 +297,10 @@ ProcessPeims(
   Increment TIndex for every record, even skipped ones, so that we have an\r
   indication of every measurement record taken.\r
   \r
   Increment TIndex for every record, even skipped ones, so that we have an\r
   indication of every measurement record taken.\r
   \r
+  @retval EFI_SUCCESS           The operation was successful.\r
+  @retval EFI_ABORTED           The user aborts the operation.\r
 **/\r
 **/\r
-VOID\r
+EFI_STATUS\r
 ProcessGlobal(\r
   VOID\r
   );\r
 ProcessGlobal(\r
   VOID\r
   );\r
@@ -287,11 +312,13 @@ ProcessGlobal(
   For each record with a Token listed in the CumData array:<BR>\r
      - Update the instance count and the total, minimum, and maximum durations.\r
   Finally, print the gathered cumulative statistics.\r
   For each record with a Token listed in the CumData array:<BR>\r
      - Update the instance count and the total, minimum, and maximum durations.\r
   Finally, print the gathered cumulative statistics.\r
+\r
+  @param[in]    CustomCumulativeData  The pointer to the custom cumulative data.\r
   \r
 **/\r
 VOID\r
 ProcessCumulative(\r
   \r
 **/\r
 VOID\r
 ProcessCumulative(\r
-  VOID\r
+  IN PERF_CUM_DATA                  *CustomCumulativeData OPTIONAL\r
   );\r
 \r
 /** \r
   );\r
 \r
 /** \r
@@ -341,4 +368,16 @@ DumpRawProfile(
   IN UINTN          Limit,\r
   IN BOOLEAN        ExcludeFlag\r
   );\r
   IN UINTN          Limit,\r
   IN BOOLEAN        ExcludeFlag\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
 #endif\r