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>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Dandan Bi 2018-03-01 13:40:48 +08:00 committed by Star Zeng
parent a7119c8152
commit c9f02a96d8
1 changed files with 2 additions and 3 deletions

View File

@ -283,9 +283,8 @@ AllocateBootPerformanceTable (
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
//
@ -317,7 +316,7 @@ AllocateBootPerformanceTable (
// 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;
}