From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 01D47210ED0F0 for ; Tue, 12 Jun 2018 01:11:03 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2018 01:11:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,213,1526367600"; d="scan'208";a="49196628" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga006.jf.intel.com with ESMTP; 12 Jun 2018 01:11:03 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Jun 2018 01:11:03 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Jun 2018 01:11:02 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.87]) by shsmsx102.ccr.corp.intel.com ([169.254.2.223]) with mapi id 14.03.0319.002; Tue, 12 Jun 2018 16:11:00 +0800 From: "Ni, Ruiyu" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Carsey, Jaben" Thread-Topic: [patch V2 2/3] ShellPkg/Dp: Initialize summary date when run DP Thread-Index: AQHUAV7EK+UJurnCV0uvGGLYZVAMm6RcRsyA Date: Tue, 12 Jun 2018 08:10:55 +0000 Deferred-Delivery: Tue, 12 Jun 2018 08:11:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BD2FC40@SHSMSX104.ccr.corp.intel.com> References: <20180611083206.106804-1-dandan.bi@intel.com> <20180611083206.106804-2-dandan.bi@intel.com> In-Reply-To: <20180611083206.106804-2-dandan.bi@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch V2 2/3] ShellPkg/Dp: Initialize summary date when run DP X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 08:11:04 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni Thanks/Ray > -----Original Message----- > From: Bi, Dandan > Sent: Monday, June 11, 2018 4:32 PM > To: edk2-devel@lists.01.org > Cc: Gao, Liming ; Ni, Ruiyu ; > Carsey, Jaben > Subject: [patch V2 2/3] ShellPkg/Dp: Initialize summary date when run DP >=20 > Issue: > When run "dp -s" or ("dp -v") command in shell several times, the summary > reuslts are different each time. >=20 > 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. >=20 > 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 > --- > ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c | 23 > +++++++++++++++++++++++ > 1 file changed, 23 insertions(+) >=20 > 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 =3D 0; > CumData[Index].Duration =3D 0; > } > } >=20 > +/** > + Initialize the Summary data. > + > +**/ > +VOID > +InitSummaryData ( > + VOID > + ) > +{ > + SummaryData.NumTrace =3D 0; > + SummaryData.NumProfile =3D 0 ; > + SummaryData.NumIncomplete =3D 0; > + SummaryData.NumSummary =3D 0; > + SummaryData.NumHandles =3D 0; > + SummaryData.NumPEIMs =3D 0; > + SummaryData.NumGlobal =3D 0; > +} > + > /** > Dump performance data. >=20 > @param[in] ImageHandle The image handle. > @param[in] SystemTable The system table. > @@ -817,10 +835,15 @@ RunDp ( > // > // Initialize the pre-defined cumulative data. > // > InitCumulativeData (); >=20 > + // > + // Initialize the Summary data. > + // > + InitSummaryData (); > + > // > // Init the custom cumulative data. > // > CustomCumulativeToken =3D ShellCommandLineGetValue (ParamPackage, > L"-c"); > if (CustomCumulativeToken !=3D NULL) { > -- > 2.14.3.windows.1