summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-15 15:56:02 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-15 15:56:02 +0000
commit857dfc455d7999f61c9b55f0a930c6b4087804b9 (patch)
tree4a0efd95ee6b1df71558d3bda1b4e0c04c780f1d /MdeModulePkg
parente05e2b73fc9e7b6662e0f8681b3e3ac2194662c7 (diff)
downloadedk2-857dfc455d7999f61c9b55f0a930c6b4087804b9.zip
edk2-857dfc455d7999f61c9b55f0a930c6b4087804b9.tar.gz
edk2-857dfc455d7999f61c9b55f0a930c6b4087804b9.tar.bz2
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')
-rw-r--r--MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c34
-rw-r--r--MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf11
-rw-r--r--MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLibInternal.h7
-rw-r--r--MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.c12
-rw-r--r--MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf10
-rw-r--r--MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c7
-rw-r--r--MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf9
7 files changed, 68 insertions, 22 deletions
diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
index 0b925b3..f861d61 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 6e63242..704256d 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 1c02959..cfa35fa 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.
diff --git a/MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.c b/MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.c
index 35a50f7..8da3027 100644
--- a/MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.c
+++ b/MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.c
@@ -1,7 +1,12 @@
/** @file
Performance Library
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>
+ This library instance provides infrastructure for DXE phase drivers to log performance
+ data. It consumes Performance Protocol published by DxeCorePerformanceLib
+ to log performance data. If Performance Protocol is not available, it does not log any
+ performance information.
+
+ Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -22,6 +27,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/UefiBootServicesTableLib.h>
#include <Library/PcdLib.h>
+//
+// The cached performance protocol interface.
+//
PERFORMANCE_PROTOCOL *mPerformance = NULL;
/**
@@ -165,7 +173,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/DxePerformanceLib/DxePerformanceLib.inf b/MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
index ff1f03b..70c19db 100644
--- a/MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
+++ b/MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
@@ -1,8 +1,10 @@
#/** @file
+# Performance library instance used in DXE phase.
#
-# Component description file for Dxe Performance Library
-#
-# This library provides intrastructure for Dxe driver to log performance.
+# This library instance provides infrastructure for DXE phase drivers to log performance
+# data. It consumes Performance Protocol published by DxeCorePerformanceLib
+# to log performance data. If Performance Protocol is not available, it does not log any
+# performance information.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
@@ -45,7 +47,7 @@
[Protocols]
- gPerformanceProtocolGuid # PROTOCOL ALWAYS_CONSUMED
+ gPerformanceProtocolGuid
[Pcd.common]
diff --git a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
index 64b4883..97dfd0d 100644
--- a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
+++ b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
@@ -1,5 +1,10 @@
/** @file
- Performance Library
+ Performance library instance used in PEI phase.
+
+ This file implements all APIs in Performance Library class in MdePkg. It creates
+ performance logging GUIDed HOB on the first performance logging and then logs the
+ performance data to the GUIDed HOB. Due to the limitation of temporary RAM, the maximum
+ number of performance logging entry is specified by PcdMaxPeiPerformanceLogEntries.
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
diff --git a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
index d3f611c..8913239 100644
--- a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
+++ b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
@@ -1,9 +1,10 @@
#/** @file
#
-# Memory-only library functions with no library constructor/destructor
+# Performance library instance used in PEI phase.
#
-# This module provides the performance measurement interfaces in PEI phase, it is
-# one instance of Performance Libarary.
+# This library provides the performance measurement interfaces in PEI phase, it creates
+# and consumes GUIDed HOB for performance logging. The GUIDed HOB is passed to DXE phase
+# so that it can be taken over by DxeCorePerformanceLib.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
@@ -49,7 +50,7 @@
[Guids]
- gPeiPerformanceHobGuid # SOMETIMES_CONSUMED
+ gPeiPerformanceHobGuid
[Pcd.common]
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries