]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Master header files for DxeCorePerformanceLib instance.\r | |
3 | \r | |
4 | This header file holds the prototypes of the Performance and PerformanceEx Protocol published by this\r | |
5 | library instance at its constructor.\r | |
6 | \r | |
7 | Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r | |
8 | This program and the accompanying materials\r | |
9 | are licensed and made available under the terms and conditions of the BSD License\r | |
10 | which accompanies this distribution. The full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_\r | |
19 | #define _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_\r | |
20 | \r | |
21 | \r | |
22 | #include <PiDxe.h>\r | |
23 | \r | |
24 | #include <Guid/Performance.h>\r | |
25 | \r | |
26 | #include <Library/PerformanceLib.h>\r | |
27 | #include <Library/DebugLib.h>\r | |
28 | #include <Library/HobLib.h>\r | |
29 | #include <Library/BaseLib.h>\r | |
30 | #include <Library/BaseMemoryLib.h>\r | |
31 | #include <Library/TimerLib.h>\r | |
32 | #include <Library/PcdLib.h>\r | |
33 | #include <Library/UefiBootServicesTableLib.h>\r | |
34 | #include <Library/MemoryAllocationLib.h>\r | |
35 | #include <Library/UefiLib.h>\r | |
36 | \r | |
37 | //\r | |
38 | // Interface declarations for PerformanceEx Protocol.\r | |
39 | //\r | |
40 | /**\r | |
41 | Adds a record at the end of the performance measurement log\r | |
42 | that records the start time of a performance measurement.\r | |
43 | \r | |
44 | Adds a record to the end of the performance measurement log\r | |
45 | that contains the Handle, Token, Module and Identifier.\r | |
46 | The end time of the new record must be set to zero.\r | |
47 | If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.\r | |
48 | If TimeStamp is zero, the start time in the record is filled in with the value\r | |
49 | read from the current time stamp.\r | |
50 | \r | |
51 | @param Handle Pointer to environment specific context used\r | |
52 | to identify the component being measured.\r | |
53 | @param Token Pointer to a Null-terminated ASCII string\r | |
54 | that identifies the component being measured.\r | |
55 | @param Module Pointer to a Null-terminated ASCII string\r | |
56 | that identifies the module being measured.\r | |
57 | @param TimeStamp 64-bit time stamp.\r | |
58 | @param Identifier 32-bit identifier. If the value is 0, the created record\r | |
59 | is same as the one created by StartGauge of PERFORMANCE_PROTOCOL.\r | |
60 | \r | |
61 | @retval EFI_SUCCESS The data was read correctly from the device.\r | |
62 | @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.\r | |
63 | \r | |
64 | **/\r | |
65 | EFI_STATUS\r | |
66 | EFIAPI\r | |
67 | StartGaugeEx (\r | |
68 | IN CONST VOID *Handle, OPTIONAL\r | |
69 | IN CONST CHAR8 *Token, OPTIONAL\r | |
70 | IN CONST CHAR8 *Module, OPTIONAL\r | |
71 | IN UINT64 TimeStamp,\r | |
72 | IN UINT32 Identifier\r | |
73 | );\r | |
74 | \r | |
75 | /**\r | |
76 | Searches the performance measurement log from the beginning of the log\r | |
77 | for the first matching record that contains a zero end time and fills in a valid end time.\r | |
78 | \r | |
79 | Searches the performance measurement log from the beginning of the log\r | |
80 | for the first record that matches Handle, Token, Module and Identifier and has an end time value of zero.\r | |
81 | If the record can not be found then return EFI_NOT_FOUND.\r | |
82 | If the record is found and TimeStamp is not zero,\r | |
83 | then the end time in the record is filled in with the value specified by TimeStamp.\r | |
84 | If the record is found and TimeStamp is zero, then the end time in the matching record\r | |
85 | is filled in with the current time stamp value.\r | |
86 | \r | |
87 | @param Handle Pointer to environment specific context used\r | |
88 | to identify the component being measured.\r | |
89 | @param Token Pointer to a Null-terminated ASCII string\r | |
90 | that identifies the component being measured.\r | |
91 | @param Module Pointer to a Null-terminated ASCII string\r | |
92 | that identifies the module being measured.\r | |
93 | @param TimeStamp 64-bit time stamp.\r | |
94 | @param Identifier 32-bit identifier. If the value is 0, the found record\r | |
95 | is same as the one found by EndGauge of PERFORMANCE_PROTOCOL.\r | |
96 | \r | |
97 | @retval EFI_SUCCESS The end of the measurement was recorded.\r | |
98 | @retval EFI_NOT_FOUND The specified measurement record could not be found.\r | |
99 | \r | |
100 | **/\r | |
101 | EFI_STATUS\r | |
102 | EFIAPI\r | |
103 | EndGaugeEx (\r | |
104 | IN CONST VOID *Handle, OPTIONAL\r | |
105 | IN CONST CHAR8 *Token, OPTIONAL\r | |
106 | IN CONST CHAR8 *Module, OPTIONAL\r | |
107 | IN UINT64 TimeStamp,\r | |
108 | IN UINT32 Identifier\r | |
109 | );\r | |
110 | \r | |
111 | /**\r | |
112 | Retrieves a previously logged performance measurement.\r | |
113 | It can also retrieve the log created by StartGauge and EndGauge of PERFORMANCE_PROTOCOL,\r | |
114 | and then assign the Identifier with 0.\r | |
115 | \r | |
116 | Retrieves the performance log entry from the performance log specified by LogEntryKey.\r | |
117 | If it stands for a valid entry, then EFI_SUCCESS is returned and\r | |
118 | GaugeDataEntryEx stores the pointer to that entry.\r | |
119 | \r | |
120 | @param LogEntryKey The key for the previous performance measurement log entry.\r | |
121 | If 0, then the first performance measurement log entry is retrieved.\r | |
122 | @param GaugeDataEntryEx The indirect pointer to the extended gauge data entry specified by LogEntryKey\r | |
123 | if the retrieval is successful.\r | |
124 | \r | |
125 | @retval EFI_SUCCESS The GuageDataEntryEx is successfully found based on LogEntryKey.\r | |
126 | @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).\r | |
127 | @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).\r | |
128 | @retval EFI_INVALIDE_PARAMETER GaugeDataEntryEx is NULL.\r | |
129 | \r | |
130 | **/\r | |
131 | EFI_STATUS\r | |
132 | EFIAPI\r | |
133 | GetGaugeEx (\r | |
134 | IN UINTN LogEntryKey,\r | |
135 | OUT GAUGE_DATA_ENTRY_EX **GaugeDataEntryEx\r | |
136 | );\r | |
137 | \r | |
138 | //\r | |
139 | // Interface declarations for Performance Protocol.\r | |
140 | //\r | |
141 | /**\r | |
142 | Adds a record at the end of the performance measurement log\r | |
143 | that records the start time of a performance measurement.\r | |
144 | \r | |
145 | Adds a record to the end of the performance measurement log\r | |
146 | that contains the Handle, Token, and Module.\r | |
147 | The end time of the new record must be set to zero.\r | |
148 | If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.\r | |
149 | If TimeStamp is zero, the start time in the record is filled in with the value\r | |
150 | read from the current time stamp.\r | |
151 | \r | |
152 | @param Handle Pointer to environment specific context used\r | |
153 | to identify the component being measured.\r | |
154 | @param Token Pointer to a Null-terminated ASCII string\r | |
155 | that identifies the component being measured.\r | |
156 | @param Module Pointer to a Null-terminated ASCII string\r | |
157 | that identifies the module being measured.\r | |
158 | @param TimeStamp 64-bit time stamp.\r | |
159 | \r | |
160 | @retval EFI_SUCCESS The data was read correctly from the device.\r | |
161 | @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.\r | |
162 | \r | |
163 | **/\r | |
164 | EFI_STATUS\r | |
165 | EFIAPI\r | |
166 | StartGauge (\r | |
167 | IN CONST VOID *Handle, OPTIONAL\r | |
168 | IN CONST CHAR8 *Token, OPTIONAL\r | |
169 | IN CONST CHAR8 *Module, OPTIONAL\r | |
170 | IN UINT64 TimeStamp\r | |
171 | );\r | |
172 | \r | |
173 | /**\r | |
174 | Searches the performance measurement log from the beginning of the log\r | |
175 | for the first matching record that contains a zero end time and fills in a valid end time.\r | |
176 | \r | |
177 | Searches the performance measurement log from the beginning of the log\r | |
178 | for the first record that matches Handle, Token, and Module and has an end time value of zero.\r | |
179 | If the record can not be found then return EFI_NOT_FOUND.\r | |
180 | If the record is found and TimeStamp is not zero,\r | |
181 | then the end time in the record is filled in with the value specified by TimeStamp.\r | |
182 | If the record is found and TimeStamp is zero, then the end time in the matching record\r | |
183 | is filled in with the current time stamp value.\r | |
184 | \r | |
185 | @param Handle Pointer to environment specific context used\r | |
186 | to identify the component being measured.\r | |
187 | @param Token Pointer to a Null-terminated ASCII string\r | |
188 | that identifies the component being measured.\r | |
189 | @param Module Pointer to a Null-terminated ASCII string\r | |
190 | that identifies the module being measured.\r | |
191 | @param TimeStamp 64-bit time stamp.\r | |
192 | \r | |
193 | @retval EFI_SUCCESS The end of the measurement was recorded.\r | |
194 | @retval EFI_NOT_FOUND The specified measurement record could not be found.\r | |
195 | \r | |
196 | **/\r | |
197 | EFI_STATUS\r | |
198 | EFIAPI\r | |
199 | EndGauge (\r | |
200 | IN CONST VOID *Handle, OPTIONAL\r | |
201 | IN CONST CHAR8 *Token, OPTIONAL\r | |
202 | IN CONST CHAR8 *Module, OPTIONAL\r | |
203 | IN UINT64 TimeStamp\r | |
204 | );\r | |
205 | \r | |
206 | /**\r | |
207 | Retrieves a previously logged performance measurement.\r | |
208 | It can also retrieve the log created by StartGaugeEx and EndGaugeEx of PERFORMANCE_EX_PROTOCOL,\r | |
209 | and then eliminate the Identifier.\r | |
210 | \r | |
211 | Retrieves the performance log entry from the performance log specified by LogEntryKey.\r | |
212 | If it stands for a valid entry, then EFI_SUCCESS is returned and\r | |
213 | GaugeDataEntry stores the pointer to that entry.\r | |
214 | \r | |
215 | @param LogEntryKey The key for the previous performance measurement log entry.\r | |
216 | If 0, then the first performance measurement log entry is retrieved.\r | |
217 | @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey\r | |
218 | if the retrieval is successful.\r | |
219 | \r | |
220 | @retval EFI_SUCCESS The GuageDataEntry is successfully found based on LogEntryKey.\r | |
221 | @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).\r | |
222 | @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).\r | |
223 | @retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.\r | |
224 | \r | |
225 | **/\r | |
226 | EFI_STATUS\r | |
227 | EFIAPI\r | |
228 | GetGauge (\r | |
229 | IN UINTN LogEntryKey,\r | |
230 | OUT GAUGE_DATA_ENTRY **GaugeDataEntry\r | |
231 | );\r | |
232 | \r | |
233 | \r | |
234 | #endif\r |