[edk2] [PATCH] MdeModulePkg DxeCore: Remove unreferenced symbol for memory profile

Star Zeng posted 1 patch 7 years, 7 months ago
Failed in applying to current master (apply log)
MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
[edk2] [PATCH] MdeModulePkg DxeCore: Remove unreferenced symbol for memory profile
Posted by Star Zeng 7 years, 7 months ago
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>
---
 MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
index b67a17c86dff..a91a719b4de5 100644
--- a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
+++ b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
@@ -63,11 +63,11 @@ GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_PROFILE_CONTEXT_DATA mMemoryProfileContext
 };
 GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_PROFILE_CONTEXT_DATA *mMemoryProfileContextPtr = NULL;
 
-EFI_LOCK mMemoryProfileLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL_NOTIFY);
-BOOLEAN mMemoryProfileGettingStatus = FALSE;
-BOOLEAN mMemoryProfileRecordingEnable = MEMORY_PROFILE_RECORDING_DISABLE;
-EFI_DEVICE_PATH_PROTOCOL *mMemoryProfileDriverPath;
-UINTN                    mMemoryProfileDriverPathSize;
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_LOCK mMemoryProfileLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL_NOTIFY);
+GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN mMemoryProfileGettingStatus = FALSE;
+GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN mMemoryProfileRecordingEnable = MEMORY_PROFILE_RECORDING_DISABLE;
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_DEVICE_PATH_PROTOCOL *mMemoryProfileDriverPath;
+GLOBAL_REMOVE_IF_UNREFERENCED UINTN                    mMemoryProfileDriverPathSize;
 
 /**
   Get memory profile data.
@@ -209,7 +209,7 @@ ProfileProtocolRecord (
   IN CHAR8                              *ActionString OPTIONAL
   );
 
-EDKII_MEMORY_PROFILE_PROTOCOL mProfileProtocol = {
+GLOBAL_REMOVE_IF_UNREFERENCED EDKII_MEMORY_PROFILE_PROTOCOL mProfileProtocol = {
   ProfileProtocolGetData,
   ProfileProtocolRegisterImage,
   ProfileProtocolUnregisterImage,
-- 
2.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] MdeModulePkg DxeCore: Remove unreferenced symbol for memory profile
Posted by Yao, Jiewen 7 years, 7 months ago
Reviewed-by: Jiewen.yao@intel.com

> -----Original Message-----
> From: Zeng, Star
> Sent: Tuesday, March 14, 2017 5:11 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Tian,
> Feng <feng.tian@intel.com>
> Subject: [PATCH] MdeModulePkg DxeCore: Remove unreferenced symbol for
> memory profile
> 
> 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>
> ---
>  MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
> b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
> index b67a17c86dff..a91a719b4de5 100644
> --- a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
> +++ b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
> @@ -63,11 +63,11 @@ GLOBAL_REMOVE_IF_UNREFERENCED
> MEMORY_PROFILE_CONTEXT_DATA mMemoryProfileContext
>  };
>  GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_PROFILE_CONTEXT_DATA
> *mMemoryProfileContextPtr = NULL;
> 
> -EFI_LOCK mMemoryProfileLock = EFI_INITIALIZE_LOCK_VARIABLE
> (TPL_NOTIFY);
> -BOOLEAN mMemoryProfileGettingStatus = FALSE;
> -BOOLEAN mMemoryProfileRecordingEnable =
> MEMORY_PROFILE_RECORDING_DISABLE;
> -EFI_DEVICE_PATH_PROTOCOL *mMemoryProfileDriverPath;
> -UINTN                    mMemoryProfileDriverPathSize;
> +GLOBAL_REMOVE_IF_UNREFERENCED EFI_LOCK mMemoryProfileLock =
> EFI_INITIALIZE_LOCK_VARIABLE (TPL_NOTIFY);
> +GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN
> mMemoryProfileGettingStatus = FALSE;
> +GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN
> mMemoryProfileRecordingEnable = MEMORY_PROFILE_RECORDING_DISABLE;
> +GLOBAL_REMOVE_IF_UNREFERENCED EFI_DEVICE_PATH_PROTOCOL
> *mMemoryProfileDriverPath;
> +GLOBAL_REMOVE_IF_UNREFERENCED UINTN
> mMemoryProfileDriverPathSize;
> 
>  /**
>    Get memory profile data.
> @@ -209,7 +209,7 @@ ProfileProtocolRecord (
>    IN CHAR8                              *ActionString OPTIONAL
>    );
> 
> -EDKII_MEMORY_PROFILE_PROTOCOL mProfileProtocol = {
> +GLOBAL_REMOVE_IF_UNREFERENCED EDKII_MEMORY_PROFILE_PROTOCOL
> mProfileProtocol = {
>    ProfileProtocolGetData,
>    ProfileProtocolRegisterImage,
>    ProfileProtocolUnregisterImage,
> --
> 2.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel