diff options
author | lzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-03-19 02:52:15 +0000 |
---|---|---|
committer | lzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-03-19 02:52:15 +0000 |
commit | 5c0687ccc27a427e5e50f35e593814055d714d9b (patch) | |
tree | 181acda7f94cab37fe5a53e4411e874896692acc /MdeModulePkg/Universal/Acpi | |
parent | 5d81a9b3a8f41a34235f352bf394f0b1cf633fe9 (diff) | |
download | edk2-platforms-5c0687ccc27a427e5e50f35e593814055d714d9b.tar.xz |
Remove the useless performance logging code in BootScriptExecutorDxe driver and record S3 "ScriptExec" performance log before and after executing BootScriptExecutorEntrypoint in S3Reusme2Pei driver.
Signed-off-by: lzeng14
Reviewed-by: lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13108 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Acpi')
3 files changed, 1 insertions, 114 deletions
diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf index 592d010517..2fbbdb2e31 100644 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf +++ b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf @@ -64,7 +64,6 @@ UefiBootServicesTableLib
UefiRuntimeServicesTableLib
CacheMaintenanceLib
- PerformanceLib
UefiLib
DebugAgentLib
LockBoxLib
diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c index d4d2a93492..933c328262 100644 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c +++ b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c @@ -4,7 +4,7 @@ This driver is dispatched by Dxe core and the driver will reload itself to ACPI NVS memory
in the entry point. The functionality is to interpret and restore the S3 boot script
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -18,88 +18,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "ScriptExecute.h"
-EFI_PHYSICAL_ADDRESS mPerfDataMemAddress;
-UINT64 mS3BootScriptEntryTick;
-UINT64 mScriptStartTick;
-UINT64 mScriptEndTick;
-
EFI_GUID mBootScriptExecutorImageGuid = {
0x9a8d3433, 0x9fe8, 0x42b6, 0x87, 0xb, 0x1e, 0x31, 0xc8, 0x4e, 0xbe, 0x3b
};
/**
- The event callback is used to get the base address of boot performance data structure on
- LegacyBoot event and ExitBootServices event.
-
- @param Event The event handle.
- @param Context The event context.
-
-**/
-VOID
-EFIAPI
-OnBootEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- EFI_STATUS Status;
- UINTN VarSize;
-
- VarSize = sizeof (EFI_PHYSICAL_ADDRESS);
- Status = gRT->GetVariable (
- L"PerfDataMemAddr",
- &gPerformanceProtocolGuid,
- NULL,
- &VarSize,
- &mPerfDataMemAddress
- );
- if (EFI_ERROR (Status)) {
- mPerfDataMemAddress = 0;
- }
-}
-
-/**
- Record S3 Script execution time and adjust total S3 resume time for script running.
-**/
-VOID
-WriteToOsS3PerformanceData (
- VOID
- )
-{
- UINT64 Ticker;
- UINT64 StartValue;
- UINT64 EndValue;
- UINT64 Freq;
- UINT64 ScriptExecuteTicks;
- PERF_HEADER *PerfHeader;
- PERF_DATA *PerfData;
-
- Ticker = GetPerformanceCounter ();
-
- PerfHeader = (PERF_HEADER *)(UINTN)mPerfDataMemAddress;
- if (PerfHeader == NULL) {
- return;
- }
-
- Freq = GetPerformanceCounterProperties (&StartValue, &EndValue);
- Freq = DivU64x32 (Freq, 1000);
-
- if (EndValue >= StartValue) {
- ScriptExecuteTicks = mScriptEndTick - mScriptStartTick;
- PerfHeader->S3Resume += Ticker - mS3BootScriptEntryTick;
- } else {
- ScriptExecuteTicks = mScriptStartTick - mScriptEndTick;
- PerfHeader->S3Resume += mS3BootScriptEntryTick - Ticker;
- }
- if (PerfHeader->S3EntryNum < PERF_PEI_ENTRY_MAX_NUM) {
- PerfData = &PerfHeader->S3Entry[PerfHeader->S3EntryNum];
- PerfData->Duration = (UINT32) DivU64x32 (ScriptExecuteTicks, (UINT32) Freq);;
- AsciiStrnCpy (PerfData->Token, "ScriptExec", PERF_TOKEN_LENGTH);
- PerfHeader->S3EntryNum++;
- }
-}
-
-/**
Entry function of Boot script exector. This function will be executed in
S3 boot path.
This function should not return, because it is invoked by switch stack.
@@ -123,10 +46,6 @@ S3BootScriptExecutorEntryFunction ( UINTN TempStack[0x10];
UINTN AsmTransferControl16Address;
- PERF_CODE (
- mS3BootScriptEntryTick = GetPerformanceCounter ();
- );
-
//
// Disable interrupt of Debug timer, since new IDT table cannot handle it.
//
@@ -146,13 +65,7 @@ S3BootScriptExecutorEntryFunction ( // Because not install BootScriptExecute PPI(used just in this module), So just pass NULL
// for that parameter.
//
- PERF_CODE (
- mScriptStartTick = GetPerformanceCounter ();
- );
Status = S3BootScriptExecute ();
- PERF_CODE (
- mScriptEndTick = GetPerformanceCounter ();
- );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -218,10 +131,6 @@ S3BootScriptExecutorEntryFunction ( return EFI_UNSUPPORTED;
}
- PERF_CODE (
- WriteToOsS3PerformanceData ();
- );
-
if (Facs->XFirmwareWakingVector != 0) {
//
// Switch to native waking vector
@@ -449,25 +358,6 @@ BootScriptExecutorEntryPoint ( Status = SetLockBoxAttributes (&gEfiBootScriptExecutorContextGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE);
ASSERT_EFI_ERROR (Status);
- PERF_CODE (
- EFI_EVENT Event;
-
- gBS->CreateEventEx (
- EVT_NOTIFY_SIGNAL,
- TPL_NOTIFY,
- OnBootEvent,
- NULL,
- &gEfiEventExitBootServicesGuid,
- &Event
- );
-
- EfiCreateEventLegacyBootEx(
- TPL_NOTIFY,
- OnBootEvent,
- NULL,
- &Event
- );
- );
}
return EFI_SUCCESS;
diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.h b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.h index 8e4b328db7..707ab8ca68 100644 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.h +++ b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.h @@ -31,7 +31,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/PcdLib.h>
#include <Library/CacheMaintenanceLib.h>
-#include <Library/PerformanceLib.h>
#include <Library/TimerLib.h>
#include <Library/UefiLib.h>
#include <Library/DebugAgentLib.h>
@@ -41,7 +40,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Guid/AcpiS3Context.h>
#include <Guid/BootScriptExecutorVariable.h>
#include <Guid/EventGroup.h>
-#include <Guid/Performance.h>
#include <IndustryStandard/Acpi.h>
/**
a ASM function to transfer control to OS.
|