summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library/PeiPerformanceLib
diff options
context:
space:
mode:
authorCinnamon Shia <cinnamon.shia@hpe.com>2016-03-08 14:00:04 +0800
committerStar Zeng <star.zeng@intel.com>2016-03-08 21:00:04 +0800
commit7c50b3434377cbb49ce4514ee31339000a5cadc0 (patch)
tree4e66a8f33369db39904fb1ce52611f2f48b7dd19 /MdeModulePkg/Library/PeiPerformanceLib
parent96302b80d90eb3b88e3ad6dbd7c0034d7ab6fa51 (diff)
downloadedk2-7c50b3434377cbb49ce4514ee31339000a5cadc0.tar.gz
edk2-7c50b3434377cbb49ce4514ee31339000a5cadc0.tar.bz2
edk2-7c50b3434377cbb49ce4514ee31339000a5cadc0.zip
MdeModulePkg: Increase the maximum number of PEI performance log entries
The maximum number of PEI performance log entries is 255. Add a new PCD, PcdMaxPeiPerformanceLogEntries16, to increase the maximum number of PEI performance log entries. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Samer EL-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Joseph Shifflett <joseph.shifflett@hpe.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg/Library/PeiPerformanceLib')
-rw-r--r--MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c20
-rw-r--r--MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf6
2 files changed, 19 insertions, 7 deletions
diff --git a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
index 9674bbc621..b3b11b9519 100644
--- a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
+++ b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
@@ -4,10 +4,11 @@
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.
+ number of performance logging entry is specified by PcdMaxPeiPerformanceLogEntries or
+ PcdMaxPeiPerformanceLogEntries16.
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
-(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
+(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
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
@@ -51,10 +52,14 @@ InternalGetPerformanceHobLog (
{
EFI_HOB_GUID_TYPE *GuidHob;
UINTN PeiPerformanceSize;
+ UINT16 PeiPerformanceLogEntries;
ASSERT (PeiPerformanceLog != NULL);
ASSERT (PeiPerformanceIdArray != NULL);
+ PeiPerformanceLogEntries = (UINT16) (PcdGet16 (PcdMaxPeiPerformanceLogEntries16) != 0 ?
+ PcdGet16 (PcdMaxPeiPerformanceLogEntries16) :
+ PcdGet8 (PcdMaxPeiPerformanceLogEntries));
GuidHob = GetFirstGuidHob (&gPerformanceProtocolGuid);
if (GuidHob != NULL) {
@@ -71,11 +76,11 @@ InternalGetPerformanceHobLog (
// PEI Performance HOB was not found, then build one.
//
PeiPerformanceSize = sizeof (PEI_PERFORMANCE_LOG_HEADER) +
- sizeof (PEI_PERFORMANCE_LOG_ENTRY) * PcdGet8 (PcdMaxPeiPerformanceLogEntries);
+ sizeof (PEI_PERFORMANCE_LOG_ENTRY) * PeiPerformanceLogEntries;
*PeiPerformanceLog = BuildGuidHob (&gPerformanceProtocolGuid, PeiPerformanceSize);
*PeiPerformanceLog = ZeroMem (*PeiPerformanceLog, PeiPerformanceSize);
- PeiPerformanceSize = sizeof (UINT32) * PcdGet8 (PcdMaxPeiPerformanceLogEntries);
+ PeiPerformanceSize = sizeof (UINT32) * PeiPerformanceLogEntries;
*PeiPerformanceIdArray = BuildGuidHob (&gPerformanceExProtocolGuid, PeiPerformanceSize);
*PeiPerformanceIdArray = ZeroMem (*PeiPerformanceIdArray, PeiPerformanceSize);
}
@@ -180,10 +185,15 @@ StartPerformanceMeasurementEx (
UINT32 *PeiPerformanceIdArray;
PEI_PERFORMANCE_LOG_ENTRY *LogEntryArray;
UINT32 Index;
+ UINT16 PeiPerformanceLogEntries;
+
+ PeiPerformanceLogEntries = (UINT16) (PcdGet16 (PcdMaxPeiPerformanceLogEntries16) != 0 ?
+ PcdGet16 (PcdMaxPeiPerformanceLogEntries16) :
+ PcdGet8 (PcdMaxPeiPerformanceLogEntries));
InternalGetPerformanceHobLog (&PeiPerformanceLog, &PeiPerformanceIdArray);
- if (PeiPerformanceLog->NumberOfEntries >= PcdGet8 (PcdMaxPeiPerformanceLogEntries)) {
+ if (PeiPerformanceLog->NumberOfEntries >= PeiPerformanceLogEntries) {
DEBUG ((DEBUG_ERROR, "PEI performance log array out of resources\n"));
return RETURN_OUT_OF_RESOURCES;
}
diff --git a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
index 7a5d2407ac..08aa064432 100644
--- a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
+++ b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
@@ -6,6 +6,7 @@
# so that it can be taken over by DxeCorePerformanceLib.
#
# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
# 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
@@ -58,5 +59,6 @@
gPerformanceExProtocolGuid
[Pcd]
- gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries ## CONSUMES
- gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries16 ## CONSUMES
+ gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask ## CONSUMES