Revision: 19400
http://sourceforge.net/p/edk2/code/19400
Author: vanjeff
Date: 2015-12-18 07:33:22 +0000 (Fri, 18 Dec 2015)
Log Message:
-----------
ShellPkg/UefiDpLib: Fix a DP cumulative data issue
The value of PERF_CUM_DATA.Count and PERF_CUM_DATA.Duration field
keep cumulating on every execution of dp.
Initialize the CumData at dp's entry point.
(Sync patch r18727 from main trunk.)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
Reviewed-by: Jaben Carsey <[email protected]>
Revision Links:
--------------
http://sourceforge.net/p/edk2/code/18727
Modified Paths:
--------------
branches/UDK2015/ShellPkg/Library/UefiDpLib/Dp.c
Modified: branches/UDK2015/ShellPkg/Library/UefiDpLib/Dp.c
===================================================================
--- branches/UDK2015/ShellPkg/Library/UefiDpLib/Dp.c 2015-12-18 07:32:50 UTC
(rev 19399)
+++ branches/UDK2015/ShellPkg/Library/UefiDpLib/Dp.c 2015-12-18 07:33:22 UTC
(rev 19400)
@@ -14,6 +14,7 @@
timer information to calculate elapsed time for each measurement.
Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
+ (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
which accompanies this distribution. The full text of the license may be
found at
@@ -110,7 +111,26 @@
SHELL_FREE_NON_NULL (StringPtrUnknown);
}
-/**
+/**
+ Initialize the cumulative data.
+
+**/
+VOID
+InitCumulativeData (
+ VOID
+ )
+{
+ UINTN Index;
+
+ for (Index = 0; Index < NumCum; ++Index) {
+ CumData[Index].Count = 0;
+ CumData[Index].MinDur = PERF_MAXDUR;
+ CumData[Index].MaxDur = 0;
+ CumData[Index].Duration = 0;
+ }
+}
+
+/**
Dump performance data.
@param[in] ImageHandle The image handle.
@@ -219,6 +239,11 @@
}
//
+ // Initialize the pre-defined cumulative data.
+ //
+ InitCumulativeData ();
+
+ //
// Timer specific processing
//
// Get the Performance counter characteristics:
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits