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