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