mirror of https://github.com/acidanthera/audk.git
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:
parent
a3420902ba
commit
6ffd3b0cd2
|
@ -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>
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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>
|
|
@ -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++;
|
||||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue