summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-29 01:52:19 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-29 01:52:19 +0000
commit6ffd3b0cd256d10b669776b56241d47839be208f (patch)
tree04b269fcfa7a08187a4376fa901f92b5859ab245
parenta3420902ba177d263a59083afb46e68fd0f0602d (diff)
downloadedk2-platforms-6ffd3b0cd256d10b669776b56241d47839be208f.tar.xz
Add a Pcd to define the maximum number of performance log entries during PEI phase.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1398 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--EdkModulePkg/EdkModulePkg.spd9
-rw-r--r--EdkModulePkg/Include/Guid/PeiPerformanceHob.h4
-rw-r--r--EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c2
-rw-r--r--EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.msa5
-rw-r--r--EdkModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c4
-rw-r--r--EdkModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.msa5
6 files changed, 22 insertions, 7 deletions
diff --git a/EdkModulePkg/EdkModulePkg.spd b/EdkModulePkg/EdkModulePkg.spd
index 37a1a1fc6d..86d33e69cd 100644
--- a/EdkModulePkg/EdkModulePkg.spd
+++ b/EdkModulePkg/EdkModulePkg.spd
@@ -988,6 +988,15 @@
<HelpText>kbytes size of runtime memory.</HelpText>
</PcdEntry>
<PcdEntry>
+ <C_Name>PcdMaxPeiPerformanceLogEntries</C_Name>
+ <Token>0x0001002f</Token>
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>UINT8</DatumType>
+ <ValidUsage>FIXED_AT_BUILD PATCHABLE_IN_MODULE</ValidUsage>
+ <DefaultValue>28</DefaultValue>
+ <HelpText>Maximun number of performance log entries during PEI phase.</HelpText>
+ </PcdEntry>
+ <PcdEntry>
<C_Name>PcdFlashFvBaseArray</C_Name>
<Token>0x31000001</Token>
<TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
diff --git a/EdkModulePkg/Include/Guid/PeiPerformanceHob.h b/EdkModulePkg/Include/Guid/PeiPerformanceHob.h
index 33a2dc9089..c3bfc1f77a 100644
--- a/EdkModulePkg/Include/Guid/PeiPerformanceHob.h
+++ b/EdkModulePkg/Include/Guid/PeiPerformanceHob.h
@@ -33,10 +33,6 @@ Abstract:
//
#define PEI_PERFORMANCE_STRING_SIZE 8
#define PEI_PERFORMANCE_STRING_LENGTH (PEI_PERFORMANCE_STRING_SIZE - 1)
-//
-// Bugbug: This macro will be replaced by a binary patchable PCD entry in EdkModulePkg
-//
-#define MAX_PEI_PERFORMANCE_LOG_ENTRIES 28
typedef struct {
EFI_PHYSICAL_ADDRESS Handle;
diff --git a/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c b/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
index 64c7454c66..268a6a04f2 100644
--- a/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
+++ b/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
@@ -438,7 +438,7 @@ DxeCorePerformanceLibConstructor (
);
ASSERT_EFI_ERROR (Status);
- mMaxGaugeRecords = INIT_DXE_GAUGE_DATA_ENTRIES + MAX_PEI_PERFORMANCE_LOG_ENTRIES;
+ mMaxGaugeRecords = INIT_DXE_GAUGE_DATA_ENTRIES + PcdGet8 (PcdMaxPeiPerformanceLogEntries);
mGaugeData = AllocateZeroPool (sizeof (GAUGE_DATA_HEADER) + (sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords));
ASSERT (mGaugeData != NULL);
diff --git a/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.msa b/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.msa
index f00b9da4a8..ab6edcb912 100644
--- a/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.msa
+++ b/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.msa
@@ -91,5 +91,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<HelpText>The bitmask of flags that specify the enable/disable of
Performance Measurement.</HelpText>
</PcdEntry>
+ <PcdEntry PcdItemType="DYNAMIC">
+ <C_Name>PcdMaxPeiPerformanceLogEntries</C_Name>
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <HelpText>Maximun number of performance log entries during PEI phase.</HelpText>
+ </PcdEntry>
</PcdCoded>
</ModuleSurfaceArea> \ No newline at end of file
diff --git a/EdkModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c b/EdkModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
index b97849fa35..dcb360c5e7 100644
--- a/EdkModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
+++ b/EdkModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
@@ -57,7 +57,7 @@ InternalGetPerformanceHobLog (
// PEI Performance HOB was not found, then build one.
//
PeiPerformanceLogSize = sizeof (PEI_PERFORMANCE_LOG_HEADER) +
- sizeof (PEI_PERFORMANCE_LOG_ENTRY) * MAX_PEI_PERFORMANCE_LOG_ENTRIES;
+ sizeof (PEI_PERFORMANCE_LOG_ENTRY) * PcdGet8 (PcdMaxPeiPerformanceLogEntries);
PeiPerformanceLog = BuildGuidHob (&gPeiPerformanceHobGuid, PeiPerformanceLogSize);
PeiPerformanceLog = ZeroMem (PeiPerformanceLog, PeiPerformanceLogSize);
}
@@ -152,7 +152,7 @@ StartPerformanceMeasurement (
PeiPerformanceLog = InternalGetPerformanceHobLog ();
- if (PeiPerformanceLog->NumberOfEntries >= MAX_PEI_PERFORMANCE_LOG_ENTRIES) {
+ if (PeiPerformanceLog->NumberOfEntries >= PcdGet8 (PcdMaxPeiPerformanceLogEntries)) {
return RETURN_OUT_OF_RESOURCES;
}
Index = PeiPerformanceLog->NumberOfEntries++;
diff --git a/EdkModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.msa b/EdkModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.msa
index 834bd34780..90126acf91 100644
--- a/EdkModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.msa
+++ b/EdkModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.msa
@@ -77,5 +77,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<HelpText>The bitmask of flags that specify the enable/disable of
Performance Measurement.</HelpText>
</PcdEntry>
+ <PcdEntry PcdItemType="DYNAMIC">
+ <C_Name>PcdMaxPeiPerformanceLogEntries</C_Name>
+ <TokenSpaceGuidCName>gEfiEdkModulePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <HelpText>Maximun number of performance log entries during PEI phase.</HelpText>
+ </PcdEntry>
</PcdCoded>
</ModuleSurfaceArea> \ No newline at end of file