diff options
author | Dandan Bi <dandan.bi@intel.com> | 2018-05-12 20:57:36 +0800 |
---|---|---|
committer | Eric Dong <eric.dong@intel.com> | 2018-06-12 15:50:55 +0800 |
commit | d25cf17cea52ade0ab9e9e551cf8f03792ed1da5 (patch) | |
tree | d088e2b08af8680f07a41375755b6493a089f806 /ShellPkg/DynamicCommand | |
parent | 37d533da76e24828dc9b4cf86fa4ef8ec47c22a7 (diff) | |
download | edk2-d25cf17cea52ade0ab9e9e551cf8f03792ed1da5.zip edk2-d25cf17cea52ade0ab9e9e551cf8f03792ed1da5.tar.gz edk2-d25cf17cea52ade0ab9e9e551cf8f03792ed1da5.tar.bz2 |
ShellPkg/Dp: Initialize summary date when run DP
Issue:
When run "dp -s" or ("dp -v") command in shell several times,
the summary reuslts are different each time.
The root cause is that the previous global data "SummaryData"
is not cleaned when the dp command is callled next time.
This patch initializes the global data "SummaryData"
when the dp dymanic command is called.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Diffstat (limited to 'ShellPkg/DynamicCommand')
-rw-r--r-- | ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c index fe85937..d8451db 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c @@ -675,6 +675,24 @@ InitCumulativeData ( }
/**
+ Initialize the Summary data.
+
+**/
+VOID
+InitSummaryData (
+ VOID
+ )
+{
+ SummaryData.NumTrace = 0;
+ SummaryData.NumProfile = 0 ;
+ SummaryData.NumIncomplete = 0;
+ SummaryData.NumSummary = 0;
+ SummaryData.NumHandles = 0;
+ SummaryData.NumPEIMs = 0;
+ SummaryData.NumGlobal = 0;
+}
+
+/**
Dump performance data.
@param[in] ImageHandle The image handle.
@@ -820,6 +838,11 @@ RunDp ( InitCumulativeData ();
//
+ // Initialize the Summary data.
+ //
+ InitSummaryData ();
+
+ //
// Init the custom cumulative data.
//
CustomCumulativeToken = ShellCommandLineGetValue (ParamPackage, L"-c");
|