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