From b187ce9f15c2018d3ee837b873e38eacd331d5c7 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Mon, 28 Aug 2006 08:36:01 +0000 Subject: Modify the implementation of performance library so that: PcdPerformanceLibraryPropertyMask can turn on/off performance measurement. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1395 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'EdkModulePkg/Library/DxeCorePerformanceLib') diff --git a/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c b/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c index 5874902e2e..64c7454c66 100644 --- a/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c +++ b/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c @@ -236,7 +236,7 @@ StartGauge ( // mGaugeData = CopyMem (mGaugeData, OldGaugeData, OldGaugeDataSize); - gBS->FreePool (OldGaugeData); + FreePool (OldGaugeData); } GaugeEntryArray = (GAUGE_DATA_ENTRY *) (mGaugeData + 1); @@ -421,6 +421,12 @@ DxeCorePerformanceLibConstructor ( { EFI_STATUS Status; + if (!PerformanceMeasurementEnabled ()) { + // + // Do not initialize performance infrastructure if not required. + // + return EFI_SUCCESS; + } // // Install the protocol interfaces. // -- cgit v1.2.3