TianoCore EDK2 master
Loading...
Searching...
No Matches
PerformanceLib.c
Go to the documentation of this file.
1
9#include <Base.h>
10
12#include <Library/DebugLib.h>
13#include <Library/PcdLib.h>
14
36RETURN_STATUS
37EFIAPI
39 IN CONST VOID *Handle OPTIONAL,
40 IN CONST CHAR8 *Token OPTIONAL,
41 IN CONST CHAR8 *Module OPTIONAL,
42 IN UINT64 TimeStamp
43 )
44{
45 return RETURN_SUCCESS;
46}
47
71RETURN_STATUS
72EFIAPI
74 IN CONST VOID *Handle OPTIONAL,
75 IN CONST CHAR8 *Token OPTIONAL,
76 IN CONST CHAR8 *Module OPTIONAL,
77 IN UINT64 TimeStamp
78 )
79{
80 return RETURN_SUCCESS;
81}
82
122UINTN
123EFIAPI
125 IN UINTN LogEntryKey,
126 OUT CONST VOID **Handle,
127 OUT CONST CHAR8 **Token,
128 OUT CONST CHAR8 **Module,
129 OUT UINT64 *StartTimeStamp,
130 OUT UINT64 *EndTimeStamp
131 )
132{
133 ASSERT (Handle != NULL);
134 ASSERT (Token != NULL);
135 ASSERT (Module != NULL);
136 ASSERT (StartTimeStamp != NULL);
137 ASSERT (EndTimeStamp != NULL);
138
139 return 0;
140}
141
165RETURN_STATUS
166EFIAPI
168 IN CONST VOID *Handle OPTIONAL,
169 IN CONST CHAR8 *Token OPTIONAL,
170 IN CONST CHAR8 *Module OPTIONAL,
171 IN UINT64 TimeStamp,
172 IN UINT32 Identifier
173 )
174{
175 return RETURN_SUCCESS;
176}
177
203RETURN_STATUS
204EFIAPI
206 IN CONST VOID *Handle OPTIONAL,
207 IN CONST CHAR8 *Token OPTIONAL,
208 IN CONST CHAR8 *Module OPTIONAL,
209 IN UINT64 TimeStamp,
210 IN UINT32 Identifier
211 )
212{
213 return RETURN_SUCCESS;
214}
215
257UINTN
258EFIAPI
260 IN UINTN LogEntryKey,
261 OUT CONST VOID **Handle,
262 OUT CONST CHAR8 **Token,
263 OUT CONST CHAR8 **Module,
264 OUT UINT64 *StartTimeStamp,
265 OUT UINT64 *EndTimeStamp,
266 OUT UINT32 *Identifier
267 )
268{
269 ASSERT (Handle != NULL);
270 ASSERT (Token != NULL);
271 ASSERT (Module != NULL);
272 ASSERT (StartTimeStamp != NULL);
273 ASSERT (EndTimeStamp != NULL);
274 ASSERT (Identifier != NULL);
275
276 return 0;
277}
278
291BOOLEAN
292EFIAPI
294 VOID
295 )
296{
297 return (BOOLEAN)((PcdGet8 (PcdPerformanceLibraryPropertyMask) & PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED) != 0);
298}
299
315RETURN_STATUS
316EFIAPI
318 IN CONST VOID *CallerIdentifier OPTIONAL,
319 IN CONST VOID *Guid OPTIONAL,
320 IN CONST CHAR8 *String OPTIONAL,
321 IN UINT64 Address OPTIONAL,
322 IN UINT32 Identifier
323 )
324{
325 return RETURN_SUCCESS;
326}
327
340BOOLEAN
341EFIAPI
343 IN CONST UINTN Type
344 )
345{
346 //
347 // When Performance measurement is enabled and the type is not filtered, the performance can be logged.
348 //
349 if (PerformanceMeasurementEnabled () && ((PcdGet8 (PcdPerformanceLibraryPropertyMask) & Type) == 0)) {
350 return TRUE;
351 }
352
353 return FALSE;
354}
UINT64 UINTN
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define RETURN_SUCCESS
Definition: Base.h:1066
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define PcdGet8(TokenName)
Definition: PcdLib.h:336
RETURN_STATUS EFIAPI EndPerformanceMeasurementEx(IN CONST VOID *Handle OPTIONAL, IN CONST CHAR8 *Token OPTIONAL, IN CONST CHAR8 *Module OPTIONAL, IN UINT64 TimeStamp, IN UINT32 Identifier)
UINTN EFIAPI GetPerformanceMeasurement(IN UINTN LogEntryKey, OUT CONST VOID **Handle, OUT CONST CHAR8 **Token, OUT CONST CHAR8 **Module, OUT UINT64 *StartTimeStamp, OUT UINT64 *EndTimeStamp)
RETURN_STATUS EFIAPI StartPerformanceMeasurementEx(IN CONST VOID *Handle OPTIONAL, IN CONST CHAR8 *Token OPTIONAL, IN CONST CHAR8 *Module OPTIONAL, IN UINT64 TimeStamp, IN UINT32 Identifier)
BOOLEAN EFIAPI LogPerformanceMeasurementEnabled(IN CONST UINTN Type)
BOOLEAN EFIAPI PerformanceMeasurementEnabled(VOID)
UINTN EFIAPI GetPerformanceMeasurementEx(IN UINTN LogEntryKey, OUT CONST VOID **Handle, OUT CONST CHAR8 **Token, OUT CONST CHAR8 **Module, OUT UINT64 *StartTimeStamp, OUT UINT64 *EndTimeStamp, OUT UINT32 *Identifier)
RETURN_STATUS EFIAPI EndPerformanceMeasurement(IN CONST VOID *Handle OPTIONAL, IN CONST CHAR8 *Token OPTIONAL, IN CONST CHAR8 *Module OPTIONAL, IN UINT64 TimeStamp)
RETURN_STATUS EFIAPI LogPerformanceMeasurement(IN CONST VOID *CallerIdentifier OPTIONAL, IN CONST VOID *Guid OPTIONAL, IN CONST CHAR8 *String OPTIONAL, IN UINT64 Address OPTIONAL, IN UINT32 Identifier)
RETURN_STATUS EFIAPI StartPerformanceMeasurement(IN CONST VOID *Handle OPTIONAL, IN CONST CHAR8 *Token OPTIONAL, IN CONST CHAR8 *Module OPTIONAL, IN UINT64 TimeStamp)
#define PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED