summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library/DxeCorePerformanceLib
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2018-03-01 13:40:48 +0800
committerStar Zeng <star.zeng@intel.com>2018-03-02 16:16:32 +0800
commitc9f02a96d8a48844e7168e7572b8a1382c2bfd29 (patch)
tree9cfc5d0a9fad8d02b350f5af1b71b434a2e1d68e /MdeModulePkg/Library/DxeCorePerformanceLib
parenta7119c81528072b13e9664ce51f70b8f91f4d9e2 (diff)
downloadedk2-c9f02a96d8a48844e7168e7572b8a1382c2bfd29.tar.gz
edk2-c9f02a96d8a48844e7168e7572b8a1382c2bfd29.tar.bz2
edk2-c9f02a96d8a48844e7168e7572b8a1382c2bfd29.zip
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>
Diffstat (limited to 'MdeModulePkg/Library/DxeCorePerformanceLib')
-rw-r--r--MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
index 9b3224ef6f..71d624fc9c 100644
--- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
+++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
@@ -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;
}