diff options
author | Dandan Bi <dandan.bi@intel.com> | 2018-03-01 13:40:48 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2018-03-02 16:18:04 +0800 |
commit | 413b64978381cd9b5dd792101d6cb1c2ee8e8fb1 (patch) | |
tree | 0b860ee9722145a774d8c8ff9439570d708112f5 /MdeModulePkg | |
parent | 82caf21987d0df1de7511804b76a66b279221461 (diff) | |
download | edk2-413b64978381cd9b5dd792101d6cb1c2ee8e8fb1.tar.gz edk2-413b64978381cd9b5dd792101d6cb1c2ee8e8fb1.tar.bz2 edk2-413b64978381cd9b5dd792101d6cb1c2ee8e8fb1.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>
(cherry picked from commit c9f02a96d8a48844e7168e7572b8a1382c2bfd29)
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 5 |
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;
}
|