From: SnickerSun Date: Sat, 5 Oct 2024 07:45:00 +0000 (+0800) Subject: 增加内存泄露编译参数 leakcheck X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=efb988aa7939eec74f5128d2893c24982cca9aa0;p=mirrors%2FFD230.git 增加内存泄露编译参数 leakcheck autoota的编译参数 autoota autootacli --- diff --git a/autobuild.sh b/autobuild.sh index b29b6ceb8..5d2f7fd03 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -8,7 +8,7 @@ DEFAULT_TARGET_PACK_NAME=pack_brandy_native_js DEFAULT_APPLICATION_NAME=brandy-native-js DEFAULT_TARGET_PACK_NAME_USER=pack_brandy_native_js_user DEFAULT_APPLICATION_NAME_USER=brandy-native-js-user -DEFAULT_CUSTOM_FW_VERSION=1.1.59 +DEFAULT_CUSTOM_FW_VERSION=1.1.501 TARGET_PACK_NAME=$DEFAULT_TARGET_PACK_NAME APPLICATION_NAME=$DEFAULT_APPLICATION_NAME @@ -50,6 +50,25 @@ TARGET_PACK_NAME=pack_brandy_native_js_z1 APPLICATION_NAME=brandy-native-js-z1 BUILD_NAME=_Z1 fi +if [ "$1" == "leakcheck" ] +then +TARGET_PACK_NAME=pack_brandy_native_js_leakcheck +APPLICATION_NAME=brandy-native-js-leakcheck +BUILD_NAME=_LEAKCHECK +fi +if [ "$1" == "autoota" ] +then +TARGET_PACK_NAME=pack_brandy_native_js_autoota +APPLICATION_NAME=brandy-native-autoota +BUILD_NAME=_AUTOOTA + +fi +if [ "$1" == "autootacli" ] +then +TARGET_PACK_NAME=pack_brandy_native_js_autootacli +APPLICATION_NAME=brandy-native-js-autootacli +BUILD_NAME=_AUTOOTACLI +fi if [ "$1" == "obu" ] then TARGET_PACK_NAME=pack_brandy_native_js_obu diff --git a/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp b/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp index 374ce8eea..c2a1dd57a 100755 --- a/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp +++ b/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp @@ -155,8 +155,13 @@ namespace OHOS osal_atomic_inc(&transitionCount_); // onStop释放当前页面需要和当前页面的事件监听异步执行,否则会出现自己杀掉自己的情况 // 使用图形服务的PostGraphicEvent方法异步执行PostChangeSlice,以避免在页面事件监听时出现当前页面自我销毁的情况。 +#ifdef DO_MEMLEAK_CHECK + GraphicService::GetInstance()->PostGraphicEvent(std::bind(&Ability::PostChangeSlice, this, targetSliceId, + TransitionType::TRANSITION_INVALID, priority)); +#else GraphicService::GetInstance()->PostGraphicEvent(std::bind(&Ability::PostChangeSlice, this, targetSliceId, type, priority)); +#endif } } @@ -233,6 +238,9 @@ namespace OHOS { osal_atomic_dec(&transitionCount_); } + #ifdef DO_MEMLEAK_CHECK + MemCheck::GetInstance()->DumpMemInfo(); // 检测UI Malloc内存泄漏,确认进退页面count是否一直增加。 + #endif } void Ability::OnTransitionEnd() diff --git a/code/sdk/application/wearable/service/msg_center/brandy-native-js-autoota/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-native-js-autoota/libmsg_center.a new file mode 100644 index 000000000..e31900481 Binary files /dev/null and b/code/sdk/application/wearable/service/msg_center/brandy-native-js-autoota/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/brandy-native-js-autootacli/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-native-js-autootacli/libmsg_center.a new file mode 100644 index 000000000..e31900481 Binary files /dev/null and b/code/sdk/application/wearable/service/msg_center/brandy-native-js-autootacli/libmsg_center.a differ diff --git a/code/sdk/application/wearable/service/msg_center/brandy-native-js-leakcheck/libmsg_center.a b/code/sdk/application/wearable/service/msg_center/brandy-native-js-leakcheck/libmsg_center.a new file mode 100644 index 000000000..e31900481 Binary files /dev/null and b/code/sdk/application/wearable/service/msg_center/brandy-native-js-leakcheck/libmsg_center.a differ diff --git a/code/sdk/build/config/target_config/brandy/config.py b/code/sdk/build/config/target_config/brandy/config.py index eb756b677..ea6364962 100755 --- a/code/sdk/build/config/target_config/brandy/config.py +++ b/code/sdk/build/config/target_config/brandy/config.py @@ -202,10 +202,10 @@ target = { 'fs_image_path':'fd230', 'defines': ['-:SW_UART_DEBUG', '-:DUMP_MEM_SUPPORT', '-:DUMP_REG_SUPPORT', '-:SUPPORT_DFX_EXCEPTION'], }, - 'brandy-native-js-fd230': { + 'brandy-native-js-leakcheck': { 'base_target_name': 'brandy-native-js', 'fs_image_path':'fd230', - # 'defines': ['-:SW_UART_DEBUG'], + 'defines': ['DO_MEMLEAK_CHECK'], }, 'brandy-native-js-z1': { 'base_target_name': 'brandy-native-js', @@ -222,6 +222,18 @@ target = { 'defines': ['SUPPORT_CHINA_MOBILE_DMP'], #移动 'fs_image_path':'fd230', }, + 'brandy-native-js-autoota': { + 'base_target_name': 'brandy-native-js', + 'defines': ['SUPPORT_AUTO_OTA_SERVER', 'CONFIG_DFX_SUPPORT_DIAG_UP_MACHINE=1'], + 'fs_image_path':'fd230', + # 'ram_component': ['auto_ota'] + }, + 'brandy-native-js-autootacli': { + 'base_target_name': 'brandy-native-js', + 'defines': ['SUPPORT_AUTO_OTA_SERVER', 'SUPPORT_AUTO_OTA', 'CONFIG_DFX_SUPPORT_DIAG_UP_MACHINE=1'], + 'fs_image_path':'fd230', + 'ram_component': ['auto_ota'] + }, 'brandy-native-js-obu': { 'base_target_name': 'brandy-native-js', 'defines': ['SUPPORT_A5133_SERVICE' @@ -237,6 +249,7 @@ target = { 'ram_component':["driver_a5133","a5133_service"], 'fs_image_path':'fd230', }, + #auto-ota-server 'brandy-auto-ota-ser': { 'base_target_name': 'brandy-native-js', @@ -436,7 +449,9 @@ target_group = { 'pack_brandy_target5': ['brandy-ssb', 'brandy-target5-r', 'brandy-target5'], 'pack_brandy_native_js': ['brandy-ssb', 'brandy-native-js-r', 'brandy-native-js'], 'pack_brandy_native_js_user': ['brandy-ssb', 'brandy-native-js-r', 'brandy-native-js-user'], - 'pack_brandy_native_js_fd230': ['brandy-ssb', 'brandy-native-js-r', 'brandy-native-fd230'], + 'pack_brandy_native_js_leakcheck': ['brandy-ssb', 'brandy-native-js-r', 'brandy-native-js-leakcheck'], + 'pack_brandy_native_js_autoota': ['brandy-ssb', 'brandy-native-js-r', 'brandy-native-js-autoota'], + 'pack_brandy_native_js_autootacli': ['brandy-ssb', 'brandy-native-js-r', 'brandy-native-js-autootacli'], 'pack_brandy_native_js_z1': ['brandy-ssb', 'brandy-native-js-r', 'brandy-native-js-z1'], 'pack_brandy_native_js_obu': ['brandy-ssb', 'brandy-native-js-r', 'brandy-native-js-obu'], 'pack_brandy_native_js_ct': ['brandy-ssb', 'brandy-native-js-r', 'brandy-native-js-ct'], diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-autoota/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-autoota/libgfx_rm.a new file mode 100644 index 000000000..1f2f82e27 Binary files /dev/null and b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-autoota/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-autootacli/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-autootacli/libgfx_rm.a new file mode 100644 index 000000000..1f2f82e27 Binary files /dev/null and b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-autootacli/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-leakcheck/libgfx_rm.a b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-leakcheck/libgfx_rm.a new file mode 100644 index 000000000..1f2f82e27 Binary files /dev/null and b/code/sdk/middleware/services/gpu/api/rm/brandy-native-js-leakcheck/libgfx_rm.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-autoota/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-autoota/libdisplay_gfx.a new file mode 100644 index 000000000..44063273b Binary files /dev/null and b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-autoota/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-autootacli/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-autootacli/libdisplay_gfx.a new file mode 100644 index 000000000..44063273b Binary files /dev/null and b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-autootacli/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/hal/display/brandy-native-js-leakcheck/libdisplay_gfx.a b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-leakcheck/libdisplay_gfx.a new file mode 100644 index 000000000..44063273b Binary files /dev/null and b/code/sdk/middleware/services/gui/hal/display/brandy-native-js-leakcheck/libdisplay_gfx.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-native-js-autoota/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-native-js-autoota/libuikit_ext.a new file mode 100644 index 000000000..8ee2fe15e Binary files /dev/null and b/code/sdk/middleware/services/gui/uikit/brandy-native-js-autoota/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-native-js-autootacli/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-native-js-autootacli/libuikit_ext.a new file mode 100644 index 000000000..8ee2fe15e Binary files /dev/null and b/code/sdk/middleware/services/gui/uikit/brandy-native-js-autootacli/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/brandy-native-js-leakcheck/libuikit_ext.a b/code/sdk/middleware/services/gui/uikit/brandy-native-js-leakcheck/libuikit_ext.a new file mode 100644 index 000000000..8ee2fe15e Binary files /dev/null and b/code/sdk/middleware/services/gui/uikit/brandy-native-js-leakcheck/libuikit_ext.a differ diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/mem_check.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/mem_check.cpp index d16d72726..52adab2a7 100755 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/mem_check.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/utils/frameworks/mem_check.cpp @@ -219,7 +219,8 @@ void MemCheck::DumpMemInfo() printf("total size=%d, max=%d, count=%d\n", total, max, count); #if SUPPRESS_DUMP printf("--------\n"); - GrallocEngines::GetInstance()->DumpMem(); + //此处打印比较多,需要请自行打开。 + // GrallocEngines::GetInstance()->DumpMem(); #endif } diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-autoota/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-autoota/libx_vfs_private.a new file mode 100644 index 000000000..9af3d9c5c Binary files /dev/null and b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-autoota/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-autootacli/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-autootacli/libx_vfs_private.a new file mode 100644 index 000000000..9af3d9c5c Binary files /dev/null and b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-autootacli/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/vfs/brandy-native-js-leakcheck/libx_vfs_private.a b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-leakcheck/libx_vfs_private.a new file mode 100644 index 000000000..9af3d9c5c Binary files /dev/null and b/code/sdk/middleware/utils/fs/vfs/brandy-native-js-leakcheck/libx_vfs_private.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-autoota/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-autoota/libfs_yaffs2.a new file mode 100644 index 000000000..f9f27b792 Binary files /dev/null and b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-autoota/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-autootacli/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-autootacli/libfs_yaffs2.a new file mode 100644 index 000000000..f9f27b792 Binary files /dev/null and b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-autootacli/libfs_yaffs2.a differ diff --git a/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-leakcheck/libfs_yaffs2.a b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-leakcheck/libfs_yaffs2.a new file mode 100644 index 000000000..f9f27b792 Binary files /dev/null and b/code/sdk/middleware/utils/fs/yaffs2/brandy-native-js-leakcheck/libfs_yaffs2.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-autoota/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-autoota/libams.a new file mode 100644 index 000000000..c3b361c64 Binary files /dev/null and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-autoota/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-autootacli/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-autootacli/libams.a new file mode 100644 index 000000000..c3b361c64 Binary files /dev/null and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-autootacli/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-leakcheck/libams.a b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-leakcheck/libams.a new file mode 100644 index 000000000..c3b361c64 Binary files /dev/null and b/code/sdk/open_source/openharmony/foundation/aafwk/aafwk_lite/brandy-native-js-leakcheck/libams.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-autoota/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-autoota/libace.a new file mode 100644 index 000000000..8fdfdbf50 Binary files /dev/null and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-autoota/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-autootacli/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-autootacli/libace.a new file mode 100644 index 000000000..8fdfdbf50 Binary files /dev/null and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-autootacli/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-leakcheck/libace.a b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-leakcheck/libace.a new file mode 100644 index 000000000..8fdfdbf50 Binary files /dev/null and b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/brandy-native-js-leakcheck/libace.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-autoota/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-autoota/libbms.a new file mode 100644 index 000000000..686c9eaaf Binary files /dev/null and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-autoota/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-autootacli/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-autootacli/libbms.a new file mode 100644 index 000000000..686c9eaaf Binary files /dev/null and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-autootacli/libbms.a differ diff --git a/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-leakcheck/libbms.a b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-leakcheck/libbms.a new file mode 100644 index 000000000..686c9eaaf Binary files /dev/null and b/code/sdk/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/brandy-native-js-leakcheck/libbms.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-autoota/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-autoota/libjerryscript.a new file mode 100644 index 000000000..73de5fecc Binary files /dev/null and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-autoota/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-autootacli/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-autootacli/libjerryscript.a new file mode 100644 index 000000000..73de5fecc Binary files /dev/null and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-autootacli/libjerryscript.a differ diff --git a/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-leakcheck/libjerryscript.a b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-leakcheck/libjerryscript.a new file mode 100644 index 000000000..73de5fecc Binary files /dev/null and b/code/sdk/open_source/openharmony/third_party/jerryscript/brandy-native-js-leakcheck/libjerryscript.a differ