From e8be877f235232603c3aec33fa1ff5a6ed66750b Mon Sep 17 00:00:00 2001 From: yangliu Date: Wed, 23 Jul 2025 09:55:24 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=95=8F=E6=84=9F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=8C=BF=E5=90=8D=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangliu --- .../adapter/dfx/src/hiview_adapter.cpp | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp b/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp index c27789c77..77a700d57 100644 --- a/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp +++ b/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp @@ -22,10 +22,11 @@ #include "log_print.h" #include "utils/time_utils.h" - +#include "utils/anonymous.h" namespace OHOS { namespace DistributedDataDfx { using namespace DistributedKv; +using Anonymous = DistributedData::Anonymous; namespace { constexpr const char *DATAMGR_DOMAIN = "DISTDATAMGR"; // fault key @@ -137,11 +138,11 @@ void HiViewAdapter::ReportDBFault(int dfxCode, const DBFaultMsg &msg, std::share struct HiSysEventParam params[] = { { .name = { *APP_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(msg.appId.c_str()) }, + .v = { .s = const_cast(Anonymous::Change(msg.appId).c_str()) }, .arraySize = 0 }, { .name = { *STORE_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(msg.storeId.c_str()) }, + .v = { .s = const_cast(Anonymous::Change(msg.storeId).c_str()) }, .arraySize = 0 }, { .name = { *MODULE_NAME }, .t = HISYSEVENT_STRING, @@ -183,11 +184,11 @@ void HiViewAdapter::ReportCommFault(int dfxCode, const CommFaultMsg &msg, std::s .arraySize = 0 }, { .name = { *APP_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(msg.appId.c_str()) }, + .v = { .s = const_cast(Anonymous::Change(msg.appId).c_str()) }, .arraySize = 0 }, { .name = { *STORE_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(msg.storeId.c_str()) }, + .v = { .s = const_cast(Anonymous::Change(msg.storeId).c_str()) }, .arraySize = 0 }, { .name = { *SYNC_ERROR_INFO }, .t = HISYSEVENT_STRING, @@ -252,11 +253,11 @@ void HiViewAdapter::ReportBehaviour(int dfxCode, const BehaviourMsg &msg, std::s .arraySize = 0 }, { .name = { *APP_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(msg.appId.c_str()) }, + .v = { .s = const_cast(Anonymous::Change(msg.appId).c_str()) }, .arraySize = 0 }, { .name = { *STORE_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(msg.storeId.c_str()) }, + .v = { .s = const_cast(Anonymous::Change(msg.storeId).c_str()) }, .arraySize = 0 }, { .name = { *BEHAVIOUR_INFO }, .t = HISYSEVENT_STRING, @@ -310,11 +311,11 @@ void HiViewAdapter::ReportDbSize(const StatisticWrap &stat) .arraySize = 0 }, { .name = { *APP_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(stat.val.appId.c_str()) }, + .v = { .s = const_cast(Anonymous::Change(stat.val.appId).c_str()) }, .arraySize = 0 }, { .name = { *STORE_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(stat.val.storeId.c_str()) }, + .v = { .s = const_cast(Anonymous::Change(stat.val.storeId).c_str()) }, .arraySize = 0 }, { .name = { *DB_SIZE }, .t = HISYSEVENT_UINT64, .v = { .ui64 = dbSize }, .arraySize = 0 }, }; @@ -387,11 +388,11 @@ void HiViewAdapter::InvokeTraffic() { .name = { *TAG }, .t = HISYSEVENT_STRING, .v = { .s = const_cast(POWERSTATS) }, .arraySize = 0 }, { .name = { *APP_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(kv.second.val.appId.c_str()) }, + .v = { .s = const_cast(Anonymous::Change(kv.second.val.appId).c_str()) }, .arraySize = 0 }, { .name = { *DEVICE_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(deviceId.c_str()) }, + .v = { .s = const_cast(Anonymous::Change(deviceId).c_str()) }, .arraySize = 0 }, { .name = { *SEND_SIZE }, .t = HISYSEVENT_INT64, @@ -443,7 +444,7 @@ void HiViewAdapter::InvokeVisit() .arraySize = 0 }, { .name = { *APP_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(kv.second.val.appId.c_str()) }, + .v = { .s = const_cast(Anonymous::Change(kv.second.val.appId).c_str()) }, .arraySize = 0 }, { .name = { *INTERFACE_NAME }, .t = HISYSEVENT_STRING, @@ -506,7 +507,7 @@ void HiViewAdapter::ReportUdmfBehaviour( struct HiSysEventParam params[] = { { .name = { *APP_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(msg.appId.c_str()) }, + .v = { .s = const_cast(Anonymous::Change(msg.appId).c_str()) }, .arraySize = 0 }, { .name = { *CHANNEL }, .t = HISYSEVENT_STRING, -- Gitee From 422b0c95b8ea7d7c085fd452e0fab5b53fc10e22 Mon Sep 17 00:00:00 2001 From: yangliu Date: Wed, 23 Jul 2025 09:58:03 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=95=8F=E6=84=9F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=8C=BF=E5=90=8D=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangliu --- .../distributeddataservice/adapter/dfx/src/hiview_adapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp b/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp index 77a700d57..f61bc1771 100644 --- a/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp +++ b/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp @@ -21,8 +21,8 @@ #include #include "log_print.h" -#include "utils/time_utils.h" #include "utils/anonymous.h" +#include "utils/time_utils.h" namespace OHOS { namespace DistributedDataDfx { using namespace DistributedKv; -- Gitee From 2a920e18924e59eacf0da3fd35ba08c656031d6b Mon Sep 17 00:00:00 2001 From: yangliu Date: Mon, 28 Jul 2025 11:30:22 +0800 Subject: [PATCH 3/3] update Signed-off-by: yangliu --- .../adapter/dfx/src/hiview_adapter.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp b/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp index f61bc1771..f6a82fe28 100644 --- a/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp +++ b/services/distributeddataservice/adapter/dfx/src/hiview_adapter.cpp @@ -138,7 +138,7 @@ void HiViewAdapter::ReportDBFault(int dfxCode, const DBFaultMsg &msg, std::share struct HiSysEventParam params[] = { { .name = { *APP_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(Anonymous::Change(msg.appId).c_str()) }, + .v = { .s = const_cast(msg.appId.c_str()) }, .arraySize = 0 }, { .name = { *STORE_ID }, .t = HISYSEVENT_STRING, @@ -184,7 +184,7 @@ void HiViewAdapter::ReportCommFault(int dfxCode, const CommFaultMsg &msg, std::s .arraySize = 0 }, { .name = { *APP_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(Anonymous::Change(msg.appId).c_str()) }, + .v = { .s = const_cast(msg.appId.c_str()) }, .arraySize = 0 }, { .name = { *STORE_ID }, .t = HISYSEVENT_STRING, @@ -253,7 +253,7 @@ void HiViewAdapter::ReportBehaviour(int dfxCode, const BehaviourMsg &msg, std::s .arraySize = 0 }, { .name = { *APP_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(Anonymous::Change(msg.appId).c_str()) }, + .v = { .s = const_cast(msg.appId.c_str()) }, .arraySize = 0 }, { .name = { *STORE_ID }, .t = HISYSEVENT_STRING, @@ -311,7 +311,7 @@ void HiViewAdapter::ReportDbSize(const StatisticWrap &stat) .arraySize = 0 }, { .name = { *APP_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(Anonymous::Change(stat.val.appId).c_str()) }, + .v = { .s = const_cast(stat.val.appId.c_str()) }, .arraySize = 0 }, { .name = { *STORE_ID }, .t = HISYSEVENT_STRING, @@ -388,7 +388,7 @@ void HiViewAdapter::InvokeTraffic() { .name = { *TAG }, .t = HISYSEVENT_STRING, .v = { .s = const_cast(POWERSTATS) }, .arraySize = 0 }, { .name = { *APP_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(Anonymous::Change(kv.second.val.appId).c_str()) }, + .v = { .s = const_cast(kv.second.val.appId.c_str()) }, .arraySize = 0 }, { .name = { *DEVICE_ID }, .t = HISYSEVENT_STRING, @@ -444,7 +444,7 @@ void HiViewAdapter::InvokeVisit() .arraySize = 0 }, { .name = { *APP_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(Anonymous::Change(kv.second.val.appId).c_str()) }, + .v = { .s = const_cast(kv.second.val.appId.c_str()) }, .arraySize = 0 }, { .name = { *INTERFACE_NAME }, .t = HISYSEVENT_STRING, @@ -507,7 +507,7 @@ void HiViewAdapter::ReportUdmfBehaviour( struct HiSysEventParam params[] = { { .name = { *APP_ID }, .t = HISYSEVENT_STRING, - .v = { .s = const_cast(Anonymous::Change(msg.appId).c_str()) }, + .v = { .s = const_cast(msg.appId.c_str()) }, .arraySize = 0 }, { .name = { *CHANNEL }, .t = HISYSEVENT_STRING, -- Gitee