From b5a144ec6a44d82a63f156d4e83b87213a94d132 Mon Sep 17 00:00:00 2001 From: jgong5 Date: Thu, 4 Feb 2010 04:32:09 +0000 Subject: [PATCH] =?UTF-8?q?Performance.c=20in=20GenericBdsLib=20is=20updat?= =?UTF-8?q?ed=20not=20to=20filter=20log=20entries=20that=20don=E2=80=99t?= =?UTF-8?q?=20contain=20DXE=20handles.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9928 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/GenericBdsLib/Performance.c | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c index 119a6e46d2..6bb60c1500 100644 --- a/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c +++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c @@ -164,6 +164,12 @@ WriteBootToOsPerformanceData ( UINT64 StartValue; UINT64 EndValue; BOOLEAN CountUp; + UINTN EntryIndex; + UINTN NumPerfEntries; + // + // List of flags indicating PerfEntry contains DXE handle + // + BOOLEAN *PerfEntriesAsDxeHandle; // // Retrieve time stamp count as early as possible @@ -224,7 +230,19 @@ WriteBootToOsPerformanceData ( Ptr = (UINT8 *) ((UINT32) mAcpiLowMemoryBase + sizeof (PERF_HEADER)); LimitCount = (AcpiLowMemoryLength - sizeof (PERF_HEADER)) / sizeof (PERF_DATA); - + NumPerfEntries = 0; + LogEntryKey = 0; + while ((LogEntryKey = GetPerformanceMeasurement ( + LogEntryKey, + &Handle, + &Token, + &Module, + &StartTicker, + &EndTicker)) != 0) { + NumPerfEntries++; + } + PerfEntriesAsDxeHandle = AllocateZeroPool (NumPerfEntries * sizeof (BOOLEAN)); + ASSERT (PerfEntriesAsDxeHandle != NULL); // // Get DXE drivers performance @@ -232,6 +250,7 @@ WriteBootToOsPerformanceData ( for (Index = 0; Index < NoHandles; Index++) { Ticker = 0; LogEntryKey = 0; + EntryIndex = 0; while ((LogEntryKey = GetPerformanceMeasurement ( LogEntryKey, &Handle, @@ -239,6 +258,10 @@ WriteBootToOsPerformanceData ( &Module, &StartTicker, &EndTicker)) != 0) { + if (Handle == Handles[Index] && !PerfEntriesAsDxeHandle[EntryIndex]) { + PerfEntriesAsDxeHandle[EntryIndex] = TRUE; + } + EntryIndex++; if ((Handle == Handles[Index]) && (EndTicker != 0)) { Ticker += CountUp ? (EndTicker - StartTicker) : (StartTicker - EndTicker); } @@ -263,12 +286,11 @@ WriteBootToOsPerformanceData ( } } - FreePool (Handles); - // // Get inserted performance data // LogEntryKey = 0; + EntryIndex = 0; while ((LogEntryKey = GetPerformanceMeasurement ( LogEntryKey, &Handle, @@ -276,7 +298,7 @@ WriteBootToOsPerformanceData ( &Module, &StartTicker, &EndTicker)) != 0) { - if (Handle == NULL && EndTicker != 0) { + if (!PerfEntriesAsDxeHandle[EntryIndex] && EndTicker != 0) { ZeroMem (&mPerfData, sizeof (PERF_DATA)); @@ -293,10 +315,14 @@ WriteBootToOsPerformanceData ( goto Done; } } + EntryIndex++; } Done: + FreePool (Handles); + FreePool (PerfEntriesAsDxeHandle); + mPerfHeader.Signiture = PERFORMANCE_SIGNATURE; //