[edk2] [PATCH v2] UefiCpuPkg/S3Resume: Add more perf entry for S3 phase

Dandan Bi posted 1 patch 6 years, 2 months ago
Failed in applying to current master (apply log)
UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
[edk2] [PATCH v2] UefiCpuPkg/S3Resume: Add more perf entry for S3 phase
Posted by Dandan Bi 6 years, 2 months ago
V2: Just update the commit message.

Add more perf entry to hook BootScriptDonePpi/EndOfPeiPpi/
EndOfS3Resume.

Add the new perf entry with Identifier
PERF_INMODULE_START_ID/PERF_INMODULE_END_ID which are defined
in new performance infrastructure (edk2 trunk commit hash value:
SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4).
PERF_INMODULE_START_ID/PERF_INMODULE_END_ID are general Identifier
which are used within a module.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
index b597ac7..d7d2a4d 100644
--- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
+++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
@@ -2,11 +2,11 @@
   This module produces the EFI_PEI_S3_RESUME2_PPI.
   This module works with StandAloneBootScriptExecutor to S3 resume to OS.
   This module will execute the boot script saved during last boot and after that,
   control is passed to OS waking up handler.
 
-  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
   Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions
   of the BSD License which accompanies this distribution.  The
@@ -21,10 +21,11 @@
 #include <PiPei.h>
 
 #include <Guid/AcpiS3Context.h>
 #include <Guid/BootScriptExecutorVariable.h>
 #include <Guid/Performance.h>
+#include <Guid/ExtendedFirmwarePerformance.h>
 #include <Guid/EndOfS3Resume.h>
 #include <Ppi/ReadOnlyVariable2.h>
 #include <Ppi/S3Resume2.h>
 #include <Ppi/SmmAccess.h>
 #include <Ppi/PostBootScriptTable.h>
@@ -551,13 +552,17 @@ S3ResumeBootOs (
   PERF_END (NULL, "ScriptExec", NULL, 0);
 
   //
   // Install BootScriptDonePpi
   //
+  PERF_START_EX (NULL, "BootScriptDonePpi", NULL, 0, PERF_INMODULE_START_ID);
+
   Status = PeiServicesInstallPpi (&mPpiListPostScriptTable);
   ASSERT_EFI_ERROR (Status);
 
+  PERF_END_EX (NULL, "BootScriptDonePpi", NULL, 0, PERF_INMODULE_END_ID);
+
   //
   // Get ACPI Table Address
   //
   Facs = (EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *) ((UINTN) (AcpiS3Context->AcpiFacsTable));
 
@@ -576,18 +581,26 @@ S3ResumeBootOs (
   }
 
   //
   // Install EndOfPeiPpi
   //
+  PERF_START_EX (NULL, "EndOfPeiPpi", NULL, 0, PERF_INMODULE_START_ID);
+
   Status = PeiServicesInstallPpi (&mPpiListEndOfPeiTable);
   ASSERT_EFI_ERROR (Status);
 
+  PERF_END_EX (NULL, "EndOfPeiPpi", NULL, 0, PERF_INMODULE_END_ID);
+
   //
   // Signal EndOfS3Resume event.
   //
+  PERF_START_EX (NULL, "EndOfS3Resume", NULL, 0, PERF_INMODULE_START_ID);
+
   SignalEndOfS3Resume ();
 
+  PERF_END_EX (NULL, "EndOfS3Resume", NULL, 0, PERF_INMODULE_END_ID);
+
   //
   // report status code on S3 resume
   //
   REPORT_STATUS_CODE (EFI_PROGRESS_CODE, EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_PC_OS_WAKE);
 
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v2] UefiCpuPkg/S3Resume: Add more perf entry for S3 phase
Posted by Gao, Liming 6 years, 2 months ago
Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Bi, Dandan
>Sent: Thursday, February 08, 2018 2:20 PM
>To: edk2-devel@lists.01.org
>Cc: Dong, Eric <eric.dong@intel.com>; Laszlo Ersek <lersek@redhat.com>;
>Gao, Liming <liming.gao@intel.com>
>Subject: [PATCH v2] UefiCpuPkg/S3Resume: Add more perf entry for S3
>phase
>
>V2: Just update the commit message.
>
>Add more perf entry to hook BootScriptDonePpi/EndOfPeiPpi/
>EndOfS3Resume.
>
>Add the new perf entry with Identifier
>PERF_INMODULE_START_ID/PERF_INMODULE_END_ID which are defined
>in new performance infrastructure (edk2 trunk commit hash value:
>SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
>SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4).
>PERF_INMODULE_START_ID/PERF_INMODULE_END_ID are general Identifier
>which are used within a module.
>
>Cc: Eric Dong <eric.dong@intel.com>
>Cc: Laszlo Ersek <lersek@redhat.com>
>Cc: Liming Gao <liming.gao@intel.com>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Dandan Bi <dandan.bi@intel.com>
>---
> UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 15
>++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
>
>diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
>b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
>index b597ac7..d7d2a4d 100644
>--- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
>+++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
>@@ -2,11 +2,11 @@
>   This module produces the EFI_PEI_S3_RESUME2_PPI.
>   This module works with StandAloneBootScriptExecutor to S3 resume to OS.
>   This module will execute the boot script saved during last boot and after that,
>   control is passed to OS waking up handler.
>
>-  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
>+  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
>   Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
>
>   This program and the accompanying materials
>   are licensed and made available under the terms and conditions
>   of the BSD License which accompanies this distribution.  The
>@@ -21,10 +21,11 @@
> #include <PiPei.h>
>
> #include <Guid/AcpiS3Context.h>
> #include <Guid/BootScriptExecutorVariable.h>
> #include <Guid/Performance.h>
>+#include <Guid/ExtendedFirmwarePerformance.h>
> #include <Guid/EndOfS3Resume.h>
> #include <Ppi/ReadOnlyVariable2.h>
> #include <Ppi/S3Resume2.h>
> #include <Ppi/SmmAccess.h>
> #include <Ppi/PostBootScriptTable.h>
>@@ -551,13 +552,17 @@ S3ResumeBootOs (
>   PERF_END (NULL, "ScriptExec", NULL, 0);
>
>   //
>   // Install BootScriptDonePpi
>   //
>+  PERF_START_EX (NULL, "BootScriptDonePpi", NULL, 0,
>PERF_INMODULE_START_ID);
>+
>   Status = PeiServicesInstallPpi (&mPpiListPostScriptTable);
>   ASSERT_EFI_ERROR (Status);
>
>+  PERF_END_EX (NULL, "BootScriptDonePpi", NULL, 0,
>PERF_INMODULE_END_ID);
>+
>   //
>   // Get ACPI Table Address
>   //
>   Facs = (EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *) ((UINTN)
>(AcpiS3Context->AcpiFacsTable));
>
>@@ -576,18 +581,26 @@ S3ResumeBootOs (
>   }
>
>   //
>   // Install EndOfPeiPpi
>   //
>+  PERF_START_EX (NULL, "EndOfPeiPpi", NULL, 0,
>PERF_INMODULE_START_ID);
>+
>   Status = PeiServicesInstallPpi (&mPpiListEndOfPeiTable);
>   ASSERT_EFI_ERROR (Status);
>
>+  PERF_END_EX (NULL, "EndOfPeiPpi", NULL, 0, PERF_INMODULE_END_ID);
>+
>   //
>   // Signal EndOfS3Resume event.
>   //
>+  PERF_START_EX (NULL, "EndOfS3Resume", NULL, 0,
>PERF_INMODULE_START_ID);
>+
>   SignalEndOfS3Resume ();
>
>+  PERF_END_EX (NULL, "EndOfS3Resume", NULL, 0,
>PERF_INMODULE_END_ID);
>+
>   //
>   // report status code on S3 resume
>   //
>   REPORT_STATUS_CODE (EFI_PROGRESS_CODE,
>EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_PC_OS_WAKE);
>
>--
>1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v2] UefiCpuPkg/S3Resume: Add more perf entry for S3 phase
Posted by Laszlo Ersek 6 years, 2 months ago
On 02/08/18 07:19, Dandan Bi wrote:
> V2: Just update the commit message.
> 
> Add more perf entry to hook BootScriptDonePpi/EndOfPeiPpi/
> EndOfS3Resume.
> 
> Add the new perf entry with Identifier
> PERF_INMODULE_START_ID/PERF_INMODULE_END_ID which are defined
> in new performance infrastructure (edk2 trunk commit hash value:
> SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
> SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4).
> PERF_INMODULE_START_ID/PERF_INMODULE_END_ID are general Identifier
> which are used within a module.
> 
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
>  UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)

Thanks for the commit mesage update.

Acked-by: Laszlo Ersek <lersek@redhat.com>

Laszlo

> diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
> index b597ac7..d7d2a4d 100644
> --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
> +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
> @@ -2,11 +2,11 @@
>    This module produces the EFI_PEI_S3_RESUME2_PPI.
>    This module works with StandAloneBootScriptExecutor to S3 resume to OS.
>    This module will execute the boot script saved during last boot and after that,
>    control is passed to OS waking up handler.
>  
> -  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
>    Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
>  
>    This program and the accompanying materials
>    are licensed and made available under the terms and conditions
>    of the BSD License which accompanies this distribution.  The
> @@ -21,10 +21,11 @@
>  #include <PiPei.h>
>  
>  #include <Guid/AcpiS3Context.h>
>  #include <Guid/BootScriptExecutorVariable.h>
>  #include <Guid/Performance.h>
> +#include <Guid/ExtendedFirmwarePerformance.h>
>  #include <Guid/EndOfS3Resume.h>
>  #include <Ppi/ReadOnlyVariable2.h>
>  #include <Ppi/S3Resume2.h>
>  #include <Ppi/SmmAccess.h>
>  #include <Ppi/PostBootScriptTable.h>
> @@ -551,13 +552,17 @@ S3ResumeBootOs (
>    PERF_END (NULL, "ScriptExec", NULL, 0);
>  
>    //
>    // Install BootScriptDonePpi
>    //
> +  PERF_START_EX (NULL, "BootScriptDonePpi", NULL, 0, PERF_INMODULE_START_ID);
> +
>    Status = PeiServicesInstallPpi (&mPpiListPostScriptTable);
>    ASSERT_EFI_ERROR (Status);
>  
> +  PERF_END_EX (NULL, "BootScriptDonePpi", NULL, 0, PERF_INMODULE_END_ID);
> +
>    //
>    // Get ACPI Table Address
>    //
>    Facs = (EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *) ((UINTN) (AcpiS3Context->AcpiFacsTable));
>  
> @@ -576,18 +581,26 @@ S3ResumeBootOs (
>    }
>  
>    //
>    // Install EndOfPeiPpi
>    //
> +  PERF_START_EX (NULL, "EndOfPeiPpi", NULL, 0, PERF_INMODULE_START_ID);
> +
>    Status = PeiServicesInstallPpi (&mPpiListEndOfPeiTable);
>    ASSERT_EFI_ERROR (Status);
>  
> +  PERF_END_EX (NULL, "EndOfPeiPpi", NULL, 0, PERF_INMODULE_END_ID);
> +
>    //
>    // Signal EndOfS3Resume event.
>    //
> +  PERF_START_EX (NULL, "EndOfS3Resume", NULL, 0, PERF_INMODULE_START_ID);
> +
>    SignalEndOfS3Resume ();
>  
> +  PERF_END_EX (NULL, "EndOfS3Resume", NULL, 0, PERF_INMODULE_END_ID);
> +
>    //
>    // report status code on S3 resume
>    //
>    REPORT_STATUS_CODE (EFI_PROGRESS_CODE, EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_PC_OS_WAKE);
>  
> 

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel