]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Remove the useless performance logging code in BootScriptExecutorDxe driver and recor...
authorlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 19 Mar 2012 02:52:15 +0000 (02:52 +0000)
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 19 Mar 2012 02:52:15 +0000 (02:52 +0000)
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

MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf
MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c
MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.h
UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c

index 592d010517cdfd49495b4a40d3527838ca31f3a1..2fbbdb2e315029166e929a33c23eeb41a7a4c99f 100644 (file)
@@ -64,7 +64,6 @@
   UefiBootServicesTableLib\r
   UefiRuntimeServicesTableLib\r
   CacheMaintenanceLib\r
   UefiBootServicesTableLib\r
   UefiRuntimeServicesTableLib\r
   CacheMaintenanceLib\r
-  PerformanceLib\r
   UefiLib\r
   DebugAgentLib\r
   LockBoxLib\r
   UefiLib\r
   DebugAgentLib\r
   LockBoxLib\r
index d4d2a93492dda4b53c4b03a4e7bef49e8daa63df..933c328262bb842c4ac0fdd358811eeb013e0310 100644 (file)
@@ -4,7 +4,7 @@
   This driver is dispatched by Dxe core and the driver will reload itself to ACPI NVS memory\r
   in the entry point. The functionality is to interpret and restore the S3 boot script\r
 \r
   This driver is dispatched by Dxe core and the driver will reload itself to ACPI NVS memory\r
   in the entry point. The functionality is to interpret and restore the S3 boot script\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -18,87 +18,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "ScriptExecute.h"\r
 \r
 \r
 #include "ScriptExecute.h"\r
 \r
-EFI_PHYSICAL_ADDRESS  mPerfDataMemAddress;\r
-UINT64                mS3BootScriptEntryTick;\r
-UINT64                mScriptStartTick;\r
-UINT64                mScriptEndTick;\r
-\r
 EFI_GUID              mBootScriptExecutorImageGuid = {\r
   0x9a8d3433, 0x9fe8, 0x42b6, 0x87, 0xb, 0x1e, 0x31, 0xc8, 0x4e, 0xbe, 0x3b\r
 };\r
 \r
 EFI_GUID              mBootScriptExecutorImageGuid = {\r
   0x9a8d3433, 0x9fe8, 0x42b6, 0x87, 0xb, 0x1e, 0x31, 0xc8, 0x4e, 0xbe, 0x3b\r
 };\r
 \r
-/**\r
-  The event callback is used to get the base address of boot performance data structure on\r
-  LegacyBoot event and ExitBootServices event.\r
-\r
-  @param  Event    The event handle.\r
-  @param  Context  The event context.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-OnBootEvent (\r
-  IN EFI_EVENT        Event,\r
-  IN VOID             *Context\r
-  )\r
-{\r
-  EFI_STATUS Status;\r
-  UINTN      VarSize;\r
-\r
-  VarSize = sizeof (EFI_PHYSICAL_ADDRESS);\r
-  Status = gRT->GetVariable (\r
-                  L"PerfDataMemAddr",\r
-                  &gPerformanceProtocolGuid,\r
-                  NULL,\r
-                  &VarSize,\r
-                  &mPerfDataMemAddress\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    mPerfDataMemAddress = 0;\r
-  }\r
-}\r
-\r
-/**\r
-  Record S3 Script execution time and adjust total S3 resume time for script running.\r
-**/\r
-VOID\r
-WriteToOsS3PerformanceData (\r
-  VOID\r
-  )\r
-{\r
-  UINT64               Ticker;\r
-  UINT64               StartValue;\r
-  UINT64               EndValue;\r
-  UINT64               Freq;\r
-  UINT64               ScriptExecuteTicks;\r
-  PERF_HEADER          *PerfHeader;\r
-  PERF_DATA            *PerfData;\r
-\r
-  Ticker = GetPerformanceCounter ();\r
-\r
-  PerfHeader = (PERF_HEADER *)(UINTN)mPerfDataMemAddress;\r
-  if (PerfHeader == NULL) {\r
-    return;\r
-  }\r
-\r
-  Freq   = GetPerformanceCounterProperties (&StartValue, &EndValue);\r
-  Freq   = DivU64x32 (Freq, 1000);\r
-\r
-  if (EndValue >= StartValue) {\r
-    ScriptExecuteTicks = mScriptEndTick - mScriptStartTick;\r
-    PerfHeader->S3Resume += Ticker - mS3BootScriptEntryTick;\r
-  } else {\r
-    ScriptExecuteTicks = mScriptStartTick - mScriptEndTick;\r
-    PerfHeader->S3Resume += mS3BootScriptEntryTick - Ticker;\r
-  }\r
-  if (PerfHeader->S3EntryNum < PERF_PEI_ENTRY_MAX_NUM) {\r
-    PerfData = &PerfHeader->S3Entry[PerfHeader->S3EntryNum];\r
-    PerfData->Duration = (UINT32) DivU64x32 (ScriptExecuteTicks, (UINT32) Freq);;\r
-    AsciiStrnCpy (PerfData->Token, "ScriptExec", PERF_TOKEN_LENGTH);\r
-    PerfHeader->S3EntryNum++;\r
-  }\r
-}\r
-\r
 /**\r
   Entry function of Boot script exector. This function will be executed in\r
   S3 boot path.\r
 /**\r
   Entry function of Boot script exector. This function will be executed in\r
   S3 boot path.\r
@@ -123,10 +46,6 @@ S3BootScriptExecutorEntryFunction (
   UINTN                                         TempStack[0x10];\r
   UINTN                                         AsmTransferControl16Address;\r
 \r
   UINTN                                         TempStack[0x10];\r
   UINTN                                         AsmTransferControl16Address;\r
 \r
-  PERF_CODE (\r
-    mS3BootScriptEntryTick = GetPerformanceCounter ();\r
-    );\r
-\r
   //\r
   // Disable interrupt of Debug timer, since new IDT table cannot handle it.\r
   //\r
   //\r
   // Disable interrupt of Debug timer, since new IDT table cannot handle it.\r
   //\r
@@ -146,13 +65,7 @@ S3BootScriptExecutorEntryFunction (
   // Because not install BootScriptExecute PPI(used just in this module), So just pass NULL\r
   // for that parameter.\r
   //\r
   // Because not install BootScriptExecute PPI(used just in this module), So just pass NULL\r
   // for that parameter.\r
   //\r
-  PERF_CODE (\r
-    mScriptStartTick = GetPerformanceCounter ();\r
-    );\r
   Status = S3BootScriptExecute ();\r
   Status = S3BootScriptExecute ();\r
-  PERF_CODE (\r
-    mScriptEndTick = GetPerformanceCounter ();\r
-    );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
@@ -218,10 +131,6 @@ S3BootScriptExecutorEntryFunction (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
-  PERF_CODE (\r
-    WriteToOsS3PerformanceData ();\r
-    );\r
-\r
   if (Facs->XFirmwareWakingVector != 0) {\r
     //\r
     // Switch to native waking vector\r
   if (Facs->XFirmwareWakingVector != 0) {\r
     //\r
     // Switch to native waking vector\r
@@ -449,25 +358,6 @@ BootScriptExecutorEntryPoint (
       Status = SetLockBoxAttributes (&gEfiBootScriptExecutorContextGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE);\r
       ASSERT_EFI_ERROR (Status);\r
 \r
       Status = SetLockBoxAttributes (&gEfiBootScriptExecutorContextGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE);\r
       ASSERT_EFI_ERROR (Status);\r
 \r
-      PERF_CODE (\r
-        EFI_EVENT Event;\r
-\r
-        gBS->CreateEventEx (\r
-              EVT_NOTIFY_SIGNAL,\r
-              TPL_NOTIFY,\r
-              OnBootEvent,\r
-              NULL,\r
-              &gEfiEventExitBootServicesGuid,\r
-              &Event\r
-              );\r
-\r
-        EfiCreateEventLegacyBootEx(\r
-          TPL_NOTIFY,\r
-          OnBootEvent,\r
-          NULL,\r
-          &Event\r
-          );\r
-        );\r
     }\r
 \r
     return EFI_SUCCESS;\r
     }\r
 \r
     return EFI_SUCCESS;\r
index 8e4b328db76a059413759d5abc2702c81a265e93..707ab8ca686bd933b6e7580000a652a33fd3e678 100644 (file)
@@ -31,7 +31,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 #include <Library/PcdLib.h>\r
 #include <Library/CacheMaintenanceLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 #include <Library/PcdLib.h>\r
 #include <Library/CacheMaintenanceLib.h>\r
-#include <Library/PerformanceLib.h>\r
 #include <Library/TimerLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/DebugAgentLib.h>\r
 #include <Library/TimerLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/DebugAgentLib.h>\r
@@ -41,7 +40,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Guid/AcpiS3Context.h>\r
 #include <Guid/BootScriptExecutorVariable.h>\r
 #include <Guid/EventGroup.h>\r
 #include <Guid/AcpiS3Context.h>\r
 #include <Guid/BootScriptExecutorVariable.h>\r
 #include <Guid/EventGroup.h>\r
-#include <Guid/Performance.h>\r
 #include <IndustryStandard/Acpi.h>\r
 /**\r
   a ASM function to transfer control to OS.\r
 #include <IndustryStandard/Acpi.h>\r
 /**\r
   a ASM function to transfer control to OS.\r
index c0680bf7715767055e0a243ef40c42024d7c44aa..50b2f7bc0a450ae7556f9df059f947d8686eb7f9 100644 (file)
@@ -390,6 +390,8 @@ S3ResumeBootOs (
   //\r
   AsmWriteIdtr (&PeiS3ResumeState->Idtr);\r
 \r
   //\r
   AsmWriteIdtr (&PeiS3ResumeState->Idtr);\r
 \r
+  PERF_END (NULL, "ScriptExec", NULL, 0);\r
+\r
   //\r
   // Install BootScriptDonePpi\r
   //\r
   //\r
   // Install BootScriptDonePpi\r
   //\r
@@ -742,6 +744,8 @@ S3ResumeExecuteBootScript (
   //\r
   AsmReadIdtr (&PeiS3ResumeState->Idtr);\r
 \r
   //\r
   AsmReadIdtr (&PeiS3ResumeState->Idtr);\r
 \r
+  PERF_START (NULL, "ScriptExec", NULL, 0);\r
+\r
   if (FeaturePcdGet (PcdDxeIplSwitchToLongMode)) {\r
     //\r
     // X64 S3 Resume\r
   if (FeaturePcdGet (PcdDxeIplSwitchToLongMode)) {\r
     //\r
     // X64 S3 Resume\r