Reviewed-by: Samer El-Haj-Mahmoud <el...@hpe.com>
-----Original Message----- From: Shia, Cinnamon Sent: Saturday, March 5, 2016 7:19 AM To: edk2-devel@lists.01.org Cc: El-Haj-Mahmoud, Samer <samer.el-haj-mahm...@hpe.com>; Shia, Cinnamon <cinnamon.s...@hpe.com> Subject: [PATCH] MdeModulePkg: Change the type of PcdMaxPeiPerformanceLogEntries to UINT16 Change the type of PcdMaxPeiPerformanceLogEntries from UINT8 to UINT16 to log more than 255 performance entries in PEI. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.s...@hpe.com> --- .../Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 3 ++- MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c | 8 ++++---- MdeModulePkg/MdeModulePkg.dec | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c index 0eb8e57..61491e6 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c @@ -11,6 +11,7 @@ Performance Protocol is installed at the very beginning of DXE phase. Copyright (c) 2006 - 2015, 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 @@ -522,7 +523,7 @@ DxeCorePerformanceLibConstructor ( ); ASSERT_EFI_ERROR (Status); - mMaxGaugeRecords = INIT_DXE_GAUGE_DATA_ENTRIES + PcdGet8 (PcdMaxPeiPerformanceLogEntries); + mMaxGaugeRecords = INIT_DXE_GAUGE_DATA_ENTRIES + PcdGet16 + (PcdMaxPeiPerformanceLogEntries); mGaugeData = AllocateZeroPool (sizeof (GAUGE_DATA_HEADER) + (sizeof (GAUGE_DATA_ENTRY_EX) * mMaxGaugeRecords)); ASSERT (mGaugeData != NULL); diff --git a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c index 9674bbc..74e6300 100644 --- a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c +++ b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c @@ -7,7 +7,7 @@ number of performance logging entry is specified by PcdMaxPeiPerformanceLogEntries. 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 @@ -71,11 +71,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) * + PcdGet16 (PcdMaxPeiPerformanceLogEntries); *PeiPerformanceLog = BuildGuidHob (&gPerformanceProtocolGuid, PeiPerformanceSize); *PeiPerformanceLog = ZeroMem (*PeiPerformanceLog, PeiPerformanceSize); - PeiPerformanceSize = sizeof (UINT32) * PcdGet8 (PcdMaxPeiPerformanceLogEntries); + PeiPerformanceSize = sizeof (UINT32) * PcdGet16 (PcdMaxPeiPerformanceLogEntries); *PeiPerformanceIdArray = BuildGuidHob (&gPerformanceExProtocolGuid, PeiPerformanceSize); *PeiPerformanceIdArray = ZeroMem (*PeiPerformanceIdArray, PeiPerformanceSize); } @@ -183,7 +183,7 @@ StartPerformanceMeasurementEx ( InternalGetPerformanceHobLog (&PeiPerformanceLog, &PeiPerformanceIdArray); - if (PeiPerformanceLog->NumberOfEntries >= PcdGet8 (PcdMaxPeiPerformanceLogEntries)) { + if (PeiPerformanceLog->NumberOfEntries >= PcdGet16 + (PcdMaxPeiPerformanceLogEntries)) { DEBUG ((DEBUG_ERROR, "PEI performance log array out of resources\n")); return RETURN_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index efd870b..038f020 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -5,6 +5,7 @@ # # Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2016, Linaro Ltd. 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 that accompanies this distribution. # The full text of the license may be found at @@ -870,7 +871,7 @@ ## Maximum number of performance log entries during PEI phase. # @Prompt Maximum number of PEI performance log entries. - gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|40|UINT8|0x0001002f + + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|40|UINT1 + 6|0x0001002f ## RTC Update Timeout Value(microsecond). # @Prompt RTC Update Timeout Value. -- 2.7.0.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel