]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Increase the maximum number of PEI performance log entries
authorCinnamon Shia <cinnamon.shia@hpe.com>
Tue, 8 Mar 2016 06:00:04 +0000 (14:00 +0800)
committerStar Zeng <star.zeng@intel.com>
Tue, 8 Mar 2016 13:00:04 +0000 (21:00 +0800)
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>
MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf
MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
MdeModulePkg/MdeModulePkg.dec

index 0eb8e579d782deea20ee545c60c3cb1916bfd3f8..c3a6d70aeb279a56cc9951fbc9166385a5b63694 100644 (file)
@@ -11,6 +11,7 @@
   Performance Protocol is installed at the very beginning of DXE phase.\r
 \r
 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -522,7 +523,9 @@ DxeCorePerformanceLibConstructor (
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  mMaxGaugeRecords = INIT_DXE_GAUGE_DATA_ENTRIES + PcdGet8 (PcdMaxPeiPerformanceLogEntries);\r
+  mMaxGaugeRecords = INIT_DXE_GAUGE_DATA_ENTRIES + (UINT16) (PcdGet16 (PcdMaxPeiPerformanceLogEntries16) != 0 ?\r
+                                                             PcdGet16 (PcdMaxPeiPerformanceLogEntries16) :\r
+                                                             PcdGet8 (PcdMaxPeiPerformanceLogEntries));\r
 \r
   mGaugeData = AllocateZeroPool (sizeof (GAUGE_DATA_HEADER) + (sizeof (GAUGE_DATA_ENTRY_EX) * mMaxGaugeRecords));\r
   ASSERT (mGaugeData != NULL);\r
index 5f290634c5cf80171ed4e3acc7071cd6fbd17db1..f73d0a4386adad5bd7bcdc69f38a07d7c961be7c 100644 (file)
@@ -10,6 +10,7 @@
 #  Performance and PerformanceEx Protocol are installed at the very beginning of DXE phase.\r
 #  \r
 #  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #  which accompanies this distribution.  The full text of the license may be found at\r
@@ -66,5 +67,6 @@
   gPerformanceExProtocolGuid\r
 \r
 [Pcd]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries ## CONSUMES\r
-  gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask    ## CONSUMES\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries   ## CONSUMES\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries16 ## CONSUMES\r
+  gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask      ## CONSUMES\r
index 9674bbc6210f6d3dacd514925300430c050cf614..b3b11b95198430054ef716870767250effe937f2 100644 (file)
@@ -4,10 +4,11 @@
   This file implements all APIs in Performance Library class in MdePkg. It creates\r
   performance logging GUIDed HOB on the first performance logging and then logs the\r
   performance data to the GUIDed HOB. Due to the limitation of temporary RAM, the maximum\r
-  number of performance logging entry is specified by PcdMaxPeiPerformanceLogEntries.  \r
+  number of performance logging entry is specified by PcdMaxPeiPerformanceLogEntries or \r
+  PcdMaxPeiPerformanceLogEntries16.\r
 \r
 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
+(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -51,10 +52,14 @@ InternalGetPerformanceHobLog (
 {\r
   EFI_HOB_GUID_TYPE           *GuidHob;\r
   UINTN                       PeiPerformanceSize;\r
+  UINT16                      PeiPerformanceLogEntries;\r
 \r
   ASSERT (PeiPerformanceLog != NULL);\r
   ASSERT (PeiPerformanceIdArray != NULL);\r
 \r
+  PeiPerformanceLogEntries = (UINT16) (PcdGet16 (PcdMaxPeiPerformanceLogEntries16) != 0 ?\r
+                                       PcdGet16 (PcdMaxPeiPerformanceLogEntries16) :\r
+                                       PcdGet8 (PcdMaxPeiPerformanceLogEntries));\r
   GuidHob = GetFirstGuidHob (&gPerformanceProtocolGuid);\r
 \r
   if (GuidHob != NULL) {\r
@@ -71,11 +76,11 @@ InternalGetPerformanceHobLog (
     // PEI Performance HOB was not found, then build one.\r
     //\r
     PeiPerformanceSize     = sizeof (PEI_PERFORMANCE_LOG_HEADER) +\r
-                             sizeof (PEI_PERFORMANCE_LOG_ENTRY) * PcdGet8 (PcdMaxPeiPerformanceLogEntries);\r
+                             sizeof (PEI_PERFORMANCE_LOG_ENTRY) * PeiPerformanceLogEntries;\r
     *PeiPerformanceLog     = BuildGuidHob (&gPerformanceProtocolGuid, PeiPerformanceSize);\r
     *PeiPerformanceLog     = ZeroMem (*PeiPerformanceLog, PeiPerformanceSize);\r
 \r
-    PeiPerformanceSize     = sizeof (UINT32) * PcdGet8 (PcdMaxPeiPerformanceLogEntries);\r
+    PeiPerformanceSize     = sizeof (UINT32) * PeiPerformanceLogEntries;\r
     *PeiPerformanceIdArray = BuildGuidHob (&gPerformanceExProtocolGuid, PeiPerformanceSize);\r
     *PeiPerformanceIdArray = ZeroMem (*PeiPerformanceIdArray, PeiPerformanceSize);\r
   }\r
@@ -180,10 +185,15 @@ StartPerformanceMeasurementEx (
   UINT32                      *PeiPerformanceIdArray;\r
   PEI_PERFORMANCE_LOG_ENTRY   *LogEntryArray;\r
   UINT32                      Index;\r
+  UINT16                      PeiPerformanceLogEntries;\r
+\r
+  PeiPerformanceLogEntries = (UINT16) (PcdGet16 (PcdMaxPeiPerformanceLogEntries16) != 0 ?\r
+                                       PcdGet16 (PcdMaxPeiPerformanceLogEntries16) :\r
+                                       PcdGet8 (PcdMaxPeiPerformanceLogEntries));\r
 \r
   InternalGetPerformanceHobLog (&PeiPerformanceLog, &PeiPerformanceIdArray);\r
 \r
-  if (PeiPerformanceLog->NumberOfEntries >= PcdGet8 (PcdMaxPeiPerformanceLogEntries)) {\r
+  if (PeiPerformanceLog->NumberOfEntries >= PeiPerformanceLogEntries) {\r
     DEBUG ((DEBUG_ERROR, "PEI performance log array out of resources\n"));\r
     return RETURN_OUT_OF_RESOURCES;\r
   }\r
index 7a5d2407ac6fea4c49eebab5f93903dbe9fc456e..08aa064432ec4d439ba7d3494e58c3bbd9cc86a6 100644 (file)
@@ -6,6 +6,7 @@
 #  so that it can be taken over by DxeCorePerformanceLib.  \r
 #  \r
 #  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #  which accompanies this distribution.  The full text of the license may be found at\r
@@ -58,5 +59,6 @@
   gPerformanceExProtocolGuid\r
 \r
 [Pcd]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries ## CONSUMES\r
-  gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask    ## CONSUMES\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries   ## CONSUMES\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries16 ## CONSUMES\r
+  gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask      ## CONSUMES\r
index efd870b61828de45046206d1b1e022de96d80547..1a205617a5399f07d1ade8b42f46771e38ca0663 100644 (file)
@@ -5,6 +5,7 @@
 #\r
 # Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
 # Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>\r
+# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 # This program and the accompanying materials are licensed and made available under\r
 # the terms and conditions of the BSD License that accompanies this distribution.\r
 # The full text of the license may be found at\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleCoalesceFile|{ 0xA6, 0xE4, 0xFD, 0xF7, 0x4C, 0x29, 0x3c, 0x49, 0xB5, 0x0F, 0x97, 0x34, 0x55, 0x3B, 0xB7, 0x57 }|VOID*|0x30000017\r
 \r
   ## Maximum number of performance log entries during PEI phase.\r
+  # Use PcdMaxPeiPerformanceLogEntries16 if the number of entries required is\r
+  # more than 255.\r
   # @Prompt Maximum number of PEI performance log entries.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|40|UINT8|0x0001002f\r
 \r
+  ## Maximum number of performance log entries during PEI phase.\r
+  # If set to 0, then PcdMaxPeiPerformanceLogEntries determines the number of\r
+  # entries. If greater than 0, then this PCD determines the number of entries,\r
+  # and PcdMaxPeiPerformanceLogEntries is ignored.\r
+  # @Prompt Maximum number of PEI performance log entries.\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries16|0|UINT16|0x00010035\r
+\r
   ## RTC Update Timeout Value(microsecond).\r
   # @Prompt RTC Update Timeout Value.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdRealTimeClockUpdateTimeout|100000|UINT32|0x00010034\r