MdeModulePkg DxeCore: Remove unreferenced symbol for memory profile
authorStar Zeng <star.zeng@intel.com>
Tue, 14 Mar 2017 09:05:36 +0000 (17:05 +0800)
committerStar Zeng <star.zeng@intel.com>
Wed, 15 Mar 2017 08:47:20 +0000 (16:47 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=370

Use GLOBAL_REMOVE_IF_UNREFERENCED for some memory profile global variables,
then their symbols could be removed when memory profile is disabled.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c

index b67a17c..a91a719 100644 (file)
@@ -63,11 +63,11 @@ GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_PROFILE_CONTEXT_DATA mMemoryProfileContext
 };\r
 GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_PROFILE_CONTEXT_DATA *mMemoryProfileContextPtr = NULL;\r
 \r
-EFI_LOCK mMemoryProfileLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL_NOTIFY);\r
-BOOLEAN mMemoryProfileGettingStatus = FALSE;\r
-BOOLEAN mMemoryProfileRecordingEnable = MEMORY_PROFILE_RECORDING_DISABLE;\r
-EFI_DEVICE_PATH_PROTOCOL *mMemoryProfileDriverPath;\r
-UINTN                    mMemoryProfileDriverPathSize;\r
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_LOCK mMemoryProfileLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL_NOTIFY);\r
+GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN mMemoryProfileGettingStatus = FALSE;\r
+GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN mMemoryProfileRecordingEnable = MEMORY_PROFILE_RECORDING_DISABLE;\r
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_DEVICE_PATH_PROTOCOL *mMemoryProfileDriverPath;\r
+GLOBAL_REMOVE_IF_UNREFERENCED UINTN                    mMemoryProfileDriverPathSize;\r
 \r
 /**\r
   Get memory profile data.\r
@@ -209,7 +209,7 @@ ProfileProtocolRecord (
   IN CHAR8                              *ActionString OPTIONAL\r
   );\r
 \r
-EDKII_MEMORY_PROFILE_PROTOCOL mProfileProtocol = {\r
+GLOBAL_REMOVE_IF_UNREFERENCED EDKII_MEMORY_PROFILE_PROTOCOL mProfileProtocol = {\r
   ProfileProtocolGetData,\r
   ProfileProtocolRegisterImage,\r
   ProfileProtocolUnregisterImage,\r