]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h
MdeModulePkg: Update performance library instances
[mirror_edk2.git] / MdeModulePkg / Include / Guid / ExtendedFirmwarePerformance.h
CommitLineData
73fef64f
LG
1/** @file\r
2 This file defines edk2 extended firmware performance records.\r
3 These records will be added into ACPI FPDT Firmware Basic Boot Performance Table.\r
4\r
5Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
6This program and the accompanying materials are licensed and made available under\r
7the terms and conditions of the BSD License that accompanies this distribution.\r
8The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php.\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef __EXTENDED_FIRMWARE_PERFORMANCE_H__\r
17#define __EXTENDED_FIRMWARE_PERFORMANCE_H__\r
18\r
19#include <IndustryStandard/Acpi.h>\r
20\r
21//\r
22// Known performance tokens\r
23//\r
24#define SEC_TOK "SEC" ///< SEC Phase\r
25#define DXE_TOK "DXE" ///< DXE Phase\r
26#define PEI_TOK "PEI" ///< PEI Phase\r
27#define BDS_TOK "BDS" ///< BDS Phase\r
28#define DRIVERBINDING_START_TOK "DB:Start:" ///< Driver Binding Start() function call\r
29#define DRIVERBINDING_SUPPORT_TOK "DB:Support:" ///< Driver Binding Support() function call\r
30#define DRIVERBINDING_STOP_TOK "DB:Stop:" ///< Driver Binding Stop() function call\r
31#define LOAD_IMAGE_TOK "LoadImage:" ///< Load a dispatched module\r
32#define START_IMAGE_TOK "StartImage:" ///< Dispatched Modules Entry Point execution\r
33#define PEIM_TOK "PEIM" ///< PEIM Modules Entry Point execution\r
34\r
73fef64f
LG
35//\r
36// Misc defines\r
37//\r
38#define FPDT_RECORD_REVISION_1 (0x01)\r
39\r
40//\r
41// Length field in EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER is a UINT8, thus:\r
42//\r
43#define FPDT_MAX_PERF_RECORD_SIZE (MAX_UINT8)\r
44\r
45//\r
46// FPDT Record Types\r
47//\r
48#define FPDT_GUID_EVENT_TYPE 0x1010\r
49#define FPDT_DYNAMIC_STRING_EVENT_TYPE 0x1011\r
50#define FPDT_DUAL_GUID_STRING_EVENT_TYPE 0x1012\r
51#define FPDT_GUID_QWORD_EVENT_TYPE 0x1013\r
52#define FPDT_GUID_QWORD_STRING_EVENT_TYPE 0x1014\r
53\r
54//\r
55// EDKII extended Fpdt record structures\r
56//\r
57#define FPDT_STRING_EVENT_RECORD_NAME_LENGTH 24\r
58\r
59#pragma pack(1)\r
60//\r
61// FPDT Boot Performance Guid Event Record Structure\r
62//\r
63typedef struct {\r
64 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;\r
65 ///\r
66 /// ProgressID < 0x10 are reserved for core performance entries.\r
67 /// Start measurement point shall have lowered one nibble set to zero and\r
68 /// corresponding end points shall have lowered one nibble set to non-zero value;\r
69 /// keeping other nibbles same as start point.\r
70 ///\r
71 UINT16 ProgressID;\r
72 ///\r
73 /// APIC ID for the processor in the system used as a timestamp clock source.\r
74 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.\r
75 ///\r
76 UINT32 ApicID;\r
77 ///\r
78 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.\r
79 ///\r
80 UINT64 Timestamp;\r
81 ///\r
82 /// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID of the module logging the event.\r
83 ///\r
84 EFI_GUID Guid;\r
85} FPDT_GUID_EVENT_RECORD;\r
86\r
87//\r
88// FPDT Boot Performance Dynamic String Event Record Structure\r
89//\r
90typedef struct {\r
91 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;\r
92 ///\r
93 /// ProgressID < 0x10 are reserved for core performance entries.\r
94 /// Start measurement point shall have lowered one nibble set to zero and\r
95 /// corresponding end points shall have lowered one nibble set to non-zero value;\r
96 /// keeping other nibbles same as start point.\r
97 ///\r
98 UINT16 ProgressID;\r
99 ///\r
100 /// APIC ID for the processor in the system used as a timestamp clock source.\r
101 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.\r
102 ///\r
103 UINT32 ApicID;\r
104 ///\r
105 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.\r
106 ///\r
107 UINT64 Timestamp;\r
108 ///\r
109 /// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID of the module logging the event.\r
110 ///\r
111 EFI_GUID Guid;\r
112 ///\r
113 /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).\r
114 /// It may be module name, function name, or token name.\r
115 ///\r
116 CHAR8 String[0];\r
117} FPDT_DYNAMIC_STRING_EVENT_RECORD;\r
118\r
119//\r
120// FPDT Boot Performance Dual GUID String Event Record Structure\r
121//\r
122typedef struct {\r
123 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;\r
124 ///\r
125 /// ProgressID < 0x10 are reserved for core performance entries.\r
126 /// Start measurement point shall have lowered one nibble set to zero and\r
127 /// corresponding end points shall have lowered one nibble set to non-zero value;\r
128 /// keeping other nibbles same as start point.\r
129 ///\r
130 UINT16 ProgressID;\r
131 ///\r
132 /// APIC ID for the processor in the system used as a timestamp clock source.\r
133 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.\r
134 ///\r
135 UINT32 ApicID;\r
136 ///\r
137 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.\r
138 ///\r
139 UINT64 Timestamp;\r
140 ///\r
141 /// GUID of the module logging the event.\r
142 ///\r
143 EFI_GUID Guid1;\r
144 ///\r
145 /// Event or Ppi or Protocol GUID for Callback.\r
146 ///\r
147 EFI_GUID Guid2;\r
148 ///\r
149 /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).\r
150 /// It is the function name.\r
151 ///\r
152 CHAR8 String[0];\r
153} FPDT_DUAL_GUID_STRING_EVENT_RECORD;\r
154\r
155//\r
156// FPDT Boot Performance GUID Qword Event Record Structure\r
157//\r
158typedef struct {\r
159 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;\r
160 ///\r
161 /// ProgressID < 0x10 are reserved for core performance entries.\r
162 /// Start measurement point shall have lowered one nibble set to zero and\r
163 /// corresponding end points shall have lowered one nibble set to non-zero value;\r
164 /// keeping other nibbles same as start point.\r
165 ///\r
166 UINT16 ProgressID;\r
167 ///\r
168 /// APIC ID for the processor in the system used as a timestamp clock source.\r
169 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.\r
170 ///\r
171 UINT32 ApicID;\r
172 ///\r
173 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.\r
174 ///\r
175 UINT64 Timestamp;\r
176 ///\r
177 /// GUID of the module logging the event\r
178 ///\r
179 EFI_GUID Guid;\r
180 ///\r
181 /// Qword of misc data, meaning depends on the ProgressId\r
182 ///\r
183 UINT64 Qword;\r
184} FPDT_GUID_QWORD_EVENT_RECORD;\r
185\r
186//\r
187// FPDT Boot Performance GUID Qword String Event Record Structure\r
188//\r
189typedef struct {\r
190 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;\r
191 ///\r
192 /// ProgressID < 0x10 are reserved for core performance entries.\r
193 /// Start measurement point shall have lowered one nibble set to zero and\r
194 /// corresponding end points shall have lowered one nibble set to non-zero value;\r
195 /// keeping other nibbles same as start point.\r
196 ///\r
197 UINT16 ProgressID;\r
198 ///\r
199 /// APIC ID for the processor in the system used as a timestamp clock source.\r
200 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.\r
201 ///\r
202 UINT32 ApicID;\r
203 ///\r
204 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.\r
205 ///\r
206 UINT64 Timestamp;\r
207 ///\r
208 /// GUID of the module logging the event\r
209 ///\r
210 EFI_GUID Guid;\r
211 ///\r
212 /// Qword of misc data, meaning depends on the ProgressId\r
213 ///\r
214 UINT64 Qword;\r
215 ///\r
216 /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).\r
217 ///\r
218 CHAR8 String[0];\r
219} FPDT_GUID_QWORD_STRING_EVENT_RECORD;\r
220\r
221#pragma pack()\r
222\r
73fef64f
LG
223//\r
224// Union of all FPDT records\r
225//\r
226typedef union {\r
227 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER RecordHeader;\r
228 FPDT_GUID_EVENT_RECORD GuidEvent;\r
229 FPDT_DYNAMIC_STRING_EVENT_RECORD DynamicStringEvent;\r
230 FPDT_DUAL_GUID_STRING_EVENT_RECORD DualGuidStringEvent;\r
231 FPDT_GUID_QWORD_EVENT_RECORD GuidQwordEvent;\r
232 FPDT_GUID_QWORD_STRING_EVENT_RECORD GuidQwordStringEvent;\r
233} FPDT_RECORD;\r
234\r
235//\r
236// Union of all pointers to FPDT records\r
237//\r
238typedef union {\r
239 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER *RecordHeader;\r
240 FPDT_GUID_EVENT_RECORD *GuidEvent;\r
241 FPDT_DYNAMIC_STRING_EVENT_RECORD *DynamicStringEvent;\r
242 FPDT_DUAL_GUID_STRING_EVENT_RECORD *DualGuidStringEvent;\r
243 FPDT_GUID_QWORD_EVENT_RECORD *GuidQwordEvent;\r
244 FPDT_GUID_QWORD_STRING_EVENT_RECORD *GuidQwordStringEvent;\r
245} FPDT_RECORD_PTR;\r
246\r
247///\r
248/// Hob:\r
249/// GUID - gEdkiiFpdtExtendedFirmwarePerformanceGuid;\r
250/// Data - FPDT_PEI_EXT_PERF_HEADER + one or more FPDT records\r
251///\r
252typedef struct {\r
253 UINT32 SizeOfAllEntries;\r
254 UINT32 LoadImageCount;\r
255 UINT32 HobIsFull;\r
256} FPDT_PEI_EXT_PERF_HEADER;\r
257\r
258extern EFI_GUID gEdkiiFpdtExtendedFirmwarePerformanceGuid;\r
259\r
260#endif\r