MdeModulePkg/FPDT: Add error message for unsupported case
authorDandan Bi <dandan.bi@intel.com>
Tue, 10 Apr 2018 05:51:08 +0000 (13:51 +0800)
committerLiming Gao <liming.gao@intel.com>
Mon, 16 Apr 2018 06:37:59 +0000 (14:37 +0800)
We have updated performance infrastructure in previous commits:
between
https://github.com/tianocore/edk2/commit/73fef64f14d1b97ae9bd4705df3becc022391eba
and
https://github.com/tianocore/edk2/commit/115eae650bfd2be2c2bc37360f4a755065e774c4
Update FPDT drivers to collect the performance data reported by
gEdkiiFpdtExtendedFirmwarePerformanceGuid.
The old implementation which collected performance data through
gEfiFirmwarePerformanceGuid is not supported now.
We should add error message to remind user for this unsupported
case in case anyone use it by mistake.

Cc: Liming Gao <liming.gao@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/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c
MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.c

index e5a38121e9deedabe625f5a746b30e9e59373ec4..e719e9e482cb2d280ce8852cd3ed298be85ba64c 100644 (file)
@@ -554,6 +554,9 @@ FpdtStatusCodeListenerDxe (
     // Get the Boot performance table and then install it to ACPI table.\r
     //\r
     CopyMem (&mReceivedAcpiBootPerformanceTable, Data + 1, Data->Size);\r
     // Get the Boot performance table and then install it to ACPI table.\r
     //\r
     CopyMem (&mReceivedAcpiBootPerformanceTable, Data + 1, Data->Size);\r
+  } else if (Data != NULL && CompareGuid (&Data->Type, &gEfiFirmwarePerformanceGuid)) {\r
+    DEBUG ((DEBUG_ERROR, "FpdtStatusCodeListenerDxe: Performance data reported through gEfiFirmwarePerformanceGuid will not be collected by FirmwarePerformanceDataTableDxe\n"));\r
+    Status = EFI_UNSUPPORTED;\r
   } else {\r
     //\r
     // Ignore else progress code.\r
   } else {\r
     //\r
     // Ignore else progress code.\r
index d4ac849ed0033d69a3498fba5f170c64c8709faf..b011ec1103011fefcff3cebd0cf9920aeb74d32b 100644 (file)
@@ -106,6 +106,11 @@ FpdtStatusCodeListenerSmm (
     return EFI_SUCCESS;\r
   }\r
 \r
     return EFI_SUCCESS;\r
   }\r
 \r
+  if (Data != NULL && CompareGuid (&Data->Type, &gEfiFirmwarePerformanceGuid)) {\r
+    DEBUG ((DEBUG_ERROR, "FpdtStatusCodeListenerSmm: Performance data reported through gEfiFirmwarePerformanceGuid will not be collected by FirmwarePerformanceDataTableSmm\n"));\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
   if ((Value != PcdGet32 (PcdProgressCodeS3SuspendStart)) &&\r
       (Value != PcdGet32 (PcdProgressCodeS3SuspendEnd))) {\r
     return EFI_UNSUPPORTED;\r
   if ((Value != PcdGet32 (PcdProgressCodeS3SuspendStart)) &&\r
       (Value != PcdGet32 (PcdProgressCodeS3SuspendEnd))) {\r
     return EFI_UNSUPPORTED;\r