TianoCore EDK2 master
Loading...
Searching...
No Matches
Performance.h
Go to the documentation of this file.
1
12#ifndef __PERFORMANCE_DATA_H__
13#define __PERFORMANCE_DATA_H__
14
15#define PERFORMANCE_PROPERTY_REVISION 0x1
16
17typedef struct {
18 UINT32 Revision;
19 UINT32 Reserved;
20 UINT64 Frequency;
21 UINT64 TimerStartValue;
22 UINT64 TimerEndValue;
24
25//
26// PEI_PERFORMANCE_STRING_SIZE must be a multiple of 8.
27//
28#define PEI_PERFORMANCE_STRING_SIZE 8
29#define PEI_PERFORMANCE_STRING_LENGTH (PEI_PERFORMANCE_STRING_SIZE - 1)
30
31typedef struct {
33 CHAR8 Token[PEI_PERFORMANCE_STRING_SIZE];
34 CHAR8 Module[PEI_PERFORMANCE_STRING_SIZE];
36 UINT64 EndTimeStamp;
38
39//
40// The header must be aligned at 8 bytes.
41//
42typedef struct {
44 UINT32 Reserved;
46
47#define PERFORMANCE_PROTOCOL_GUID \
48 { 0x76b6bdfa, 0x2acd, 0x4462, { 0x9E, 0x3F, 0xcb, 0x58, 0xC9, 0x69, 0xd9, 0x37 } }
49
50#define PERFORMANCE_EX_PROTOCOL_GUID \
51 { 0x1ea81bec, 0xf01a, 0x4d98, { 0xa2, 0x1, 0x4a, 0x61, 0xce, 0x2f, 0xc0, 0x22 } }
52
53//
54// Forward reference for pure ANSI compatibility
55//
58
59//
60// DXE_PERFORMANCE_STRING_SIZE must be a multiple of 8.
61//
62#define DXE_PERFORMANCE_STRING_SIZE 32
63#define DXE_PERFORMANCE_STRING_LENGTH (DXE_PERFORMANCE_STRING_SIZE - 1)
64
65//
66// The default guage entries number for DXE phase.
67//
68#define INIT_DXE_GAUGE_DATA_ENTRIES 800
69
70typedef struct {
72 CHAR8 Token[DXE_PERFORMANCE_STRING_SIZE];
73 CHAR8 Module[DXE_PERFORMANCE_STRING_SIZE];
75 UINT64 EndTimeStamp;
77
78typedef struct {
80 CHAR8 Token[DXE_PERFORMANCE_STRING_SIZE];
81 CHAR8 Module[DXE_PERFORMANCE_STRING_SIZE];
83 UINT64 EndTimeStamp;
84 UINT32 Identifier;
86
87//
88// The header must be aligned at 8 bytes
89//
90typedef struct {
92 UINT32 Reserved;
94
95//
96// SMM Performance Protocol definitions
97//
98
99#define SMM_PERFORMANCE_PROTOCOL_GUID \
100 { 0xf866226a, 0xeaa5, 0x4f5a, { 0xa9, 0xa, 0x6c, 0xfb, 0xa5, 0x7c, 0x58, 0x8e } }
101
102#define SMM_PERFORMANCE_EX_PROTOCOL_GUID \
103 { 0x931fc048, 0xc71d, 0x4455, { 0x89, 0x30, 0x47, 0x6, 0x30, 0xe3, 0xe, 0xe5 } }
104
105//
106// SMM_PERFORMANCE_STRING_SIZE.
107//
108#define SMM_PERFORMANCE_STRING_SIZE 32
109#define SMM_PERFORMANCE_STRING_LENGTH (SMM_PERFORMANCE_STRING_SIZE - 1)
110
111//
112// The default guage entries number for SMM phase.
113//
114#define INIT_SMM_GAUGE_DATA_ENTRIES 200
115
116typedef struct {
117 UINTN Function;
118 EFI_STATUS ReturnStatus;
119 UINTN NumberOfEntries;
120 UINTN LogEntryKey;
121 GAUGE_DATA_ENTRY *GaugeData;
123
124typedef struct {
125 UINTN Function;
126 EFI_STATUS ReturnStatus;
127 UINTN NumberOfEntries;
128 UINTN LogEntryKey;
129 GAUGE_DATA_ENTRY_EX *GaugeDataEx;
131
132#define SMM_PERF_FUNCTION_GET_GAUGE_ENTRY_NUMBER 1
133#define SMM_PERF_FUNCTION_GET_GAUGE_DATA 2
134
157typedef
160 IN CONST VOID *Handle OPTIONAL,
161 IN CONST CHAR8 *Token OPTIONAL,
162 IN CONST CHAR8 *Module OPTIONAL,
163 IN UINT64 TimeStamp
164 );
165
190typedef
192(EFIAPI *PERFORMANCE_END_GAUGE)(
193 IN CONST VOID *Handle OPTIONAL,
194 IN CONST CHAR8 *Token OPTIONAL,
195 IN CONST CHAR8 *Module OPTIONAL,
196 IN UINT64 TimeStamp
197 );
198
217typedef
219(EFIAPI *PERFORMANCE_GET_GAUGE)(
220 IN UINTN LogEntryKey,
221 OUT GAUGE_DATA_ENTRY **GaugeDataEntry
222 );
223
248typedef
251 IN CONST VOID *Handle OPTIONAL,
252 IN CONST CHAR8 *Token OPTIONAL,
253 IN CONST CHAR8 *Module OPTIONAL,
254 IN UINT64 TimeStamp,
255 IN UINT32 Identifier
256 );
257
284typedef
287 IN CONST VOID *Handle OPTIONAL,
288 IN CONST CHAR8 *Token OPTIONAL,
289 IN CONST CHAR8 *Module OPTIONAL,
290 IN UINT64 TimeStamp,
291 IN UINT32 Identifier
292 );
293
312typedef
315 IN UINTN LogEntryKey,
316 OUT GAUGE_DATA_ENTRY_EX **GaugeDataEntryEx
317 );
318
320 PERFORMANCE_START_GAUGE StartGauge;
321 PERFORMANCE_END_GAUGE EndGauge;
322 PERFORMANCE_GET_GAUGE GetGauge;
323};
324
326 PERFORMANCE_START_GAUGE_EX StartGaugeEx;
327 PERFORMANCE_END_GAUGE_EX EndGaugeEx;
328 PERFORMANCE_GET_GAUGE_EX GetGaugeEx;
329};
330
331extern EFI_GUID gPerformanceProtocolGuid;
332extern EFI_GUID gSmmPerformanceProtocolGuid;
333extern EFI_GUID gPerformanceExProtocolGuid;
334extern EFI_GUID gSmmPerformanceExProtocolGuid;
335
336#endif
UINT64 UINTN
#define CONST
Definition: Base.h:259
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * PERFORMANCE_START_GAUGE)(IN CONST VOID *Handle OPTIONAL, IN CONST CHAR8 *Token OPTIONAL, IN CONST CHAR8 *Module OPTIONAL, IN UINT64 TimeStamp)
Definition: Performance.h:159
EFI_STATUS(EFIAPI * PERFORMANCE_END_GAUGE)(IN CONST VOID *Handle OPTIONAL, IN CONST CHAR8 *Token OPTIONAL, IN CONST CHAR8 *Module OPTIONAL, IN UINT64 TimeStamp)
Definition: Performance.h:192
EFI_STATUS(EFIAPI * PERFORMANCE_START_GAUGE_EX)(IN CONST VOID *Handle OPTIONAL, IN CONST CHAR8 *Token OPTIONAL, IN CONST CHAR8 *Module OPTIONAL, IN UINT64 TimeStamp, IN UINT32 Identifier)
Definition: Performance.h:250
EFI_STATUS(EFIAPI * PERFORMANCE_GET_GAUGE_EX)(IN UINTN LogEntryKey, OUT GAUGE_DATA_ENTRY_EX **GaugeDataEntryEx)
Definition: Performance.h:314
EFI_STATUS(EFIAPI * PERFORMANCE_END_GAUGE_EX)(IN CONST VOID *Handle OPTIONAL, IN CONST CHAR8 *Token OPTIONAL, IN CONST CHAR8 *Module OPTIONAL, IN UINT64 TimeStamp, IN UINT32 Identifier)
Definition: Performance.h:286
EFI_STATUS(EFIAPI * PERFORMANCE_GET_GAUGE)(IN UINTN LogEntryKey, OUT GAUGE_DATA_ENTRY **GaugeDataEntry)
Definition: Performance.h:219
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
UINT32 Identifier
Identifier.
Definition: Performance.h:84
UINT64 EndTimeStamp
End time point.
Definition: Performance.h:83
UINT64 StartTimeStamp
Start time point.
Definition: Performance.h:82
UINT64 EndTimeStamp
End time point.
Definition: Performance.h:75
UINT64 StartTimeStamp
Start time point.
Definition: Performance.h:74
UINT32 NumberOfEntries
The number of all performance gauge entries.
Definition: Performance.h:91
Definition: Base.h:213
UINT64 StartTimeStamp
Start time point.
Definition: Performance.h:35
UINT64 EndTimeStamp
End time point.
Definition: Performance.h:36
UINT32 NumberOfEntries
The number of all performance log entries.
Definition: Performance.h:43