]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PerformancePkg/Dp_App/Dp.c
MdeModulePkg: Process Sys Prep load options in BdsDxe driver.
[mirror_edk2.git] / PerformancePkg / Dp_App / Dp.c
index 755f68833accf2e08b7dd0c0fb2223e0207d5dc0..57144a8fb87467315cf54756a2cab8ed5bdbaabe 100644 (file)
@@ -1,26 +1,26 @@
 /** @file\r
-  Shell application for Displaying Performance Metrics.\r
-  *\r
-  The Dp application reads performance data and presents it in several\r
-  different formats depending upon the needs of the user.  Both\r
-  Trace and Measured Profiling information is processed and presented.\r
-  *\r
-  Dp uses the "PerformanceLib" to read the measurement records.\r
-  The "TimerLib" provides information about the timer, such as frequency,\r
-  beginning, and ending counter values.\r
-  Measurement records contain identifying information (Handle, Token, Module)\r
-  and start and end time values.\r
-  Dp uses this information to group records in different ways.  It also uses\r
-  timer information to calculate elapsed time for each measurement.\r
-  *\r
-  * Copyright (c) 2009 - 2011, 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
+  Shell application for Displaying Performance Metrics.\r
+\r
+  The Dp application reads performance data and presents it in several\r
+  different formats depending upon the needs of the user.  Both\r
+  Trace and Measured Profiling information is processed and presented.\r
+\r
+  Dp uses the "PerformanceLib" to read the measurement records.\r
+  The "TimerLib" provides information about the timer, such as frequency,\r
+  beginning, and ending counter values.\r
+  Measurement records contain identifying information (Handle, Token, Module)\r
+  and start and end time values.\r
+  Dp uses this information to group records in different ways.  It also uses\r
+  timer information to calculate elapsed time for each measurement.\r
\r
+  Copyright (c) 2009 - 2012, 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
 \r
 #include <Library/UefiApplicationEntryPoint.h>\r
 EFI_HII_HANDLE   gHiiHandle;\r
 SHELL_PARAM_ITEM *DpParamList       = NULL;\r
 CHAR16           *mPrintTokenBuffer = NULL;\r
-CHAR16           mGaugeString[DXE_PERFORMANCE_STRING_SIZE];\r
-CHAR16           mUnicodeToken[PERF_TOKEN_LENGTH + 1];\r
+CHAR16           mGaugeString[DP_GAUGE_STRING_LENGTH + 1];\r
+CHAR16           mUnicodeToken[DXE_PERFORMANCE_STRING_SIZE];\r
 UINT64           mInterestThreshold;\r
+BOOLEAN          mShowId = FALSE;\r
 \r
 PERF_SUMMARY_DATA SummaryData = { 0 };    ///< Create the SummaryData structure and init. to ZERO.\r
 \r
@@ -79,28 +80,13 @@ PARAM_ITEM_LIST  ParamList[] = {
   {STRING_TOKEN (STR_DP_OPTION_UT), TypeFlag},   // -T   Dump Trace Data\r
 #endif\r
   {STRING_TOKEN (STR_DP_OPTION_LX), TypeFlag},   // -x   eXclude Cumulative Items\r
+  {STRING_TOKEN (STR_DP_OPTION_LI), TypeFlag},   // -i   Display Identifier\r
   {STRING_TOKEN (STR_DP_OPTION_LN), TypeValue},  // -n # Number of records to display for A and R\r
   {STRING_TOKEN (STR_DP_OPTION_LT), TypeValue}   // -t # Threshold of interest\r
   };\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
-  if (Buffer != NULL) {\r
-    FreePool (Buffer);\r
-  }\r
-}\r
-\r
 /**\r
   Transfer the param list value and get the command line parse.\r
 \r
@@ -151,6 +137,7 @@ ShowHelp( void )
 #endif // PROFILING_IMPLEMENTED\r
   PrintToken (STRING_TOKEN (STR_DP_HELP_THRESHOLD));\r
   PrintToken (STRING_TOKEN (STR_DP_HELP_COUNT));\r
+  PrintToken (STRING_TOKEN (STR_DP_HELP_ID));\r
   PrintToken (STRING_TOKEN (STR_DP_HELP_HELP));\r
   Print(L"\n");\r
 }\r
@@ -230,6 +217,7 @@ InitializeDp (
   EFI_STRING                StringDpOptionLx;\r
   EFI_STRING                StringDpOptionLn;\r
   EFI_STRING                StringDpOptionLt;\r
+  EFI_STRING                StringDpOptionLi;\r
   \r
   SummaryMode     = FALSE;\r
   VerboseMode     = FALSE;\r
@@ -252,6 +240,7 @@ InitializeDp (
   StringDpOptionLx = NULL;\r
   StringDpOptionLn = NULL;\r
   StringDpOptionLt = NULL;\r
+  StringDpOptionLi = NULL;\r
   StringPtr        = NULL;\r
 \r
   // Get DP's entry time as soon as possible.\r
@@ -299,6 +288,7 @@ InitializeDp (
       StringDpOptionLx = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_OPTION_LX), NULL);\r
       StringDpOptionLn = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_OPTION_LN), NULL);\r
       StringDpOptionLt = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_OPTION_LT), NULL);\r
+      StringDpOptionLi = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_OPTION_LI), NULL);\r
       \r
       // Boolean Options\r
       // \r
@@ -312,6 +302,7 @@ InitializeDp (
       ProfileMode = ShellCommandLineGetFlag (ParamPackage, StringDpOptionUp);\r
 #endif  // PROFILING_IMPLEMENTED\r
       ExcludeMode = ShellCommandLineGetFlag (ParamPackage, StringDpOptionLx);\r
+      mShowId     =  ShellCommandLineGetFlag (ParamPackage, StringDpOptionLi);\r
 \r
       // Options with Values\r
       CmdLineArg  = ShellCommandLineGetValue (ParamPackage, StringDpOptionLn);\r
@@ -463,6 +454,7 @@ InitializeDp (
   SafeFreePool (StringDpOptionLx);\r
   SafeFreePool (StringDpOptionLn);\r
   SafeFreePool (StringDpOptionLt);\r
+  SafeFreePool (StringDpOptionLi);\r
   SafeFreePool (StringPtr);\r
   SafeFreePool (mPrintTokenBuffer);\r
 \r