From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.38913.1669344759788541737 for ; Thu, 24 Nov 2022 18:52:40 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=NrhMu6qM; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: zhichao.gao@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669344759; x=1700880759; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=5i7rBbOljtlfmCzMAhqctw3yd16n11oOY9mlsb7gmyo=; b=NrhMu6qMmA5ZcTLNvkHYRYSNV6XFzU5F5Rzw1c8w5KuwzBcuG9EbULEC N6wpFkJOZ3xSZfTXYxsHqYrTvdphEvCsyfblX6zJcVx9n6AH4STxg/N+S L0C/RUya1iMOZYga+hKzIR5ACvbwGYNHcs3No+QQRQnqXFWyTMRxl46dT AccVCE4i7nWgvU8GhOYG6rG6tSGL+xJGNbGdZqYyMNwg0e1ADYBIO1rx8 y0YvJ4Zyng+OTVnnvT1XCwAPXr5x02/GOr0aygkiaIdEITE2mQPcaub6Q 4AlDHyL2QqpEHpbpaL4DKf3SDk5SMJ+k6mUppdAHhaqQ9l9N0nyGLut1w Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10541"; a="301969524" X-IronPort-AV: E=Sophos;i="5.96,192,1665471600"; d="scan'208";a="301969524" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2022 18:52:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10541"; a="675258454" X-IronPort-AV: E=Sophos;i="5.96,192,1665471600"; d="scan'208";a="675258454" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga001.jf.intel.com with ESMTP; 24 Nov 2022 18:52:39 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 24 Nov 2022 18:52:38 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 24 Nov 2022 18:52:38 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Thu, 24 Nov 2022 18:52:38 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Thu, 24 Nov 2022 18:52:38 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MI/q0n0WKwdwFLZsWGlkeZ5fbrI/IU7vJPouBtd3sSe7fUz8l3eE826lYtkxywcfs0sG0I7hIiKkMvWjQsbFi7eu1x3RBFgYB/5twIVUeWPZ2xEZIZPan0E/uzkjgzNsqBBJbbDblifFNUJpr8+VAp7HDTFl542V+7hy/7c8NAjNB3lzdUX/RmnKviKYyUYR6JQ8YgTWh2nnc4e3RKNA8frBtS4AP1tih7wxiY1ECxvUw3s1ikeH5WfBbPYLqfFckdetoayFUGvBxvHfAeX3RqNcBwg4sGOMBq+6yVWbcpHoDq3+VcVKZB74PZuM6dwL6aLSlXMuQ5jvbv8QGjLFoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CAN/ZwaLfjvSXwaL7Ow8cSarMdA4vVRr46KugFMpf4M=; b=f7JFCrQcgtms17ELuJMIxMQMgfyiYNKpw2jZAsDd+q6PsJ4GGXFz0qH9tYv2J1zJpi8azdeBvvtVVzyJZkWGrSqAUFI9TUHH9VGFenyYoET/kSMZy4D1KAnuwaquQ6vLqaPZd57iPU5oU8a+kk0pFPLRyvTtYgHLdIdFlJfpQA719hkPDms7Kji1Etnjf46a1rLCQC3DNFvVF1ureeAV19pL3EkRZ/kJqb5a/LSz8+18In0+Do+k+zBeBkktWew0fuFZEqKYhZiFLMDgys/L3J8Nhmway8+YYcQ61FHXmst2Wwp0v80TDVvE1YG4Oq4Qq3sGW/J/fMID+bmEYIaPLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH7PR11MB6377.namprd11.prod.outlook.com (2603:10b6:510:1fb::13) by BL1PR11MB5511.namprd11.prod.outlook.com (2603:10b6:208:317::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.20; Fri, 25 Nov 2022 02:52:36 +0000 Received: from PH7PR11MB6377.namprd11.prod.outlook.com ([fe80::6a3:d470:3867:1403]) by PH7PR11MB6377.namprd11.prod.outlook.com ([fe80::6a3:d470:3867:1403%5]) with mapi id 15.20.5857.019; Fri, 25 Nov 2022 02:52:35 +0000 From: "Gao, Zhichao" To: "Yang, Zhenhua" , "devel@edk2.groups.io" CC: "Ni, Ray" , "Zeng, Star" Subject: Re: [AddResetEnd v1] ShellPkg/DpDynamicCommand: Add ResetEnd support in DP command Thread-Topic: [AddResetEnd v1] ShellPkg/DpDynamicCommand: Add ResetEnd support in DP command Thread-Index: AQHY/YyI61P/LKayYEqtUDD8yqdF165O9sJQ Date: Fri, 25 Nov 2022 02:52:35 +0000 Message-ID: References: <20221121093456.2251-1-zhenhua.yang@intel.com> In-Reply-To: <20221121093456.2251-1-zhenhua.yang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR11MB6377:EE_|BL1PR11MB5511:EE_ x-ms-office365-filtering-correlation-id: 7d690979-7024-47db-251a-08dace901b83 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4mnw/g1zpvQRFdKUJoR6O3tB78LbqX2AH36RmuvitJtYBa3eQEe7+X5EYVX9WRF/bxwp1gxG0NAPmoXJjVyzzXdRww7umM4Cv0IoQD4uJcI9S1o3qMKeMRPbCCSE/k/V3LDtaI7xPbU16LZnbIID/fM6/xwMH8FHjAj+JZewBxdpemWfl4S8Ua3R7d98oIAQtjbY/H7EAvK9rHdSv5QrUlNLZ2o1ipRjkGJ9KpaBH6eXHr9WJPQSuHK63B/ufHosNrifnh80jA6mF37t0L+DYUv29hBeaw51mgZH1ktvb8mssdl5IZqYyKKwlPohh5NmMEFQ/bulLiPvNFNruHLxb6ddFQGuE7ta3klhODAMJznCYwM4ja1tLQ73NR+SdJumr1K/l1f4Gdx9GUgK9h3PYDPrc0l27qaUFqNC9WVHDw8eUkbH75Xj8E2JKXFiTCIcAR6hVo30ZMrwB7M2hoHGDFGeC/wC0RpiwIuWOLI4adcxiGPfMCIHNchQGhP1LLaLV9R/SxjEW+LkQ32SScQb7oOHuKaOd81A5Gtw4tGnS+Ky8HJneWwJ63go7J4pfDn60ZvO0GBgEzLbUSYMx0rsWYu8oZG4Gpi/iyd8u/0A+PBh46mJR6Z/03r/M/BYMQsf9sfdxGli7cdah1DxWOUek0hPrePkYr3nhc/exvi3BCbmDFIgLHH2Qj+C2ZOL6q26 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR11MB6377.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(6029001)(136003)(39860400002)(346002)(366004)(376002)(396003)(451199015)(55016003)(33656002)(38070700005)(86362001)(8676002)(64756008)(66446008)(66476007)(66556008)(4326008)(9686003)(53546011)(26005)(76116006)(66946007)(52536014)(186003)(8936002)(41300700001)(478600001)(110136005)(45080400002)(71200400001)(7696005)(6506007)(54906003)(107886003)(316002)(82960400001)(122000001)(38100700002)(5660300002)(2906002)(83380400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?lD7iwbJ+TlhsqSLiWFIbkZbkWilTQPdh/R+zTvNQVKSWcAr1BefnCdYIO2mB?= =?us-ascii?Q?ptUUsEAE/epO1srz0Aty5gOnZObjVtZ6+fsZ5LxEno6PgtJZAu3h3qqvS6Mx?= =?us-ascii?Q?KJHR4M7wQudnBjrqC+s5fKzpw1ZVN5rkpJVC5ktLtUfHv1LWvAAmpTQ+wvz5?= =?us-ascii?Q?aBMn4GoaOpCw6sxKDV6PGCUkTDToJ0tYuSB3x/LBfqQzZLRFoB0lwnyIkfBT?= =?us-ascii?Q?uL3la/ikl3rsOwcBbOGbJG9GCTT2H7tSpNGucRe3Vol113Rdobqb77OaxxBm?= =?us-ascii?Q?Eub1ssJoOPBqUMV9eiE17Se8We7EbE1Dy14IQOdXlhmHF1J2NULPVFgAQDB0?= =?us-ascii?Q?wLmDSsnPnGUCq6OX1JrOpxykZ8eaH0qHPn7wdMFP/3ps7xa0Swr0eaellYyr?= =?us-ascii?Q?/uImWv/4u/mP0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41FRP+cW?= =?us-ascii?Q?cfbz7n4pj22IQJd/m8w1bstaptYXHtg7TEQwjBG0nQ5Jstoz0opP5YhiwPZK?= =?us-ascii?Q?ckSPPZivIAVKkuYt4oyo/uFBEZN0veP+bAwDbfcwC/kI8WvQX3G7Lr0vJwHK?= =?us-ascii?Q?lYt5wpkYvdn87xw6kHJvPItmO+v/wkpIvw63VlT5C5m4K5uyeI5CC7e9uhDz?= =?us-ascii?Q?d01IqpRgv4/PHiunXHla1COoYapuFjJxuJy1U337jPmmRxeLV2Y03FLPYZqs?= =?us-ascii?Q?4fJF19CU7B/neM5hcR1jgPP+9rjteka/4rLbXrxL?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB6377.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d690979-7024-47db-251a-08dace901b83 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Nov 2022 02:52:35.8069 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: yUxXx5TsibNXzWf7mVDpEM0qTueATqNh8Mn2JVzC0llprO1MXzuMa9n76L/R2wMUuPbl/QgOxHFU6ucuj7MJ8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5511 Return-Path: zhichao.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Zhichao Gao Thanks, Zhichao > -----Original Message----- > From: Yang, Zhenhua > Sent: Monday, November 21, 2022 5:35 PM > To: devel@edk2.groups.io > Cc: Ni, Ray ; Gao, Zhichao ; Zen= g, > Star > Subject: [AddResetEnd v1] ShellPkg/DpDynamicCommand: Add ResetEnd > support in DP command >=20 > From: zhenhuay >=20 > DP command should be able to parse the FPDT ACPI table and dump the > ResetEnd which was logged at the beginning of the firmware image > execution. So that DP can calculate SEC phase time duration start from th= e > beginning of firmware image execution. >=20 > Cc: Ray Ni > Cc: Zhichao Gao > Cc: Star Zeng > Signed-off-by: zhenhuay > --- > ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c | 14 > ++++++++++++++ > ShellPkg/DynamicCommand/DpDynamicCommand/DpTrace.c | 9 > +++++++++ > ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni | 1 + > ShellPkg/DynamicCommand/DpDynamicCommand/DpInternal.h | 1 + > 4 files changed, 25 insertions(+) >=20 > diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c > b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c > index 1799ab176a..512a146da6 100644 > --- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c > +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c > @@ -57,6 +57,7 @@ UINT8 *mBootPerformanceTable; > UINTN mBootPerformanceTableSize; BOOLEAN mPeiPhase =3D FALSE; > BOOLEAN mDxePhase =3D FALSE;+UINT64 mResetEnd =3D 0; > PERF_SUMMARY_DATA SummaryData =3D { 0 }; ///< Create the > SummaryData structure and init. to ZERO. MEASUREMENT_RECORD > *mMeasurementList =3D NULL;@@ -542,6 +543,8 @@ BuildMeasurementList ( > { EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER *RecordHeader; > UINT8 *PerformanceTablePtr;+ UINT= 8 > *BasicBootTablePtr;+ UINT64 ResetE= nd; UINT16 > StartProgressId; UINTN TableLeng= th; UINT8 > *StartRecordEvent;@@ -552,6 +555,17 @@ BuildMeasurementList ( > return EFI_OUT_OF_RESOURCES; } + //+ // Update the ResetEnd whic= h > was logged at the beginning of firmware image execution+ //+ TableLengt= h > =3D sizeof (EFI_ACPI_5_0_FPDT_PERFORMANCE_TABLE_HEADER);+ > BasicBootTablePtr =3D (mBootPerformanceTable + TableLength);+ ResetEnd > =3D ((EFI_ACPI_5_0_FPDT_FIRMWARE_BASIC_BOOT_RECORD > *)BasicBootTablePtr)->ResetEnd;++ if (ResetEnd > 0) {+ mResetEnd =3D > ResetEnd;+ }+ TableLength =3D sizeof (BOOT_PERFORMANCE_TABLE); > PerformanceTablePtr =3D (mBootPerformanceTable + TableLength); diff --git > a/ShellPkg/DynamicCommand/DpDynamicCommand/DpTrace.c > b/ShellPkg/DynamicCommand/DpDynamicCommand/DpTrace.c > index 0abb8797ec..9c0a9a06a1 100644 > --- a/ShellPkg/DynamicCommand/DpDynamicCommand/DpTrace.c > +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/DpTrace.c > @@ -548,6 +548,15 @@ ProcessPhases ( > Total =3D 0; + // print Reset End if it's valid+ //+ if (SecTime >= mResetEnd) {+ > SecTime =3D SecTime - mResetEnd; // Calculate sec time= duration > start from the beginning of firmware image execution+ ElapsedTime =3D > DurationInMicroSeconds (mResetEnd); // Calculate elapsed time in > microseconds+ Total +=3D DivU64x32 (ElapsedTime, 1000); // A= ccumulate > time in milliseconds+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN > (STR_DP_RESET_END), mDpHiiHandle, ElapsedTime);+ }+ // print SEC phase > duration time // if (SecTime > 0) {diff --git > a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni > b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni > index 8d8700573e..ef2e7708b8 100644 > --- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni > +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni > @@ -41,6 +41,7 @@ > #string STR_DP_TIMER_PROPERTIES #language en-US "System > Performance Timer counts %s from 0x%Lx to 0x%Lx\n" #string > STR_DP_VERBOSE_THRESHOLD #language en-US "Measurements less > than %,Ld microseconds are not displayed.\n" #string > STR_DP_SECTION_PHASES #language en-US "Major Phases"+#string > STR_DP_RESET_END #language en-US " Reset End: = %L8d > (us)\n" #string STR_DP_SEC_PHASE #language en-US " SEC Ph= ase > Duration: %L8d (us)\n" #string STR_DP_PHASE_BDSTO #langu= age > en-US " BDS Timeout: %L8d (ms) included in BDS Duration\n" #st= ring > STR_DP_PHASE_DURATION #language en-US "%5a Phase > Duration: %L8d (ms)\n"diff --git > a/ShellPkg/DynamicCommand/DpDynamicCommand/DpInternal.h > b/ShellPkg/DynamicCommand/DpDynamicCommand/DpInternal.h > index 39878c6085..97f47f2960 100644 > --- a/ShellPkg/DynamicCommand/DpDynamicCommand/DpInternal.h > +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/DpInternal.h > @@ -28,6 +28,7 @@ extern UINT8 *mBootPerformanceTable; > extern UINTN mBootPerformanceTableLength; extern > MEASUREMENT_RECORD *mMeasurementList; extern UINTN > mMeasurementNum;+extern UINT64 mResetEnd; extern > PERF_SUMMARY_DATA SummaryData; ///< Create the SummaryData > structure and init. to ZERO. -- > 2.31.1.windows.1