]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PerformancePkg/Dp_App/DpTrace.c
minor format update
[mirror_edk2.git] / PerformancePkg / Dp_App / DpTrace.c
index 5038473c077c1f15a27aea4dd1e02a726d895dac..f4cdb88aafff218e1de757553224ad23222da6cd 100644 (file)
@@ -327,7 +327,7 @@ DumpRawTrace(
 **/\r
 VOID\r
 ProcessPhases(\r
-  UINT64            Ticker\r
+  IN UINT64            Ticker\r
   )\r
 {\r
   MEASUREMENT_RECORD        Measurement;\r
@@ -612,11 +612,11 @@ ProcessPeims(
     Duration = GetDuration (&Measurement);\r
     ElapsedTime = DurationInMicroSeconds ( Duration );  // Calculate elapsed time in microseconds\r
     if (ElapsedTime >= mInterestThreshold) {\r
-      GetNameFromHandle ((EFI_HANDLE) Measurement.Handle); // Name placed in mGaugeString\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
             TIndex,   // 1 based, Which measurement record is being printed\r
-            Measurement.Handle,\r
-            mGaugeString,\r
+            Measurement.Handle,  // base address\r
+            Measurement.Handle,  // file guid\r
             ElapsedTime\r
       );\r
     }\r
@@ -703,7 +703,10 @@ ProcessCumulative(
   VOID\r
 )\r
 {\r
-  UINT64                    Avgval;         // the computed average duration\r
+  UINT64                    AvgDur;         // the computed average duration\r
+  UINT64                    Dur;\r
+  UINT64                    MinDur;\r
+  UINT64                    MaxDur;\r
   EFI_STRING                StringPtr;\r
   UINTN                     TIndex;\r
   EFI_STRING                StringPtrUnknown;\r
@@ -720,14 +723,21 @@ ProcessCumulative(
   PrintToken (STRING_TOKEN (STR_DP_DASHES));\r
 \r
   for ( TIndex = 0; TIndex < NumCum; ++TIndex) {\r
-    Avgval = DivU64x32 (CumData[TIndex].Duration, CumData[TIndex].Count);\r
-    PrintToken (STRING_TOKEN (STR_DP_CUMULATIVE_STATS),\r
-                CumData[TIndex].Name,\r
-                CumData[TIndex].Count,\r
-                DurationInMicroSeconds(CumData[TIndex].Duration),\r
-                DurationInMicroSeconds(Avgval),\r
-                DurationInMicroSeconds(CumData[TIndex].MinDur),\r
-                DurationInMicroSeconds(CumData[TIndex].MaxDur)\r
-               );\r
+    if (CumData[TIndex].Count != 0) {\r
+      AvgDur = DivU64x32 (CumData[TIndex].Duration, CumData[TIndex].Count);\r
+      AvgDur = DurationInMicroSeconds(AvgDur);\r
+      Dur    = DurationInMicroSeconds(CumData[TIndex].Duration);\r
+      MaxDur = DurationInMicroSeconds(CumData[TIndex].MaxDur);\r
+      MinDur = DurationInMicroSeconds(CumData[TIndex].MinDur);\r
+    \r
+      PrintToken (STRING_TOKEN (STR_DP_CUMULATIVE_STATS),\r
+                  CumData[TIndex].Name,\r
+                  CumData[TIndex].Count,\r
+                  Dur,\r
+                  AvgDur,\r
+                  MinDur,\r
+                  MaxDur\r
+                 );\r
+    }\r
   }\r
 }\r