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
This commit is contained in:
qhuang8 2006-08-29 01:52:19 +00:00
parent a3420902ba
commit 6ffd3b0cd2
6 changed files with 22 additions and 7 deletions

View File

@ -987,6 +987,15 @@
<DefaultValue>4</DefaultValue> <DefaultValue>4</DefaultValue>
<HelpText>kbytes size of runtime memory.</HelpText> <HelpText>kbytes size of runtime memory.</HelpText>
</PcdEntry> </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> <PcdEntry>
<C_Name>PcdFlashFvBaseArray</C_Name> <C_Name>PcdFlashFvBaseArray</C_Name>
<Token>0x31000001</Token> <Token>0x31000001</Token>

View File

@ -33,10 +33,6 @@ Abstract:
// //
#define PEI_PERFORMANCE_STRING_SIZE 8 #define PEI_PERFORMANCE_STRING_SIZE 8
#define PEI_PERFORMANCE_STRING_LENGTH (PEI_PERFORMANCE_STRING_SIZE - 1) #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 { typedef struct {
EFI_PHYSICAL_ADDRESS Handle; EFI_PHYSICAL_ADDRESS Handle;

View File

@ -438,7 +438,7 @@ DxeCorePerformanceLibConstructor (
); );
ASSERT_EFI_ERROR (Status); 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)); mGaugeData = AllocateZeroPool (sizeof (GAUGE_DATA_HEADER) + (sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords));
ASSERT (mGaugeData != NULL); ASSERT (mGaugeData != NULL);

View File

@ -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 <HelpText>The bitmask of flags that specify the enable/disable of
Performance Measurement.</HelpText> Performance Measurement.</HelpText>
</PcdEntry> </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> </PcdCoded>
</ModuleSurfaceArea> </ModuleSurfaceArea>

View File

@ -57,7 +57,7 @@ InternalGetPerformanceHobLog (
// PEI Performance HOB was not found, then build one. // PEI Performance HOB was not found, then build one.
// //
PeiPerformanceLogSize = sizeof (PEI_PERFORMANCE_LOG_HEADER) + 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 = BuildGuidHob (&gPeiPerformanceHobGuid, PeiPerformanceLogSize);
PeiPerformanceLog = ZeroMem (PeiPerformanceLog, PeiPerformanceLogSize); PeiPerformanceLog = ZeroMem (PeiPerformanceLog, PeiPerformanceLogSize);
} }
@ -152,7 +152,7 @@ StartPerformanceMeasurement (
PeiPerformanceLog = InternalGetPerformanceHobLog (); PeiPerformanceLog = InternalGetPerformanceHobLog ();
if (PeiPerformanceLog->NumberOfEntries >= MAX_PEI_PERFORMANCE_LOG_ENTRIES) { if (PeiPerformanceLog->NumberOfEntries >= PcdGet8 (PcdMaxPeiPerformanceLogEntries)) {
return RETURN_OUT_OF_RESOURCES; return RETURN_OUT_OF_RESOURCES;
} }
Index = PeiPerformanceLog->NumberOfEntries++; Index = PeiPerformanceLog->NumberOfEntries++;

View File

@ -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 <HelpText>The bitmask of flags that specify the enable/disable of
Performance Measurement.</HelpText> Performance Measurement.</HelpText>
</PcdEntry> </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> </PcdCoded>
</ModuleSurfaceArea> </ModuleSurfaceArea>