/** @file\r
- Support for measurement of DXE performance\r
+ Performance library instance mainly used by DxeCore.\r
+\r
+ This library provides the performance measurement interfaces and initializes performance\r
+ logging for DXE phase. It first initializes its private global data structure for\r
+ performance logging and saves the performance GUIDed HOB passed from PEI phase. \r
+ It initializes DXE phase performance logging by publishing the Performance Protocol,\r
+ which is consumed by DxePerformanceLib to logging performance data in DXE phase.\r
+\r
+ This library is mainly used by DxeCore to start performance logging to ensure that\r
+ Performance Protocol is installed at the very beginning of DXE phase.\r
\r
Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
All rights reserved. This program and the accompanying materials\r
\r
\r
//\r
-// Definition for global variables.\r
+// The data structure to hold global performance data.\r
//\r
GAUGE_DATA_HEADER *mGaugeData;\r
+\r
+//\r
+// The current maximum number of logging entries. If current number of \r
+// entries exceeds this value, it will re-allocate a larger array and\r
+// migration the old data to the larger array.\r
+//\r
UINT32 mMaxGaugeRecords;\r
\r
+//\r
+// The handle to install Performance Protocol instance.\r
+//\r
EFI_HANDLE mHandle = NULL;\r
+\r
+//\r
+// Interfaces for performance protocol.\r
+//\r
PERFORMANCE_PROTOCOL mPerformanceInterface = {\r
StartGauge,\r
EndGauge,\r
Index = mGaugeData->NumberOfEntries;\r
if (Index >= mMaxGaugeRecords) {\r
//\r
- // Try to enlarge the scale of gauge arrary.\r
+ // Try to enlarge the scale of gauge array.\r
//\r
OldGaugeData = mGaugeData;\r
OldGaugeDataSize = sizeof (GAUGE_DATA_HEADER) + sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords;\r
return EFI_OUT_OF_RESOURCES;\r
}\r
//\r
- // Initialize new data arry and migrate old data one.\r
+ // Initialize new data array and migrate old data one.\r
//\r
mGaugeData = CopyMem (mGaugeData, OldGaugeData, OldGaugeDataSize);\r
\r
@param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey\r
if the retrieval is successful.\r
\r
- @retval EFI_SUCCESS The GuageDataEntry is successfuly found based on LogEntryKey.\r
+ @retval EFI_SUCCESS The GuageDataEntry is successfully found based on LogEntryKey.\r
@retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).\r
@retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).\r
@retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.\r
\r
@param LogEntryKey On entry, the key of the performance measurement log entry to retrieve.\r
0, then the first performance measurement log entry is retrieved.\r
- On exit, the key of the next performance lof entry entry.\r
+ On exit, the key of the next performance log entry.\r
@param Handle Pointer to environment specific context used to identify the component\r
being measured.\r
@param Token Pointer to a Null-terminated ASCII string that identifies the component\r