Re: [edk2] [PATCH v2 1/8] MdeModulePkg:Add definitions for new Performance infrastructure
A minor comment. Do you think is it better to add prefix for new definitions in ExtendedFirmwarePerformance.h? Maybe FPDT_ ? Thanks, Star -Original Message- From: Bi, Dandan 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 infrastructure 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 MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h diff --git a/MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h b/MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h new file mode 100644 index 000..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 Performance Table. + +Copyright (c) 2018, Intel Corporation. All rights reserved. This +program and the accompanying materials are licensed and made available +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. + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#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 Binding Start() function call +#define DRIVERBINDING_SUPPORT_TOK "DB:Support:" ///< Driver Binding Support() function call +#define DRIVERBINDING_STOP_TOK "DB:Stop:"///< Driver Binding Stop() function call +#define LOAD_IMAGE_TOK "LoadImage:" ///< Load a dispatched module +#define START_IMAGE_TOK "StartImage:" ///< Dispatched Modules Entry Point execution +#define PEIM_TOK"PEIM"///< PEIM Modules Entry Point execution + +// +// Public Progress Identifiers for Event Records to map the above known +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_ID0x06 +#define MODULE_DB_SUPPORT_START_ID 0x07 +#define MODULE_DB_SUPPORT_END_ID0x08 +#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_ID0x21 +#define PERF_FUNCTION_START_ID 0x30 +#define PERF_FUNCTION_END_ID0x31 +#define PERF_INMODULE_START_ID 0x40 +#define PERF_INMODULE_END_ID0x41 +#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 +EDKII_STRING_EVENT_RECORD_NAME_LENGTH 24 + +#pragma pack(1) +// +// FPDT Boot Performance Guid Event Record Structure // 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 +and + /// corresponding end points shall have lowered one nibble set to
[edk2] [PATCH v2 1/8] MdeModulePkg:Add definitions for new Performance infrastructure
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 MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h diff --git a/MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h b/MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h new file mode 100644 index 000..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 Performance Table. + +Copyright (c) 2018, Intel Corporation. All rights reserved. +This program and the accompanying materials are licensed and made available 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. + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#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 Binding Start() function call +#define DRIVERBINDING_SUPPORT_TOK "DB:Support:" ///< Driver Binding Support() function call +#define DRIVERBINDING_STOP_TOK "DB:Stop:"///< Driver Binding Stop() function call +#define LOAD_IMAGE_TOK "LoadImage:" ///< Load a dispatched module +#define START_IMAGE_TOK "StartImage:" ///< Dispatched Modules Entry Point execution +#define PEIM_TOK"PEIM"///< PEIM Modules Entry Point execution + +// +// Public Progress Identifiers for Event Records to map the above known 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_ID0x06 +#define MODULE_DB_SUPPORT_START_ID 0x07 +#define MODULE_DB_SUPPORT_END_ID0x08 +#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_ID0x21 +#define PERF_FUNCTION_START_ID 0x30 +#define PERF_FUNCTION_END_ID0x31 +#define PERF_INMODULE_START_ID 0x40 +#define PERF_INMODULE_END_ID0x41 +#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 EDKII_STRING_EVENT_RECORD_NAME_LENGTH 24 + +#pragma pack(1) +// +// FPDT Boot Performance Guid Event Record Structure +// +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 and + /// corresponding end points shall have lowered one nibble set to 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 source. + /// If only one timestamp clock source is used, this field is Reserved and populated as 0. + /// + UINT32 ApicID; + /// + /// 64-bit value (nanosecond)