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 This program and the accompanying materials are licensed and made available under
7 the terms and conditions of the BSD License that accompanies this distribution.
8 The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef __EXTENDED_FIRMWARE_PERFORMANCE_H__
17 #define __EXTENDED_FIRMWARE_PERFORMANCE_H__
19 #include <IndustryStandard/Acpi.h>
22 // Known performance tokens
24 #define SEC_TOK "SEC" ///< SEC Phase
25 #define DXE_TOK "DXE" ///< DXE Phase
26 #define PEI_TOK "PEI" ///< PEI Phase
27 #define BDS_TOK "BDS" ///< BDS Phase
28 #define DRIVERBINDING_START_TOK "DB:Start:" ///< Driver Binding Start() function call
29 #define DRIVERBINDING_SUPPORT_TOK "DB:Support:" ///< Driver Binding Support() function call
30 #define DRIVERBINDING_STOP_TOK "DB:Stop:" ///< Driver Binding Stop() function call
31 #define LOAD_IMAGE_TOK "LoadImage:" ///< Load a dispatched module
32 #define START_IMAGE_TOK "StartImage:" ///< Dispatched Modules Entry Point execution
33 #define PEIM_TOK "PEIM" ///< PEIM Modules Entry Point execution
36 // Public Progress Identifiers for Event Records to map the above known token
38 #define MODULE_START_ID 0x01
39 #define MODULE_END_ID 0x02
40 #define MODULE_LOADIMAGE_START_ID 0x03
41 #define MODULE_LOADIMAGE_END_ID 0x04
42 #define MODULE_DB_START_ID 0x05
43 #define MODULE_DB_END_ID 0x06
44 #define MODULE_DB_SUPPORT_START_ID 0x07
45 #define MODULE_DB_SUPPORT_END_ID 0x08
46 #define MODULE_DB_STOP_START_ID 0x09
47 #define MODULE_DB_STOP_END_ID 0x0A
49 #define PERF_EVENTSIGNAL_START_ID 0x10
50 #define PERF_EVENTSIGNAL_END_ID 0x11
51 #define PERF_CALLBACK_START_ID 0x20
52 #define PERF_CALLBACK_END_ID 0x21
53 #define PERF_FUNCTION_START_ID 0x30
54 #define PERF_FUNCTION_END_ID 0x31
55 #define PERF_INMODULE_START_ID 0x40
56 #define PERF_INMODULE_END_ID 0x41
57 #define PERF_CROSSMODULE_START_ID 0x50
58 #define PERF_CROSSMODULE_END_ID 0x51
63 #define FPDT_RECORD_REVISION_1 (0x01)
66 // Length field in EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER is a UINT8, thus:
68 #define FPDT_MAX_PERF_RECORD_SIZE (MAX_UINT8)
73 #define FPDT_GUID_EVENT_TYPE 0x1010
74 #define FPDT_DYNAMIC_STRING_EVENT_TYPE 0x1011
75 #define FPDT_DUAL_GUID_STRING_EVENT_TYPE 0x1012
76 #define FPDT_GUID_QWORD_EVENT_TYPE 0x1013
77 #define FPDT_GUID_QWORD_STRING_EVENT_TYPE 0x1014
80 // EDKII extended Fpdt record structures
82 #define FPDT_STRING_EVENT_RECORD_NAME_LENGTH 24
86 // FPDT Boot Performance Guid Event Record Structure
89 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header
;
91 /// ProgressID < 0x10 are reserved for core performance entries.
92 /// Start measurement point shall have lowered one nibble set to zero and
93 /// corresponding end points shall have lowered one nibble set to non-zero value;
94 /// keeping other nibbles same as start point.
98 /// APIC ID for the processor in the system used as a timestamp clock source.
99 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.
103 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
107 /// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID of the module logging the event.
110 } FPDT_GUID_EVENT_RECORD
;
113 // FPDT Boot Performance Dynamic String Event Record Structure
116 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header
;
118 /// ProgressID < 0x10 are reserved for core performance entries.
119 /// Start measurement point shall have lowered one nibble set to zero and
120 /// corresponding end points shall have lowered one nibble set to non-zero value;
121 /// keeping other nibbles same as start point.
125 /// APIC ID for the processor in the system used as a timestamp clock source.
126 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.
130 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
134 /// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID of the module logging the event.
138 /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).
139 /// It may be module name, function name, or token name.
142 } FPDT_DYNAMIC_STRING_EVENT_RECORD
;
145 // FPDT Boot Performance Dual GUID String Event Record Structure
148 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header
;
150 /// ProgressID < 0x10 are reserved for core performance entries.
151 /// Start measurement point shall have lowered one nibble set to zero and
152 /// corresponding end points shall have lowered one nibble set to non-zero value;
153 /// keeping other nibbles same as start point.
157 /// APIC ID for the processor in the system used as a timestamp clock source.
158 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.
162 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
166 /// GUID of the module logging the event.
170 /// Event or Ppi or Protocol GUID for Callback.
174 /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).
175 /// It is the function name.
178 } FPDT_DUAL_GUID_STRING_EVENT_RECORD
;
181 // FPDT Boot Performance GUID Qword 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
209 } FPDT_GUID_QWORD_EVENT_RECORD
;
212 // FPDT Boot Performance GUID Qword String Event Record Structure
215 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header
;
217 /// ProgressID < 0x10 are reserved for core performance entries.
218 /// Start measurement point shall have lowered one nibble set to zero and
219 /// corresponding end points shall have lowered one nibble set to non-zero value;
220 /// keeping other nibbles same as start point.
224 /// APIC ID for the processor in the system used as a timestamp clock source.
225 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.
229 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
233 /// GUID of the module logging the event
237 /// Qword of misc data, meaning depends on the ProgressId
241 /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).
244 } FPDT_GUID_QWORD_STRING_EVENT_RECORD
;
252 } FPDT_BASIC_RECORD_INFO
;
255 // Union of all FPDT records
258 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER RecordHeader
;
259 FPDT_GUID_EVENT_RECORD GuidEvent
;
260 FPDT_DYNAMIC_STRING_EVENT_RECORD DynamicStringEvent
;
261 FPDT_DUAL_GUID_STRING_EVENT_RECORD DualGuidStringEvent
;
262 FPDT_GUID_QWORD_EVENT_RECORD GuidQwordEvent
;
263 FPDT_GUID_QWORD_STRING_EVENT_RECORD GuidQwordStringEvent
;
267 // Union of all pointers to FPDT records
270 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER
*RecordHeader
;
271 FPDT_GUID_EVENT_RECORD
*GuidEvent
;
272 FPDT_DYNAMIC_STRING_EVENT_RECORD
*DynamicStringEvent
;
273 FPDT_DUAL_GUID_STRING_EVENT_RECORD
*DualGuidStringEvent
;
274 FPDT_GUID_QWORD_EVENT_RECORD
*GuidQwordEvent
;
275 FPDT_GUID_QWORD_STRING_EVENT_RECORD
*GuidQwordStringEvent
;
280 /// GUID - gEdkiiFpdtExtendedFirmwarePerformanceGuid;
281 /// Data - FPDT_PEI_EXT_PERF_HEADER + one or more FPDT records
284 UINT32 SizeOfAllEntries
;
285 UINT32 LoadImageCount
;
287 } FPDT_PEI_EXT_PERF_HEADER
;
289 extern EFI_GUID gEdkiiFpdtExtendedFirmwarePerformanceGuid
;