]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PerformancePkg/Dp_App/Dp.c
MdePkg: add missing #defines for decoding PCIe 2.1 extended capability structures
[mirror_edk2.git] / PerformancePkg / Dp_App / Dp.c
index be4d40301ae1ffa3feeb216b7339874c7e8bba09..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 - 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
+  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,6 +80,7 @@ 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
@@ -135,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
@@ -214,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
@@ -236,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
@@ -283,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
@@ -296,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
@@ -433,23 +440,24 @@ InitializeDp (
     ListIndex ++;\r
   }  \r
   FreePool (DpParamList);\r
-  \r
-  FreePool (StringDpOptionQh);\r
-  FreePool (StringDpOptionLh);\r
-  FreePool (StringDpOptionUh);\r
-  FreePool (StringDpOptionLv);\r
-  FreePool (StringDpOptionUs);\r
-  FreePool (StringDpOptionLs);\r
-  FreePool (StringDpOptionUa);\r
-  FreePool (StringDpOptionUr);\r
-  FreePool (StringDpOptionUt);\r
-  FreePool (StringDpOptionUp);\r
-  FreePool (StringDpOptionLx);\r
-  FreePool (StringDpOptionLn);\r
-  FreePool (StringDpOptionLt);  \r
-  FreePool (StringPtr);\r
-  FreePool (mPrintTokenBuffer);\r
-  \r
+\r
+  SafeFreePool (StringDpOptionQh);\r
+  SafeFreePool (StringDpOptionLh);\r
+  SafeFreePool (StringDpOptionUh);\r
+  SafeFreePool (StringDpOptionLv);\r
+  SafeFreePool (StringDpOptionUs);\r
+  SafeFreePool (StringDpOptionLs);\r
+  SafeFreePool (StringDpOptionUa);\r
+  SafeFreePool (StringDpOptionUr);\r
+  SafeFreePool (StringDpOptionUt);\r
+  SafeFreePool (StringDpOptionUp);\r
+  SafeFreePool (StringDpOptionLx);\r
+  SafeFreePool (StringDpOptionLn);\r
+  SafeFreePool (StringDpOptionLt);\r
+  SafeFreePool (StringDpOptionLi);\r
+  SafeFreePool (StringPtr);\r
+  SafeFreePool (mPrintTokenBuffer);\r
+\r
   HiiRemovePackages (gHiiHandle);\r
   return Status;\r
 }\r