]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/DxeCorePerfLib: Add status check instead of ASSERT
authorDandan Bi <dandan.bi@intel.com>
Thu, 1 Mar 2018 05:40:48 +0000 (13:40 +0800)
committerStar Zeng <star.zeng@intel.com>
Fri, 2 Mar 2018 08:16:32 +0000 (16:16 +0800)
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>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c

index 9b3224ef6faf5917e55e1fbbfb7e59dc2a61766d..71d624fc9ce90e9f8f49158117befdae0417436d 100644 (file)
@@ -283,9 +283,8 @@ AllocateBootPerformanceTable (
         SmmCommData->Function       = SMM_FPDT_FUNCTION_GET_BOOT_RECORD_SIZE;\r
         SmmCommData->BootRecordData = NULL;\r
         Status = Communication->Communicate (Communication, SmmBootRecordCommBuffer, &CommSize);\r
-        ASSERT_EFI_ERROR (Status);\r
 \r
-        if (!EFI_ERROR (SmmCommData->ReturnStatus) && SmmCommData->BootRecordSize != 0) {\r
+        if (!EFI_ERROR (Status) && !EFI_ERROR (SmmCommData->ReturnStatus) && SmmCommData->BootRecordSize != 0) {\r
           //\r
           // Get all boot records\r
           //\r
@@ -317,7 +316,7 @@ AllocateBootPerformanceTable (
   // Boot Performance table includes BasicBoot record, and one or more appended Boot Records.\r
   //\r
   BootPerformanceDataSize = sizeof (BOOT_PERFORMANCE_TABLE) + mPerformanceLength + PcdGet32 (PcdExtFpdtBootRecordPadSize);\r
-  if (SmmCommData != NULL) {\r
+  if (SmmCommData != NULL && SmmBootRecordData != NULL) {\r
     BootPerformanceDataSize += SmmBootRecordDataSize;\r
   }\r
 \r