]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PerformancePkg/Dp_App/DpProfile.c
Move some define code to the uni file. Also fixed some memory leak.
[mirror_edk2.git] / PerformancePkg / Dp_App / DpProfile.c
index 037c6fa064c1b28209f3100c3792cb81ca8062b8..d550760f8397ce18b9f1f5d9a1fbaabcbe47e8af 100644 (file)
 #include "Literals.h"\r
 #include "DpInternal.h"\r
 \r
-/** Gather and print ALL Profiling Records.\r
-  *\r
-  * Displays all "interesting" Profile measurements in order.\r
-  * The number of records displayed is controlled by:\r
-  *   - records with a duration less than mInterestThreshold microseconds are not displayed.\r
-  *   - No more than Limit records are displayed.  A Limit of zero will not limit the output.\r
-  *   - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not\r
-  *     displayed.\r
-  *\r
-  * @pre    The mInterestThreshold global variable is set to the shortest duration to be printed.\r
-  *         The mGaugeString and mUnicodeToken global arrays are used for temporary string storage.\r
-  *         They must not be in use by a calling function.\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
+  Gather and print ALL Profiling Records.\r
+  \r
+  Displays all "interesting" Profile measurements in order.\r
+  The number of records displayed is controlled by:\r
+     - records with a duration less than mInterestThreshold microseconds are not displayed.\r
+     - No more than Limit records are displayed.  A Limit of zero will not limit the output.\r
+     - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not\r
+       displayed.\r
+  \r
+  @pre    The mInterestThreshold global variable is set to the shortest duration to be printed.\r
+           The mGaugeString and mUnicodeToken global arrays are used for temporary string storage.\r
+           They must not be in use by a calling function.\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
 VOID\r
 DumpAllProfile(\r
@@ -53,29 +54,35 @@ DumpAllProfile(
   )\r
 {\r
   EFI_STRING    StringPtr;\r
+  EFI_STRING    StringPtrUnknown;\r
 \r
+  StringPtrUnknown = HiiGetString (gHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL);   \r
   StringPtr = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_SECTION_PROFILE), NULL);\r
+\r
   PrintToken( STRING_TOKEN (STR_DP_SECTION_HEADER),\r
-              (StringPtr == NULL) ? ALit_UNKNOWN: StringPtr);\r
+              (StringPtr == NULL) ? StringPtrUnknown: StringPtr);\r
+  FreePool (StringPtr);\r
+  FreePool (StringPtrUnknown);\r
   return;\r
 }\r
 \r
-/** Gather and print Raw Profile Records.\r
-  *\r
-  * All Profile measurements with a duration greater than or equal to\r
-  * mInterestThreshold are printed without interpretation.\r
-  *\r
-  * The number of records displayed is controlled by:\r
-  *   - records with a duration less than mInterestThreshold microseconds are not displayed.\r
-  *   - No more than Limit records are displayed.  A Limit of zero will not limit the output.\r
-  *   - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not\r
-  *     displayed.\r
-  *\r
-  * @pre    The mInterestThreshold global variable is set to the shortest duration to be printed.\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
+  Gather and print Raw Profile Records.\r
+  \r
+  All Profile measurements with a duration greater than or equal to\r
+  mInterestThreshold are printed without interpretation.\r
+  \r
+  The number of records displayed is controlled by:\r
+     - records with a duration less than mInterestThreshold microseconds are not displayed.\r
+     - No more than Limit records are displayed.  A Limit of zero will not limit the output.\r
+     - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not\r
+       displayed.\r
+  \r
+  @pre    The mInterestThreshold global variable is set to the shortest duration to be printed.\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
 VOID\r
 DumpRawProfile(\r
@@ -84,9 +91,13 @@ DumpRawProfile(
   )\r
 {\r
   EFI_STRING    StringPtr;\r
+  EFI_STRING    StringPtrUnknown;\r
 \r
+  StringPtrUnknown = HiiGetString (gHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL);   \r
   StringPtr = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_SECTION_RAWPROFILE), NULL);\r
   PrintToken( STRING_TOKEN (STR_DP_SECTION_HEADER),\r
-              (StringPtr == NULL) ? ALit_UNKNOWN: StringPtr);\r
+              (StringPtr == NULL) ? StringPtrUnknown: StringPtr);\r
+  FreePool (StringPtr);\r
+  FreePool (StringPtrUnknown);\r
   return;\r
 }\r