]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PerformancePkg/Dp_App/DpTrace.c
Update DP to get Image name with the following methods orderly.
[mirror_edk2.git] / PerformancePkg / Dp_App / DpTrace.c
index f4cdb88aafff218e1de757553224ad23222da6cd..1f627e1f84455f1e7ed68c5742ae92a978feab68 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   * Trace reporting for the Dp utility.\r
   *\r
-  * Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\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
@@ -197,14 +197,11 @@ DumpAllTrace(
       else {\r
         IncFlag = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_INCOMPLETE), NULL);  // Mark incomplete records\r
       }\r
-      if ((ElapsedTime < mInterestThreshold)                 ||\r
+      if (((Measurement.EndTimeStamp != 0) && (ElapsedTime < mInterestThreshold)) ||\r
           ((ExcludeFlag) && (GetCumulativeItem(&Measurement) >= 0))\r
          ) {      // Ignore "uninteresting" or excluded records\r
         continue;\r
       }\r
-      if (Measurement.EndTimeStamp == 0) {\r
-        ElapsedTime = Measurement.StartTimeStamp;\r
-      }\r
       ++Count;    // Count the number of records printed\r
 \r
       // If Handle is non-zero, see if we can determine a name for the driver\r
@@ -219,11 +216,16 @@ DumpAllTrace(
           }\r
         }\r
       }\r
+\r
+      if (AsciiStrnCmp (Measurement.Token, ALit_PEIM, PERF_TOKEN_LENGTH) == 0) {\r
+        UnicodeSPrint (mGaugeString, sizeof (mGaugeString), L"%g", Measurement.Handle);\r
+      }\r
+\r
       // Ensure that the argument strings are not too long.\r
-      mGaugeString[31] = 0;\r
-      mUnicodeToken[18] = 0;\r
+      mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;\r
+      mUnicodeToken[13] = 0;\r
 \r
-      PrintToken( STRING_TOKEN (STR_DP_ALL_STATS),\r
+      PrintToken( STRING_TOKEN (STR_DP_ALL_VARS),\r
         Index,      // 1 based, Which measurement record is being printed\r
         IncFlag,\r
         Measurement.Handle,\r
@@ -510,7 +512,7 @@ ProcessHandles(
     Print (L"There are %,d Handles defined.\n", (Size / sizeof(HandleBuffer[0])));\r
 #endif\r
 \r
-    PrintToken (STRING_TOKEN (STR_DP_HANDLE_GUID) );\r
+    PrintToken (STRING_TOKEN (STR_DP_HANDLE_SECTION) );\r
     PrintToken (STRING_TOKEN (STR_DP_DASHES) );\r
 \r
     LogEntryKey = 0;\r
@@ -543,8 +545,8 @@ ProcessHandles(
         }\r
       }\r
       // Ensure that the argument strings are not too long.\r
-      mGaugeString[31] = 0;\r
-      mUnicodeToken[18] = 0;\r
+      mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;\r
+      mUnicodeToken[11] = 0;\r
       if (mGaugeString[0] != 0) {\r
         // Display the record if it has a valid handle.\r
         PrintToken (\r
@@ -613,7 +615,7 @@ ProcessPeims(
     ElapsedTime = DurationInMicroSeconds ( Duration );  // Calculate elapsed time in microseconds\r
     if (ElapsedTime >= mInterestThreshold) {\r
       // PEIM FILE Handle is the start address of its FFS file that contains its file guid.\r
-      PrintToken (STRING_TOKEN (STR_DP_PEIM_STAT2),\r
+      PrintToken (STRING_TOKEN (STR_DP_PEIM_VARS),\r
             TIndex,   // 1 based, Which measurement record is being printed\r
             Measurement.Handle,  // base address\r
             Measurement.Handle,  // file guid\r
@@ -668,6 +670,8 @@ ProcessGlobal(
   {\r
     AsciiStrToUnicodeStr (Measurement.Module, mGaugeString);\r
     AsciiStrToUnicodeStr (Measurement.Token, mUnicodeToken);\r
+    mGaugeString[26] = 0;\r
+    mUnicodeToken[31] = 0;\r
     if ( ! ( IsPhase( &Measurement)  ||\r
         (Measurement.Handle != NULL)      ||\r
         (Measurement.EndTimeStamp == 0)\r
@@ -677,7 +681,7 @@ ProcessGlobal(
       ElapsedTime = DurationInMicroSeconds ( Duration );\r
       if (ElapsedTime >= mInterestThreshold) {\r
         PrintToken (\r
-          STRING_TOKEN (STR_DP_FOUR_VARS_2),\r
+          STRING_TOKEN (STR_DP_GLOBAL_VARS),\r
           Index,\r
           mGaugeString,\r
           mUnicodeToken,\r