diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-12-15 15:56:02 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-12-15 15:56:02 +0000 |
commit | 857dfc455d7999f61c9b55f0a930c6b4087804b9 (patch) | |
tree | 4a0efd95ee6b1df71558d3bda1b4e0c04c780f1d /MdeModulePkg/Library/DxeCorePerformanceLib | |
parent | e05e2b73fc9e7b6662e0f8681b3e3ac2194662c7 (diff) | |
download | edk2-platforms-857dfc455d7999f61c9b55f0a930c6b4087804b9.tar.xz |
Code scrub performance library instances in MdeModulePkg
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7037 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/DxeCorePerformanceLib')
3 files changed, 41 insertions, 11 deletions
diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c index 0b925b3c7d..f861d61430 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c @@ -1,5 +1,14 @@ /** @file
- Support for measurement of DXE performance
+ Performance library instance mainly used by DxeCore.
+
+ This library provides the performance measurement interfaces and initializes performance
+ logging for DXE phase. It first initializes its private global data structure for
+ performance logging and saves the performance GUIDed HOB passed from PEI phase.
+ It initializes DXE phase performance logging by publishing the Performance Protocol,
+ which is consumed by DxePerformanceLib to logging performance data in DXE phase.
+
+ This library is mainly used by DxeCore to start performance logging to ensure that
+ Performance Protocol is installed at the very beginning of DXE phase.
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
@@ -17,12 +26,25 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. //
-// Definition for global variables.
+// The data structure to hold global performance data.
//
GAUGE_DATA_HEADER *mGaugeData;
+
+//
+// The current maximum number of logging entries. If current number of
+// entries exceeds this value, it will re-allocate a larger array and
+// migration the old data to the larger array.
+//
UINT32 mMaxGaugeRecords;
+//
+// The handle to install Performance Protocol instance.
+//
EFI_HANDLE mHandle = NULL;
+
+//
+// Interfaces for performance protocol.
+//
PERFORMANCE_PROTOCOL mPerformanceInterface = {
StartGauge,
EndGauge,
@@ -122,7 +144,7 @@ StartGauge ( Index = mGaugeData->NumberOfEntries;
if (Index >= mMaxGaugeRecords) {
//
- // Try to enlarge the scale of gauge arrary.
+ // Try to enlarge the scale of gauge array.
//
OldGaugeData = mGaugeData;
OldGaugeDataSize = sizeof (GAUGE_DATA_HEADER) + sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords;
@@ -135,7 +157,7 @@ StartGauge ( return EFI_OUT_OF_RESOURCES;
}
//
- // Initialize new data arry and migrate old data one.
+ // Initialize new data array and migrate old data one.
//
mGaugeData = CopyMem (mGaugeData, OldGaugeData, OldGaugeDataSize);
@@ -224,7 +246,7 @@ EndGauge ( @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey
if the retrieval is successful.
- @retval EFI_SUCCESS The GuageDataEntry is successfuly found based on LogEntryKey.
+ @retval EFI_SUCCESS The GuageDataEntry is successfully found based on LogEntryKey.
@retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
@retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
@retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.
@@ -450,7 +472,7 @@ EndPerformanceMeasurement ( @param LogEntryKey On entry, the key of the performance measurement log entry to retrieve.
0, then the first performance measurement log entry is retrieved.
- On exit, the key of the next performance lof entry entry.
+ On exit, the key of the next performance log entry.
@param Handle Pointer to environment specific context used to identify the component
being measured.
@param Token Pointer to a Null-terminated ASCII string that identifies the component
diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf index 6e6324213d..704256dd18 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf @@ -1,8 +1,13 @@ #/** @file
+# Performance library instance mainly for DxeCore usage.
#
-# Component description file for DxeCore Performance Library
-#
-# This library provides intrastructure for DxeCore to log performance.
+# This library provides the performance measurement interfaces and initializes performance
+# logging for DXE phase. It first initializes its private global data structure for
+# performance logging and saves the performance GUIDed HOB passed from PEI phase.
+# It initializes DXE phase performance logging by publishing the Performance Protocol,
+# which is consumed by DxePerformanceLib to logging performance data in DXE phase.
+# This library is mainly used by DxeCore to start performance logging to ensure that
+# Performance Protocol is installed at the very beginning of DXE phase.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h index 1c02959e26..cfa35fa847 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h @@ -1,5 +1,8 @@ /** @file
- Module functions' declarations are included here.
+ Master header files for DxeCorePerformanceLib instance.
+
+ This header file holds the prototypes of the Performance Protocol published by this
+ library instance at its constructor.
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
@@ -111,7 +114,7 @@ EndGauge ( @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey
if the retrieval is successful.
- @retval EFI_SUCCESS The GuageDataEntry is successfuly found based on LogEntryKey.
+ @retval EFI_SUCCESS The GuageDataEntry is successfully found based on LogEntryKey.
@retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).
@retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).
@retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.
|