public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [patch] MdeModulePkg/DxeCorePerfLib: Add status check instead of ASSERT
@ 2018-03-01  7:14 Dandan Bi
  2018-03-01  7:14 ` [patch] MdeModulePkg: Fix incorrect commit introduced by commit SHA-1:052c98 Dandan Bi
  2018-03-02  5:43 ` [patch] MdeModulePkg/DxeCorePerfLib: Add status check instead of ASSERT Gao, Liming
  0 siblings, 2 replies; 5+ messages in thread
From: Dandan Bi @ 2018-03-01  7:14 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao, Star Zeng

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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-03-02  5:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [patch] MdeModulePkg/DxeCorePerfLib: Add status check instead of ASSERT Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox