2 This file defines edk2 extended firmware performance records.
3 These records will be added into ACPI FPDT Firmware Basic Boot Performance Table.
5 Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __EXTENDED_FIRMWARE_PERFORMANCE_H__
11 #define __EXTENDED_FIRMWARE_PERFORMANCE_H__
13 #include <IndustryStandard/Acpi.h>
16 // Known performance tokens
18 #define SEC_TOK "SEC" ///< SEC Phase
19 #define DXE_TOK "DXE" ///< DXE Phase
20 #define PEI_TOK "PEI" ///< PEI Phase
21 #define BDS_TOK "BDS" ///< BDS Phase
22 #define DRIVERBINDING_START_TOK "DB:Start:" ///< Driver Binding Start() function call
23 #define DRIVERBINDING_SUPPORT_TOK "DB:Support:" ///< Driver Binding Support() function call
24 #define DRIVERBINDING_STOP_TOK "DB:Stop:" ///< Driver Binding Stop() function call
25 #define LOAD_IMAGE_TOK "LoadImage:" ///< Load a dispatched module
26 #define START_IMAGE_TOK "StartImage:" ///< Dispatched Modules Entry Point execution
27 #define PEIM_TOK "PEIM" ///< PEIM Modules Entry Point execution
32 #define FPDT_RECORD_REVISION_1 (0x01)
35 // Length field in EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER is a UINT8, thus:
37 #define FPDT_MAX_PERF_RECORD_SIZE (MAX_UINT8)
42 #define FPDT_GUID_EVENT_TYPE 0x1010
43 #define FPDT_DYNAMIC_STRING_EVENT_TYPE 0x1011
44 #define FPDT_DUAL_GUID_STRING_EVENT_TYPE 0x1012
45 #define FPDT_GUID_QWORD_EVENT_TYPE 0x1013
46 #define FPDT_GUID_QWORD_STRING_EVENT_TYPE 0x1014
49 // EDKII extended Fpdt record structures
51 #define FPDT_STRING_EVENT_RECORD_NAME_LENGTH 24
55 // FPDT Boot Performance Guid Event Record Structure
58 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header
;
60 /// ProgressID < 0x10 are reserved for core performance entries.
61 /// Start measurement point shall have lowered one nibble set to zero and
62 /// corresponding end points shall have lowered one nibble set to non-zero value;
63 /// keeping other nibbles same as start point.
67 /// APIC ID for the processor in the system used as a timestamp clock source.
68 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.
72 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
76 /// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID of the module logging the event.
79 } FPDT_GUID_EVENT_RECORD
;
82 // FPDT Boot Performance Dynamic String Event Record Structure
85 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header
;
87 /// ProgressID < 0x10 are reserved for core performance entries.
88 /// Start measurement point shall have lowered one nibble set to zero and
89 /// corresponding end points shall have lowered one nibble set to non-zero value;
90 /// keeping other nibbles same as start point.
94 /// APIC ID for the processor in the system used as a timestamp clock source.
95 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.
99 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
103 /// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID of the module logging the event.
107 /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).
108 /// It may be module name, function name, or token name.
111 } FPDT_DYNAMIC_STRING_EVENT_RECORD
;
114 // FPDT Boot Performance Dual GUID String Event Record Structure
117 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header
;
119 /// ProgressID < 0x10 are reserved for core performance entries.
120 /// Start measurement point shall have lowered one nibble set to zero and
121 /// corresponding end points shall have lowered one nibble set to non-zero value;
122 /// keeping other nibbles same as start point.
126 /// APIC ID for the processor in the system used as a timestamp clock source.
127 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.
131 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
135 /// GUID of the module logging the event.
139 /// Event or Ppi or Protocol GUID for Callback.
143 /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).
144 /// It is the function name.
147 } FPDT_DUAL_GUID_STRING_EVENT_RECORD
;
150 // FPDT Boot Performance GUID Qword Event Record Structure
153 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header
;
155 /// ProgressID < 0x10 are reserved for core performance entries.
156 /// Start measurement point shall have lowered one nibble set to zero and
157 /// corresponding end points shall have lowered one nibble set to non-zero value;
158 /// keeping other nibbles same as start point.
162 /// APIC ID for the processor in the system used as a timestamp clock source.
163 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.
167 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
171 /// GUID of the module logging the event
175 /// Qword of misc data, meaning depends on the ProgressId
178 } FPDT_GUID_QWORD_EVENT_RECORD
;
181 // FPDT Boot Performance GUID Qword String Event Record Structure
184 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header
;
186 /// ProgressID < 0x10 are reserved for core performance entries.
187 /// Start measurement point shall have lowered one nibble set to zero and
188 /// corresponding end points shall have lowered one nibble set to non-zero value;
189 /// keeping other nibbles same as start point.
193 /// APIC ID for the processor in the system used as a timestamp clock source.
194 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.
198 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
202 /// GUID of the module logging the event
206 /// Qword of misc data, meaning depends on the ProgressId
210 /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).
213 } FPDT_GUID_QWORD_STRING_EVENT_RECORD
;
218 // Union of all FPDT records
221 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER RecordHeader
;
222 FPDT_GUID_EVENT_RECORD GuidEvent
;
223 FPDT_DYNAMIC_STRING_EVENT_RECORD DynamicStringEvent
;
224 FPDT_DUAL_GUID_STRING_EVENT_RECORD DualGuidStringEvent
;
225 FPDT_GUID_QWORD_EVENT_RECORD GuidQwordEvent
;
226 FPDT_GUID_QWORD_STRING_EVENT_RECORD GuidQwordStringEvent
;
230 // Union of all pointers to FPDT records
233 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER
*RecordHeader
;
234 FPDT_GUID_EVENT_RECORD
*GuidEvent
;
235 FPDT_DYNAMIC_STRING_EVENT_RECORD
*DynamicStringEvent
;
236 FPDT_DUAL_GUID_STRING_EVENT_RECORD
*DualGuidStringEvent
;
237 FPDT_GUID_QWORD_EVENT_RECORD
*GuidQwordEvent
;
238 FPDT_GUID_QWORD_STRING_EVENT_RECORD
*GuidQwordStringEvent
;
243 /// GUID - gEdkiiFpdtExtendedFirmwarePerformanceGuid;
244 /// Data - FPDT_PEI_EXT_PERF_HEADER + one or more FPDT records
247 UINT32 SizeOfAllEntries
;
248 UINT32 LoadImageCount
;
250 } FPDT_PEI_EXT_PERF_HEADER
;
252 extern EFI_GUID gEdkiiFpdtExtendedFirmwarePerformanceGuid
;