public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: "Bi, Dandan" <dandan.bi@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Zeng, Star" <star.zeng@intel.com>
Subject: Re: [patch] MdeModulePkg/DxeCorePerfLib: Add status check instead of ASSERT
Date: Fri, 2 Mar 2018 05:43:38 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1D617A@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1519888455-89636-1-git-send-email-dandan.bi@intel.com>

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Dandan Bi
> Sent: Thursday, March 1, 2018 3:14 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [edk2] [patch] MdeModulePkg/DxeCorePerfLib: Add status check instead of ASSERT
> 
> Currently DxeCorePerformanceLib will get SMM performance data based
> on SMM communication handler. If SMM communication handler returns error,
> the library will ASSERT. In fact, if SMM perf data is not found.
> DXE perf data can still be dumped. So using status check instead of
> ASSERT is better.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
>  MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
> b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
> index 9b3224e..71d624f 100644
> --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
> +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
> @@ -281,13 +281,12 @@ AllocateBootPerformanceTable (
>          // Get the size of boot records.
>          //
>          SmmCommData->Function       = SMM_FPDT_FUNCTION_GET_BOOT_RECORD_SIZE;
>          SmmCommData->BootRecordData = NULL;
>          Status = Communication->Communicate (Communication, SmmBootRecordCommBuffer, &CommSize);
> -        ASSERT_EFI_ERROR (Status);
> 
> -        if (!EFI_ERROR (SmmCommData->ReturnStatus) && SmmCommData->BootRecordSize != 0) {
> +        if (!EFI_ERROR (Status) && !EFI_ERROR (SmmCommData->ReturnStatus) && SmmCommData->BootRecordSize != 0) {
>            //
>            // Get all boot records
>            //
>            SmmCommData->Function       = SMM_FPDT_FUNCTION_GET_BOOT_RECORD_DATA_BY_OFFSET;
>            SmmBootRecordDataSize       = SmmCommData->BootRecordSize;
> @@ -315,11 +314,11 @@ AllocateBootPerformanceTable (
>    //
>    // Prepare memory for Boot Performance table.
>    // Boot Performance table includes BasicBoot record, and one or more appended Boot Records.
>    //
>    BootPerformanceDataSize = sizeof (BOOT_PERFORMANCE_TABLE) + mPerformanceLength + PcdGet32
> (PcdExtFpdtBootRecordPadSize);
> -  if (SmmCommData != NULL) {
> +  if (SmmCommData != NULL && SmmBootRecordData != NULL) {
>      BootPerformanceDataSize += SmmBootRecordDataSize;
>    }
> 
>    //
>    // Try to allocate the same runtime buffer as last time boot.
> --
> 1.9.5.msysgit.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


      parent reply	other threads:[~2018-03-02  5:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01  7:14 [patch] MdeModulePkg/DxeCorePerfLib: Add status check instead of ASSERT Dandan Bi
2018-03-01  7:14 ` [patch] MdeModulePkg: Fix incorrect commit introduced by commit SHA-1:052c98 Dandan Bi
2018-03-02  5:23   ` Gao, Liming
2018-03-02  5:26     ` Zeng, Star
2018-03-02  5:43 ` Gao, Liming [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E1D617A@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox