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