]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
Import Usb/UsbBusDxe and Usb/UsbMassStorageDxe into MdeModulePkg.
[mirror_edk2.git] / EdkModulePkg / Library / DxeCorePerformanceLib / DxeCorePerformanceLib.c
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 DxeCorePerformance.c
15
16 Abstract:
17
18 Support for measurement of DXE performance
19
20 --*/
21
22 //
23 // Interface declarations for Performance Protocol.
24 //
25 /**
26 Adds a record at the end of the performance measurement log
27 that records the start time of a performance measurement.
28
29 Adds a record to the end of the performance measurement log
30 that contains the Handle, Token, and Module.
31 The end time of the new record must be set to zero.
32 If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.
33 If TimeStamp is zero, the start time in the record is filled in with the value
34 read from the current time stamp.
35
36 @param Handle Pointer to environment specific context used
37 to identify the component being measured.
38 @param Token Pointer to a Null-terminated ASCII string
39 that identifies the component being measured.
40 @param Module Pointer to a Null-terminated ASCII string
41 that identifies the module being measured.
42 @param TimeStamp 64-bit time stamp.
43
44 @retval EFI_SUCCESS The data was read correctly from the device.
45 @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
46
47 **/
48 STATIC
49 EFI_STATUS
50 EFIAPI
51 StartGauge (
52 IN CONST VOID *Handle, OPTIONAL
53 IN CONST CHAR8 *Token, OPTIONAL
54 IN CONST CHAR8 *Module, OPTIONAL
55 IN UINT64 TimeStamp
56 );
57
58 /**
59 Searches the performance measurement log from the beginning of the log
60 for the first matching record that contains a zero end time and fills in a valid end time.
61
62 Searches the performance measurement log from the beginning of the log
63 for the first record that matches Handle, Token, and Module and has an end time value of zero.
64 If the record can not be found then return EFI_NOT_FOUND.
65 If the record is found and TimeStamp is not zero,
66 then the end time in the record is filled in with the value specified by TimeStamp.
67 If the record is found and TimeStamp is zero, then the end time in the matching record
68 is filled in with the current time stamp value.
69
70 @param Handle Pointer to environment specific context used
71 to identify the component being measured.
72 @param Token Pointer to a Null-terminated ASCII string
73 that identifies the component being measured.
74 @param Module Pointer to a Null-terminated ASCII string
75 that identifies the module being measured.
76 @param TimeStamp 64-bit time stamp.
77
78 @retval EFI_SUCCESS The end of the measurement was recorded.
79 @retval EFI_NOT_FOUND The specified measurement record could not be found.
80
81 **/
82 STATIC
83 EFI_STATUS
84 EFIAPI
85 EndGauge (
86 IN CONST VOID *Handle, OPTIONAL
87 IN CONST CHAR8 *Token, OPTIONAL
88 IN CONST CHAR8 *Module, OPTIONAL
89 IN UINT64 TimeStamp
90 );
91
92 /**
93 Retrieves a previously logged performance measurement.
94
95 Retrieves the performance log entry from the performance log specified by LogEntryKey.
96 If it stands for a valid entry, then EFI_SUCCESS is returned and
97 GaugeDataEntry stores the pointer to that entry.
98
99 @param LogEntryKey The key for the previous performance measurement log entry.
100 If 0, then the first performance measurement log entry is retrieved.
101 @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey
102 if the retrieval is successful.
103
104 @retval EFI_SUCCESS The GuageDataEntry is successfuly found based on LogEntryKey.
105 @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
106 @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
107 @retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.
108
109 **/
110 STATIC
111 EFI_STATUS
112 EFIAPI
113 GetGauge (
114 IN UINTN LogEntryKey,
115 OUT GAUGE_DATA_ENTRY **GaugeDataEntry
116 );
117
118 //
119 // Definition for global variables.
120 //
121 STATIC GAUGE_DATA_HEADER *mGaugeData;
122 STATIC UINT32 mMaxGaugeRecords;
123
124 EFI_HANDLE mHandle = NULL;
125 PERFORMANCE_PROTOCOL mPerformanceInterface = {
126 StartGauge,
127 EndGauge,
128 GetGauge
129 };
130
131
132 /**
133 Searches in the gauge array with keyword Handle, Token and Module.
134
135 This internal function searches for the gauge entry in the gauge array.
136 If there is an entry that exactly matches the given key word triple
137 and its end time stamp is zero, then the index of that gauge entry is returned;
138 otherwise, the the number of gauge entries in the array is returned.
139
140 @param Handle Pointer to environment specific context used
141 to identify the component being measured.
142 @param Token Pointer to a Null-terminated ASCII string
143 that identifies the component being measured.
144 @param Module Pointer to a Null-terminated ASCII string
145 that identifies the module being measured.
146
147 @retval The index of gauge entry in the array.
148
149 **/
150 STATIC
151 UINT32
152 InternalSearchForGaugeEntry (
153 IN CONST VOID *Handle, OPTIONAL
154 IN CONST CHAR8 *Token, OPTIONAL
155 IN CONST CHAR8 *Module OPTIONAL
156 )
157 {
158 UINT32 Index;
159 UINT32 NumberOfEntries;
160 GAUGE_DATA_ENTRY *GaugeEntryArray;
161
162 if (Token == NULL) {
163 Token = "";
164 }
165 if (Module == NULL) {
166 Module = "";
167 }
168
169 NumberOfEntries = mGaugeData->NumberOfEntries;
170 GaugeEntryArray = (GAUGE_DATA_ENTRY *) (mGaugeData + 1);
171
172 for (Index = 0; Index < NumberOfEntries; Index++) {
173 if ((GaugeEntryArray[Index].Handle == (EFI_PHYSICAL_ADDRESS) (UINTN) Handle) &&
174 AsciiStrnCmp (GaugeEntryArray[Index].Token, Token, PEI_PERFORMANCE_STRING_LENGTH) == 0 &&
175 AsciiStrnCmp (GaugeEntryArray[Index].Module, Module, PEI_PERFORMANCE_STRING_LENGTH) == 0 &&
176 GaugeEntryArray[Index].EndTimeStamp == 0
177 ) {
178 break;
179 }
180 }
181
182 return Index;
183 }
184
185 /**
186 Adds a record at the end of the performance measurement log
187 that records the start time of a performance measurement.
188
189 Adds a record to the end of the performance measurement log
190 that contains the Handle, Token, and Module.
191 The end time of the new record must be set to zero.
192 If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.
193 If TimeStamp is zero, the start time in the record is filled in with the value
194 read from the current time stamp.
195
196 @param Handle Pointer to environment specific context used
197 to identify the component being measured.
198 @param Token Pointer to a Null-terminated ASCII string
199 that identifies the component being measured.
200 @param Module Pointer to a Null-terminated ASCII string
201 that identifies the module being measured.
202 @param TimeStamp 64-bit time stamp.
203
204 @retval EFI_SUCCESS The data was read correctly from the device.
205 @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.
206
207 **/
208 STATIC
209 EFI_STATUS
210 EFIAPI
211 StartGauge (
212 IN CONST VOID *Handle, OPTIONAL
213 IN CONST CHAR8 *Token, OPTIONAL
214 IN CONST CHAR8 *Module, OPTIONAL
215 IN UINT64 TimeStamp
216 )
217 {
218 GAUGE_DATA_ENTRY *GaugeEntryArray;
219 UINTN GaugeDataSize;
220 UINTN OldGaugeDataSize;
221 GAUGE_DATA_HEADER *OldGaugeData;
222 UINT32 Index;
223
224 Index = mGaugeData->NumberOfEntries;
225 if (Index >= mMaxGaugeRecords) {
226 //
227 // Try to enlarge the scale of gauge arrary.
228 //
229 OldGaugeData = mGaugeData;
230 OldGaugeDataSize = sizeof (GAUGE_DATA_HEADER) + sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords;
231
232 mMaxGaugeRecords *= 2;
233 GaugeDataSize = sizeof (GAUGE_DATA_HEADER) + sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords;
234
235 mGaugeData = AllocateZeroPool (GaugeDataSize);
236 if (mGaugeData == NULL) {
237 return EFI_OUT_OF_RESOURCES;
238 }
239 //
240 // Initialize new data arry and migrate old data one.
241 //
242 mGaugeData = CopyMem (mGaugeData, OldGaugeData, OldGaugeDataSize);
243
244 FreePool (OldGaugeData);
245 }
246
247 GaugeEntryArray = (GAUGE_DATA_ENTRY *) (mGaugeData + 1);
248 GaugeEntryArray[Index].Handle = (EFI_PHYSICAL_ADDRESS) (UINTN) Handle;
249
250 if (Token != NULL) {
251 AsciiStrnCpy (GaugeEntryArray[Index].Token, Token, DXE_PERFORMANCE_STRING_LENGTH);
252 }
253 if (Module != NULL) {
254 AsciiStrnCpy (GaugeEntryArray[Index].Module, Module, DXE_PERFORMANCE_STRING_LENGTH);
255 }
256
257 if (TimeStamp == 0) {
258 TimeStamp = GetPerformanceCounter ();
259 }
260 GaugeEntryArray[Index].StartTimeStamp = TimeStamp;
261
262 mGaugeData->NumberOfEntries++;
263
264 return EFI_SUCCESS;
265 }
266
267 /**
268 Searches the performance measurement log from the beginning of the log
269 for the first matching record that contains a zero end time and fills in a valid end time.
270
271 Searches the performance measurement log from the beginning of the log
272 for the first record that matches Handle, Token, and Module and has an end time value of zero.
273 If the record can not be found then return EFI_NOT_FOUND.
274 If the record is found and TimeStamp is not zero,
275 then the end time in the record is filled in with the value specified by TimeStamp.
276 If the record is found and TimeStamp is zero, then the end time in the matching record
277 is filled in with the current time stamp value.
278
279 @param Handle Pointer to environment specific context used
280 to identify the component being measured.
281 @param Token Pointer to a Null-terminated ASCII string
282 that identifies the component being measured.
283 @param Module Pointer to a Null-terminated ASCII string
284 that identifies the module being measured.
285 @param TimeStamp 64-bit time stamp.
286
287 @retval EFI_SUCCESS The end of the measurement was recorded.
288 @retval EFI_NOT_FOUND The specified measurement record could not be found.
289
290 **/
291 STATIC
292 EFI_STATUS
293 EFIAPI
294 EndGauge (
295 IN CONST VOID *Handle, OPTIONAL
296 IN CONST CHAR8 *Token, OPTIONAL
297 IN CONST CHAR8 *Module, OPTIONAL
298 IN UINT64 TimeStamp
299 )
300 {
301 GAUGE_DATA_ENTRY *GaugeEntryArray;
302 UINT32 Index;
303
304 if (TimeStamp == 0) {
305 TimeStamp = GetPerformanceCounter ();
306 }
307
308 Index = InternalSearchForGaugeEntry (Handle, Token, Module);
309 if (Index >= mGaugeData->NumberOfEntries) {
310 return EFI_NOT_FOUND;
311 }
312 GaugeEntryArray = (GAUGE_DATA_ENTRY *) (mGaugeData + 1);
313 GaugeEntryArray[Index].EndTimeStamp = TimeStamp;
314
315 return EFI_SUCCESS;
316 }
317
318 /**
319 Retrieves a previously logged performance measurement.
320
321 Retrieves the performance log entry from the performance log specified by LogEntryKey.
322 If it stands for a valid entry, then EFI_SUCCESS is returned and
323 GaugeDataEntry stores the pointer to that entry.
324
325 @param LogEntryKey The key for the previous performance measurement log entry.
326 If 0, then the first performance measurement log entry is retrieved.
327 @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey
328 if the retrieval is successful.
329
330 @retval EFI_SUCCESS The GuageDataEntry is successfuly found based on LogEntryKey.
331 @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
332 @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
333 @retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.
334
335 **/
336 STATIC
337 EFI_STATUS
338 EFIAPI
339 GetGauge (
340 IN UINTN LogEntryKey,
341 OUT GAUGE_DATA_ENTRY **GaugeDataEntry
342 )
343 {
344 UINTN NumberOfEntries;
345 GAUGE_DATA_ENTRY *LogEntryArray;
346
347 NumberOfEntries = (UINTN) (mGaugeData->NumberOfEntries);
348 if (LogEntryKey > NumberOfEntries) {
349 return EFI_INVALID_PARAMETER;
350 }
351 if (LogEntryKey == NumberOfEntries) {
352 return EFI_NOT_FOUND;
353 }
354
355 LogEntryArray = (GAUGE_DATA_ENTRY *) (mGaugeData + 1);
356
357 if (GaugeDataEntry == NULL) {
358 return EFI_INVALID_PARAMETER;
359 }
360 *GaugeDataEntry = &LogEntryArray[LogEntryKey];
361
362 return EFI_SUCCESS;
363 }
364
365 /**
366 Dumps all the PEI performance log to DXE performance gauge array.
367
368 This internal function dumps all the PEI performance log to the DXE performance gauge array.
369 It retrieves the optional GUID HOB for PEI performance and then saves the performance data
370 to DXE performance data structures.
371
372 **/
373 STATIC
374 VOID
375 InternalGetPeiPerformance (
376 VOID
377 )
378 {
379 EFI_HOB_GUID_TYPE *GuidHob;
380 PEI_PERFORMANCE_LOG_HEADER *LogHob;
381 PEI_PERFORMANCE_LOG_ENTRY *LogEntryArray;
382 GAUGE_DATA_ENTRY *GaugeEntryArray;
383 UINT32 Index;
384 UINT32 NumberOfEntries;
385
386 NumberOfEntries = 0;
387 GaugeEntryArray = (GAUGE_DATA_ENTRY *) (mGaugeData + 1);
388
389 //
390 // Dump PEI Log Entries to DXE Guage Data structure.
391 //
392 GuidHob = GetFirstGuidHob (&gPeiPerformanceHobGuid);
393 if (GuidHob != NULL) {
394 LogHob = GET_GUID_HOB_DATA (GuidHob);
395 LogEntryArray = (PEI_PERFORMANCE_LOG_ENTRY *) (LogHob + 1);
396 GaugeEntryArray = (GAUGE_DATA_ENTRY *) (mGaugeData + 1);
397
398 NumberOfEntries = LogHob->NumberOfEntries;
399 for (Index = 0; Index < NumberOfEntries; Index++) {
400 GaugeEntryArray[Index].Handle = LogEntryArray[Index].Handle;
401 AsciiStrnCpy (GaugeEntryArray[Index].Token, LogEntryArray[Index].Token, DXE_PERFORMANCE_STRING_LENGTH);
402 AsciiStrnCpy (GaugeEntryArray[Index].Module, LogEntryArray[Index].Module, DXE_PERFORMANCE_STRING_LENGTH);
403 GaugeEntryArray[Index].StartTimeStamp = LogEntryArray[Index].StartTimeStamp;
404 GaugeEntryArray[Index].EndTimeStamp = LogEntryArray[Index].EndTimeStamp;
405 }
406 }
407 mGaugeData->NumberOfEntries = NumberOfEntries;
408 }
409
410 /**
411 The constructor function initializes Performance infrastructure for DXE phase.
412
413 The constructor function publishes Performance protocol, allocates memory to log DXE performance
414 and merges PEI performance data to DXE performance log.
415 It will ASSERT() if one of these operations fails and it will always return EFI_SUCCESS.
416
417 @param ImageHandle The firmware allocated handle for the EFI image.
418 @param SystemTable A pointer to the EFI System Table.
419
420 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
421
422 **/
423 EFI_STATUS
424 EFIAPI
425 DxeCorePerformanceLibConstructor (
426 IN EFI_HANDLE ImageHandle,
427 IN EFI_SYSTEM_TABLE *SystemTable
428 )
429 {
430 EFI_STATUS Status;
431
432 if (!PerformanceMeasurementEnabled ()) {
433 //
434 // Do not initialize performance infrastructure if not required.
435 //
436 return EFI_SUCCESS;
437 }
438 //
439 // Install the protocol interfaces.
440 //
441 Status = gBS->InstallProtocolInterface (
442 &mHandle,
443 &gPerformanceProtocolGuid,
444 EFI_NATIVE_INTERFACE,
445 &mPerformanceInterface
446 );
447 ASSERT_EFI_ERROR (Status);
448
449 mMaxGaugeRecords = INIT_DXE_GAUGE_DATA_ENTRIES + PcdGet8 (PcdMaxPeiPerformanceLogEntries);
450
451 mGaugeData = AllocateZeroPool (sizeof (GAUGE_DATA_HEADER) + (sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords));
452 ASSERT (mGaugeData != NULL);
453
454 InternalGetPeiPerformance ();
455
456 return Status;
457 }
458
459 /**
460 Adds a record at the end of the performance measurement log
461 that records the start time of a performance measurement.
462
463 Adds a record to the end of the performance measurement log
464 that contains the Handle, Token, and Module.
465 The end time of the new record must be set to zero.
466 If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.
467 If TimeStamp is zero, the start time in the record is filled in with the value
468 read from the current time stamp.
469
470 @param Handle Pointer to environment specific context used
471 to identify the component being measured.
472 @param Token Pointer to a Null-terminated ASCII string
473 that identifies the component being measured.
474 @param Module Pointer to a Null-terminated ASCII string
475 that identifies the module being measured.
476 @param TimeStamp 64-bit time stamp.
477
478 @retval RETURN_SUCCESS The start of the measurement was recorded.
479 @retval RETURN_OUT_OF_RESOURCES There are not enough resources to record the measurement.
480
481 **/
482 RETURN_STATUS
483 EFIAPI
484 StartPerformanceMeasurement (
485 IN CONST VOID *Handle, OPTIONAL
486 IN CONST CHAR8 *Token, OPTIONAL
487 IN CONST CHAR8 *Module, OPTIONAL
488 IN UINT64 TimeStamp
489 )
490 {
491 EFI_STATUS Status;
492
493 Status = StartGauge (Handle, Token, Module, TimeStamp);
494 return (RETURN_STATUS) Status;
495 }
496
497 /**
498 Searches the performance measurement log from the beginning of the log
499 for the first matching record that contains a zero end time and fills in a valid end time.
500
501 Searches the performance measurement log from the beginning of the log
502 for the first record that matches Handle, Token, and Module and has an end time value of zero.
503 If the record can not be found then return RETURN_NOT_FOUND.
504 If the record is found and TimeStamp is not zero,
505 then the end time in the record is filled in with the value specified by TimeStamp.
506 If the record is found and TimeStamp is zero, then the end time in the matching record
507 is filled in with the current time stamp value.
508
509 @param Handle Pointer to environment specific context used
510 to identify the component being measured.
511 @param Token Pointer to a Null-terminated ASCII string
512 that identifies the component being measured.
513 @param Module Pointer to a Null-terminated ASCII string
514 that identifies the module being measured.
515 @param TimeStamp 64-bit time stamp.
516
517 @retval RETURN_SUCCESS The end of the measurement was recorded.
518 @retval RETURN_NOT_FOUND The specified measurement record could not be found.
519
520 **/
521 RETURN_STATUS
522 EFIAPI
523 EndPerformanceMeasurement (
524 IN CONST VOID *Handle, OPTIONAL
525 IN CONST CHAR8 *Token, OPTIONAL
526 IN CONST CHAR8 *Module, OPTIONAL
527 IN UINT64 TimeStamp
528 )
529 {
530 EFI_STATUS Status;
531
532 Status = EndGauge (Handle, Token, Module, TimeStamp);
533 return (RETURN_STATUS) Status;
534 }
535
536 /**
537 Attempts to retrieve a performance measurement log entry from the performance measurement log.
538
539 Attempts to retrieve the performance log entry specified by LogEntryKey. If LogEntryKey is
540 zero on entry, then an attempt is made to retrieve the first entry from the performance log,
541 and the key for the second entry in the log is returned. If the performance log is empty,
542 then no entry is retrieved and zero is returned. If LogEntryKey is not zero, then the performance
543 log entry associated with LogEntryKey is retrieved, and the key for the next entry in the log is
544 returned. If LogEntryKey is the key for the last entry in the log, then the last log entry is
545 retrieved and an implementation specific non-zero key value that specifies the end of the performance
546 log is returned. If LogEntryKey is equal this implementation specific non-zero key value, then no entry
547 is retrieved and zero is returned. In the cases where a performance log entry can be returned,
548 the log entry is returned in Handle, Token, Module, StartTimeStamp, and EndTimeStamp.
549 If LogEntryKey is not a valid log entry key for the performance measurement log, then ASSERT().
550 If Handle is NULL, then ASSERT().
551 If Token is NULL, then ASSERT().
552 If Module is NULL, then ASSERT().
553 If StartTimeStamp is NULL, then ASSERT().
554 If EndTimeStamp is NULL, then ASSERT().
555
556 @param LogEntryKey On entry, the key of the performance measurement log entry to retrieve.
557 0, then the first performance measurement log entry is retrieved.
558 On exit, the key of the next performance lof entry entry.
559 @param Handle Pointer to environment specific context used to identify the component
560 being measured.
561 @param Token Pointer to a Null-terminated ASCII string that identifies the component
562 being measured.
563 @param Module Pointer to a Null-terminated ASCII string that identifies the module
564 being measured.
565 @param StartTimeStamp Pointer to the 64-bit time stamp that was recorded when the measurement
566 was started.
567 @param EndTimeStamp Pointer to the 64-bit time stamp that was recorded when the measurement
568 was ended.
569
570 @return The key for the next performance log entry (in general case).
571
572 **/
573 UINTN
574 EFIAPI
575 GetPerformanceMeasurement (
576 IN UINTN LogEntryKey,
577 OUT CONST VOID **Handle,
578 OUT CONST CHAR8 **Token,
579 OUT CONST CHAR8 **Module,
580 OUT UINT64 *StartTimeStamp,
581 OUT UINT64 *EndTimeStamp
582 )
583 {
584 EFI_STATUS Status;
585 GAUGE_DATA_ENTRY *GaugeData;
586
587 ASSERT (Handle != NULL);
588 ASSERT (Token != NULL);
589 ASSERT (Module != NULL);
590 ASSERT (StartTimeStamp != NULL);
591 ASSERT (EndTimeStamp != NULL);
592
593 Status = GetGauge (LogEntryKey++, &GaugeData);
594
595 //
596 // Make sure that LogEntryKey is a valid log entry key,
597 //
598 ASSERT (Status != EFI_INVALID_PARAMETER);
599
600 if (EFI_ERROR (Status)) {
601 //
602 // The LogEntryKey is the last entry (equals to the total entry number).
603 //
604 return 0;
605 }
606
607 ASSERT (GaugeData != NULL);
608
609 *Handle = (VOID *) (UINTN) GaugeData->Handle;
610 *Token = GaugeData->Token;
611 *Module = GaugeData->Module;
612 *StartTimeStamp = GaugeData->StartTimeStamp;
613 *EndTimeStamp = GaugeData->EndTimeStamp;
614
615 return LogEntryKey;
616 }
617
618 /**
619 Returns TRUE if the performance measurement macros are enabled.
620
621 This function returns TRUE if the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of
622 PcdPerformanceLibraryPropertyMask is set. Otherwise FALSE is returned.
623
624 @retval TRUE The PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of
625 PcdPerformanceLibraryPropertyMask is set.
626 @retval FALSE The PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of
627 PcdPerformanceLibraryPropertyMask is clear.
628
629 **/
630 BOOLEAN
631 EFIAPI
632 PerformanceMeasurementEnabled (
633 VOID
634 )
635 {
636 return (BOOLEAN) ((PcdGet8(PcdPerformanceLibraryPropertyMask) & PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED) != 0);
637 }