From: Dandan Bi Date: Sat, 12 May 2018 12:57:36 +0000 (+0800) Subject: ShellPkg/Dp: Initialize summary date when run DP X-Git-Tag: edk2-stable201903~1604 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=d25cf17cea52ade0ab9e9e551cf8f03792ed1da5;hp=37d533da76e24828dc9b4cf86fa4ef8ec47c22a7 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 Cc: Ruiyu Ni Cc: Jaben Carsey Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi Reviewed-by: Ruiyu Ni --- diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c index fe85937f55..d8451dbf59 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c @@ -674,6 +674,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. @@ -819,6 +837,11 @@ RunDp ( // InitCumulativeData (); + // + // Initialize the Summary data. + // + InitSummaryData (); + // // Init the custom cumulative data. //