]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiDpLib/Dp.c
ShellPkg/UefiDpLib: Fix a DP cumulative data issue
[mirror_edk2.git] / ShellPkg / Library / UefiDpLib / Dp.c
index 82701723c8944a846976fb37474d4bbc6721b11c..62a4e7b57782722c3efe0e618c85692b63456cba 100644 (file)
@@ -14,6 +14,7 @@
   timer information to calculate elapsed time for each measurement.\r
  \r
   Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.\r
+  (C) Copyright 2015 Hewlett Packard Enterprise Development LP<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
@@ -110,7 +111,26 @@ DumpStatistics( void )
   SHELL_FREE_NON_NULL (StringPtrUnknown);\r
 }\r
 \r
-/** \r
+/**\r
+  Initialize the cumulative data.\r
+\r
+**/\r
+VOID\r
+InitCumulativeData (\r
+  VOID\r
+  )\r
+{\r
+  UINTN                             Index;\r
+\r
+  for (Index = 0; Index < NumCum; ++Index) {\r
+    CumData[Index].Count = 0;\r
+    CumData[Index].MinDur = PERF_MAXDUR;\r
+    CumData[Index].MaxDur = 0;\r
+    CumData[Index].Duration = 0;\r
+  }\r
+}\r
+\r
+/**\r
   Dump performance data.\r
   \r
   @param[in]  ImageHandle     The image handle.\r
@@ -218,6 +238,11 @@ ShellCommandRunDp (
 #endif  // PROFILING_IMPLEMENTED\r
   }\r
 \r
+  //\r
+  // Initialize the pre-defined cumulative data.\r
+  //\r
+  InitCumulativeData ();\r
+\r
   //\r
   // Timer specific processing\r
   //\r