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 <[email protected]> Cc: Ruiyu Ni <[email protected]> Cc: Jaben Carsey <[email protected]> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <[email protected]> --- ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c index fe85937f557..d8451dbf59f 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c @@ -672,10 +672,28 @@ InitCumulativeData ( CumData[Index].MaxDur = 0; CumData[Index].Duration = 0; } } +/** + 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. @param[in] SystemTable The system table. @@ -817,10 +835,15 @@ RunDp ( // // Initialize the pre-defined cumulative data. // InitCumulativeData (); + // + // Initialize the Summary data. + // + InitSummaryData (); + // // Init the custom cumulative data. // CustomCumulativeToken = ShellCommandLineGetValue (ParamPackage, L"-c"); if (CustomCumulativeToken != NULL) { -- 2.14.3.windows.1 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

