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=star.zeng@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 206252222C222 for ; Tue, 30 Jan 2018 18:02:02 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2018 18:07:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,437,1511856000"; d="scan'208";a="14195756" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga007.fm.intel.com with ESMTP; 30 Jan 2018 18:07:37 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 30 Jan 2018 18:07:36 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.145]) with mapi id 14.03.0319.002; Wed, 31 Jan 2018 10:07:35 +0800 From: "Zeng, Star" To: "Gao, Liming" , "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [PATCH v2 1/8] MdeModulePkg:Add definitions for new Performance infrastructure Thread-Index: AQHTmdHQ+zrk9D2Tn0euWW+fuXNI86ONPEvQ Date: Wed, 31 Jan 2018 02:07:33 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BA1C50D@shsmsx102.ccr.corp.intel.com> References: <1517320437-11688-1-git-send-email-dandan.bi@intel.com> <1517320437-11688-2-git-send-email-dandan.bi@intel.com> In-Reply-To: <1517320437-11688-2-git-send-email-dandan.bi@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v2 1/8] MdeModulePkg:Add definitions for new Performance infrastructure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2018 02:02:02 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable A minor comment. Do you think is it better to add prefix for new definitions in ExtendedFirm= warePerformance.h? Maybe FPDT_ ? Thanks, Star -----Original Message----- From: Bi, Dandan=20 Sent: Tuesday, January 30, 2018 9:54 PM To: edk2-devel@lists.01.org Cc: Gao, Liming ; Zeng, Star Subject: [PATCH v2 1/8] MdeModulePkg:Add definitions for new Performance in= frastructure From: "Gao, Liming" Cc: Liming Gao Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao Signed-off-by: Dandan Bi --- .../Include/Guid/ExtendedFirmwarePerformance.h | 291 +++++++++++++++++= ++++ MdeModulePkg/Include/Guid/FirmwarePerformance.h | 13 +- MdeModulePkg/MdeModulePkg.dec | 11 +- MdeModulePkg/MdeModulePkg.uni | 8 +- 4 files changed, 320 insertions(+), 3 deletions(-) create mode 100644 Mde= ModulePkg/Include/Guid/ExtendedFirmwarePerformance.h diff --git a/MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h b/MdeM= odulePkg/Include/Guid/ExtendedFirmwarePerformance.h new file mode 100644 index 0000000..0395495 --- /dev/null +++ b/MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h @@ -0,0 +1,291 @@ +/** @file + This file defines edk2 extended firmware performance records. + These records will be added into ACPI FPDT Firmware Basic Boot Performan= ce Table. + +Copyright (c) 2018, Intel Corporation. All rights reserved.
This=20 +program and the accompanying materials are licensed and made available=20 +under the terms and conditions of the BSD License that accompanies this di= stribution. +The full text of the license may be found at=20 +http://opensource.org/licenses/bsd-license.php. + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=20 +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. + +**/ + +#ifndef __EXTENDED_FIRMWARE_PERFORMANCE_H__ +#define __EXTENDED_FIRMWARE_PERFORMANCE_H__ + +#include + +// +// Known performance tokens +// +#define SEC_TOK "SEC" ///< SEC Phase +#define DXE_TOK "DXE" ///< DXE Phase +#define PEI_TOK "PEI" ///< PEI Phase +#define BDS_TOK "BDS" ///< BDS Phase +#define DRIVERBINDING_START_TOK "DB:Start:" ///< Driver Bind= ing Start() function call +#define DRIVERBINDING_SUPPORT_TOK "DB:Support:" ///< Driver Bind= ing Support() function call +#define DRIVERBINDING_STOP_TOK "DB:Stop:" ///< Driver Bind= ing Stop() function call +#define LOAD_IMAGE_TOK "LoadImage:" ///< Load a disp= atched module +#define START_IMAGE_TOK "StartImage:" ///< Dispatched = Modules Entry Point execution +#define PEIM_TOK "PEIM" ///< PEIM Module= s Entry Point execution + +// +// Public Progress Identifiers for Event Records to map the above known=20 +token // +#define MODULE_START_ID 0x01 +#define MODULE_END_ID 0x02 +#define MODULE_LOADIMAGE_START_ID 0x03 +#define MODULE_LOADIMAGE_END_ID 0x04 +#define MODULE_DB_START_ID 0x05 +#define MODULE_DB_END_ID 0x06 +#define MODULE_DB_SUPPORT_START_ID 0x07 +#define MODULE_DB_SUPPORT_END_ID 0x08 +#define MODULE_DB_STOP_START_ID 0x09 +#define MODULE_DB_STOP_END_ID 0x0A + +#define PERF_EVENTSIGNAL_START_ID 0x10 +#define PERF_EVENTSIGNAL_END_ID 0x11 +#define PERF_CALLBACK_START_ID 0x20 +#define PERF_CALLBACK_END_ID 0x21 +#define PERF_FUNCTION_START_ID 0x30 +#define PERF_FUNCTION_END_ID 0x31 +#define PERF_INMODULE_START_ID 0x40 +#define PERF_INMODULE_END_ID 0x41 +#define PERF_CROSSMODULE_START_ID 0x50 +#define PERF_CROSSMODULE_END_ID 0x51 + +// +// Misc defines +// +#define RECORD_REVISION_1 (0x01) + +// +// Length field in EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER is a UINT8,= thus: +// +#define MAX_PERF_RECORD_SIZE (MAX_UINT8) + +// +// FPDT Record Types +// +#define GUID_EVENT_TYPE 0x1010 +#define DYNAMIC_STRING_EVENT_TYPE 0x1011 +#define DUAL_GUID_STRING_EVENT_TYPE 0x1012 +#define GUID_QWORD_EVENT_TYPE 0x1013 +#define GUID_QWORD_STRING_EVENT_TYPE 0x1014 + +// +// EDKII extended Fpdt record structures // #define=20 +EDKII_STRING_EVENT_RECORD_NAME_LENGTH 24 + +#pragma pack(1) +// +// FPDT Boot Performance Guid Event Record Structure // typedef struct=20 +{ + EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header; + /// + /// ProgressID < 0x10 are reserved for core performance entries. + /// Start measurement point shall have lowered one nibble set to zero=20 +and + /// corresponding end points shall have lowered one nibble set to=20 +non-zero value; + /// keeping other nibbles same as start point. + /// + UINT16 ProgressID; + /// + /// APIC ID for the processor in the system used as a timestamp clock so= urce. + /// If only one timestamp clock source is used, this field is Reserved a= nd populated as 0. + /// + UINT32 ApicID; + /// + /// 64-bit value (nanosecond) describing elapsed time since the most rec= ent deassertion of processor reset. + /// + UINT64 Timestamp; + /// + /// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID= of the module logging the event. + /// + EFI_GUID Guid; +} GUID_EVENT_RECORD; + +// +// FPDT Boot Performance Dynamic String Event Record Structure //=20 +typedef struct { + EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header; + /// + /// ProgressID < 0x10 are reserved for core performance entries. + /// Start measurement point shall have lowered one nibble set to zero=20 +and + /// corresponding end points shall have lowered one nibble set to=20 +non-zero value; + /// keeping other nibbles same as start point. + /// + UINT16 ProgressID; + /// + /// APIC ID for the processor in the system used as a timestamp clock so= urce. + /// If only one timestamp clock source is used, this field is Reserved a= nd populated as 0. + /// + UINT32 ApicID; + /// + /// 64-bit value (nanosecond) describing elapsed time since the most rec= ent deassertion of processor reset. + /// + UINT64 Timestamp; + /// + /// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID= of the module logging the event. + /// + EFI_GUID Guid; + /// + /// ASCII string describing the module. Padding supplied at the end if n= ecessary with null characters (0x00). + /// It may be module name, function name, or token name. + /// + CHAR8 String[0]; +} DYNAMIC_STRING_EVENT_RECORD; + +// +// FPDT Boot Performance Dual GUID String Event Record Structure //=20 +typedef struct { + EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header; + /// + /// ProgressID < 0x10 are reserved for core performance entries. + /// Start measurement point shall have lowered one nibble set to zero=20 +and + /// corresponding end points shall have lowered one nibble set to=20 +non-zero value; + /// keeping other nibbles same as start point. + /// + UINT16 ProgressID; + /// + /// APIC ID for the processor in the system used as a timestamp clock so= urce. + /// If only one timestamp clock source is used, this field is Reserved a= nd populated as 0. + /// + UINT32 ApicID; + /// + /// 64-bit value (nanosecond) describing elapsed time since the most rec= ent deassertion of processor reset. + /// + UINT64 Timestamp; + /// + /// GUID of the module logging the event. + /// + EFI_GUID Guid1; + /// + /// Event or Ppi or Protocol GUID for Callback. + /// + EFI_GUID Guid2; + /// + /// ASCII string describing the module. Padding supplied at the end if n= ecessary with null characters (0x00). + /// It is the function name. + /// + CHAR8 String[0]; +} DUAL_GUID_STRING_EVENT_RECORD; + +// +// FPDT Boot Performance GUID Qword Event Record Structure // typedef=20 +struct { + EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header; + /// + /// ProgressID < 0x10 are reserved for core performance entries. + /// Start measurement point shall have lowered one nibble set to zero=20 +and + /// corresponding end points shall have lowered one nibble set to=20 +non-zero value; + /// keeping other nibbles same as start point. + /// + UINT16 ProgressID; + /// + /// APIC ID for the processor in the system used as a timestamp clock so= urce. + /// If only one timestamp clock source is used, this field is Reserved a= nd populated as 0. + /// + UINT32 ApicID; + /// + /// 64-bit value (nanosecond) describing elapsed time since the most rec= ent deassertion of processor reset. + /// + UINT64 Timestamp; + /// + /// GUID of the module logging the event + /// + EFI_GUID Guid; + /// + /// Qword of misc data, meaning depends on the ProgressId + /// + UINT64 Qword; +} GUID_QWORD_EVENT_RECORD; + +// +// FPDT Boot Performance GUID Qword String Event Record Structure //=20 +typedef struct { + EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header; + /// + /// ProgressID < 0x10 are reserved for core performance entries. + /// Start measurement point shall have lowered one nibble set to zero=20 +and + /// corresponding end points shall have lowered one nibble set to=20 +non-zero value; + /// keeping other nibbles same as start point. + /// + UINT16 ProgressID; + /// + /// APIC ID for the processor in the system used as a timestamp clock so= urce. + /// If only one timestamp clock source is used, this field is Reserved a= nd populated as 0. + /// + UINT32 ApicID; + /// + /// 64-bit value (nanosecond) describing elapsed time since the most rec= ent deassertion of processor reset. + /// + UINT64 Timestamp; + /// + /// GUID of the module logging the event + /// + EFI_GUID Guid; + /// + /// Qword of misc data, meaning depends on the ProgressId + /// + UINT64 Qword; + /// + /// ASCII string describing the module. Padding supplied at the end if n= ecessary with null characters (0x00). + /// + CHAR8 String[0]; +} GUID_QWORD_STRING_EVENT_RECORD; + +#pragma pack() + +typedef struct { + UINT16 ProgressID; + UINT16 Type; + UINT8 RecordSize; +} BASIC_RECORD_INFO; + +// +// Union of all FPDT records +// +typedef union { + EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER RecordHeader; + GUID_EVENT_RECORD GuidEvent; + DYNAMIC_STRING_EVENT_RECORD DynamicStringEvent; + DUAL_GUID_STRING_EVENT_RECORD DualGuidStringEvent; + GUID_QWORD_EVENT_RECORD GuidQwordEvent; + GUID_QWORD_STRING_EVENT_RECORD GuidQwordStringEvent; +} FPDT_RECORD; + +// +// Union of all pointers to FPDT records // typedef union { + EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER *RecordHeader; + GUID_EVENT_RECORD *GuidEvent; + DYNAMIC_STRING_EVENT_RECORD *DynamicStringEvent; + DUAL_GUID_STRING_EVENT_RECORD *DualGuidStringEvent; + GUID_QWORD_EVENT_RECORD *GuidQwordEvent; + GUID_QWORD_STRING_EVENT_RECORD *GuidQwordStringEvent; +} FPDT_RECORD_PTR; + +/// +/// Hob: +/// GUID - gEdkiiExtendedFirmwarePerformanceGuid +/// Data - PEI_EXT_FIRMWARE_PERF_HEADER + one or more FPDT records +/// +typedef struct { + UINT32 SizeOfAllEntries; + UINT32 LoadImageCount; + UINT32 HobIsFull; +} PEI_EXT_FIRMWARE_PERF_HEADER; + +extern EFI_GUID gEdkiiExtendedFirmwarePerformanceGuid; + +#endif diff --git a/MdeModulePkg/Include/Guid/FirmwarePerformance.h b/MdeModulePkg= /Include/Guid/FirmwarePerformance.h index 4697a2c..1495a46 100644 --- a/MdeModulePkg/Include/Guid/FirmwarePerformance.h +++ b/MdeModulePkg/Include/Guid/FirmwarePerformance.h @@ -1,9 +1,9 @@ /** @file ACPI Firmware Performance Data Table (FPDT) implementation specific defi= nitions. =20 - Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2011 - 2018, Intel Corporation. All rights=20 + reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at http://opensource.org/licenses/bsd-license.php =20 @@ -93,10 +93,21 @@ typedef struct { // one or more boot performance records. // } BOOT_PERFORMANCE_TABLE; =20 /// +/// Boot performance table for the performance record in SMM phase. +/// +/// +typedef struct { + EFI_ACPI_5_0_FPDT_PERFORMANCE_TABLE_HEADER Header; ///< Common ACP= I table header. + // + // one or more boot performance records. + // +} SMM_BOOT_PERFORMANCE_TABLE; + +/// /// Performance data pointed by Performance Pointer Record. /// typedef struct { BOOT_PERFORMANCE_TABLE BootPerformance; ///< Basic Boot Performa= nce. S3_PERFORMANCE_TABLE S3Performance; ///< S3 performance. diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec = index 0298bed..6819307 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -390,10 +390,13 @@ gEdkiiNonDiscoverableXhciDeviceGuid =3D { 0xB1BE0BC5, 0x6C28, 0x442D, {0= xAA, 0x37, 0x15, 0x1B, 0x42, 0x57, 0xBD, 0x78 } } =20 ## Include/Guid/PlatformHasAcpi.h gEdkiiPlatformHasAcpiGuid =3D { 0xf0966b41, 0xc23f, 0x41b9, { 0x96, 0x04= , 0x0f, 0xf7, 0xe1, 0x11, 0x96, 0x5a } } =20 + ## Include/Guid/ExtendedFirmwarePerformance.h + gEdkiiExtendedFirmwarePerformanceGuid =3D { 0x3b387bfd, 0x7abc, 0x4cf2,= =20 + { 0xa0, 0xca, 0xb6, 0xa1, 0x6c, 0x1b, 0x1b, 0x25 } } + ## Include/Guid/EndofS3Resume.h gEdkiiEndOfS3ResumeGuid =3D { 0x96f5296d, 0x05f7, 0x4f3c, {0x84, 0x67, 0= xe4, 0x56, 0x89, 0x0e, 0x0c, 0xb5 } } =20 [Ppis] ## Include/Ppi/AtaController.h @@ -1404,10 +1407,16 @@ =20 ## CapsuleMax value in capsule report variable. # @Prompt CapsuleMax value in capsule report variable. gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleMax|0xFFFF|UINT16|0x00000107 =20 + ## Control which FPDT record format will be used to store the performanc= e entry. + # On TRUE, the string FPDT record will be used to store every performanc= e entry. + # On FALSE, the different FPDT record will be used to store the differen= t performance entries. + # @Prompt String FPDT Record Enable Only + =20 + gEfiMdeModulePkgTokenSpaceGuid.PcdEdkiiFpdtStringRecordEnableOnly|FALS + E|BOOLEAN|0x00000109 + [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] ## This PCD defines the Console output row. The default value is 25 acco= rding to UEFI spec. # This PCD could be set to 0 then console output would be at max column= and max row. # @Prompt Console output row. gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|25|UINT32|0x40000006 @@ -1703,11 +1712,11 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosEntryPointProvideMethod|0x3|UINT= 32|0x00010069 =20 ## This PCD specifies the additional pad size in FPDT Basic Boot Perform= ance Table for # the extension FPDT boot records received after ReadyToBoot and before= ExitBootService. # @Prompt Pad size for extension FPDT boot records. - gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize|0x0|UINT32|0x= 0001005F + =20 + gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize|0x20000|UIN + T32|0x0001005F =20 ## Indicates if ConIn device are connected on demand.

# TRUE - ConIn device are not connected during BDS and ReadKeyStroke/= ReadKeyStrokeEx produced # by Consplitter should be called before any real key read ope= ration.
# FALSE - ConIn device may be connected normally during BDS.
diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni = index 0e06842..dacd671 100644 --- a/MdeModulePkg/MdeModulePkg.uni +++ b/MdeModulePkg/MdeModulePkg.uni @@ -2,11 +2,11 @@ // This package provides the modules that conform to UEFI/PI Industry stan= dards. // // It also provides the definitions(including PPIs/PROTOCOLs/GUIDs and lib= rary classes) // and libraries instances, which are used for those modules= . // -// Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+// Copyright (c) 2007 - 2018, Intel Corporation. All rights=20 +reserved.
// // This program and the accompanying materials are licensed and made avail= able under // the terms and conditions of the BSD License that accompanies= this distribution. // The full text of the license may be found at // http://opensource.org/= licenses/bsd-license.php. @@ -1230,5 +1230,11 @@ = " When its value is set in PEI, it will trig the default setting= to be applied as the default EFI variable.\n" =20 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNvStoreDefaultValueBuffer_PR= OMPT #language en-US "NV Storage Default Value Buffer" =20 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNvStoreDefaultValueBuffer_HE= LP #language en-US "This dynamic PCD holds the DynamicHii PCD value. Its= value is the auto generated.\n" + +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdEdkiiFpdtStringRecordEnableO= nly_PROMPT #language en-US "String FPDT Record Enable Only" + +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdEdkiiFpdtStringRecordEnableO= nly_HELP #language en-US "Control which FPDT record format will be used = to store the performance entry.\n" + = "On TRUE, the string FPDT record will be used t= o store every performance entry.\n" + = "On FALSE, the different FPDT record will be us= ed to store the different performance entries." -- 1.9.5.msysgit.1