]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
Modify the implementation of performance library so that:
[mirror_edk2.git] / EdkModulePkg / Library / DxeCorePerformanceLib / DxeCorePerformanceLib.c
index 5874902e2e37c0f6521a6bc3bb08a06887ca4bd7..64c7454c662631a9b97282493bbab4a0d9849542 100644 (file)
@@ -236,7 +236,7 @@ StartGauge (
     //\r
     mGaugeData = CopyMem (mGaugeData, OldGaugeData, OldGaugeDataSize);\r
     \r
-    gBS->FreePool (OldGaugeData); \r
+    FreePool (OldGaugeData); \r
   }\r
   \r
   GaugeEntryArray               = (GAUGE_DATA_ENTRY *) (mGaugeData + 1);\r
@@ -421,6 +421,12 @@ DxeCorePerformanceLibConstructor (
 {\r
   EFI_STATUS                Status;\r
 \r
+  if (!PerformanceMeasurementEnabled ()) {\r
+    //\r
+    // Do not initialize performance infrastructure if not required.\r
+    //\r
+    return EFI_SUCCESS;\r
+  }\r
   //\r
   // Install the protocol interfaces.\r
   //\r