216 lines
8.9 KiB
Diff
216 lines
8.9 KiB
Diff
From 4c65e5a05c65fab987ca8669678d701e284138c8 Mon Sep 17 00:00:00 2001
|
|
From: heppen <hepeng68@huawei.com>
|
|
Date: Tue, 20 Jun 2023 18:43:58 +0800
|
|
Subject: [PATCH] remove dependency and adapt for build
|
|
|
|
---
|
|
.../messenger_device_status_manager.cpp | 1 +
|
|
services/dfx/BUILD.gn | 4 +-
|
|
services/dfx/dslm_bigdata.cpp | 71 ++++++++++---------
|
|
services/dfx/dslm_hitrace.cpp | 28 +++++---
|
|
4 files changed, 57 insertions(+), 47 deletions(-)
|
|
|
|
diff --git a/baselib/msglib/src/standard/messenger_device_status_manager.cpp b/baselib/msglib/src/standard/messenger_device_status_manager.cpp
|
|
index 955f9ca..fdb2bc9 100644
|
|
--- a/baselib/msglib/src/standard/messenger_device_status_manager.cpp
|
|
+++ b/baselib/msglib/src/standard/messenger_device_status_manager.cpp
|
|
@@ -19,6 +19,7 @@
|
|
#include <memory>
|
|
#include <mutex>
|
|
#include <string>
|
|
+#include <functional>
|
|
|
|
#include "device_manager.h"
|
|
#include "securec.h"
|
|
diff --git a/services/dfx/BUILD.gn b/services/dfx/BUILD.gn
|
|
index cea9105..bccaea7 100644
|
|
--- a/services/dfx/BUILD.gn
|
|
+++ b/services/dfx/BUILD.gn
|
|
@@ -33,8 +33,8 @@ ohos_source_set("dslm_extension_dfx") {
|
|
external_deps = [
|
|
"c_utils:utils",
|
|
"hilog_native:libhilog",
|
|
- "hisysevent_native:libhisysevent",
|
|
- "hitrace_native:hitrace_meter",
|
|
+ # "hisysevent_native:libhisysevent",
|
|
+ # "hitrace_native:hitrace_meter",
|
|
]
|
|
|
|
configs = [ "//base/security/device_security_level/common:common_configs" ]
|
|
diff --git a/services/dfx/dslm_bigdata.cpp b/services/dfx/dslm_bigdata.cpp
|
|
index 9965fe1..caead97 100644
|
|
--- a/services/dfx/dslm_bigdata.cpp
|
|
+++ b/services/dfx/dslm_bigdata.cpp
|
|
@@ -14,40 +14,42 @@
|
|
*/
|
|
|
|
#include "dslm_bigdata.h"
|
|
-#include "hisysevent.h"
|
|
+// #include "hisysevent.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
-namespace {
|
|
-constexpr char STR_EVENT_START_FAILED[] = "SERVICE_START_FAILED";
|
|
-constexpr char STR_EVENT_INIT_SELF_LEVEL_FAULT[] = "INIT_SELF_LEVEL_FAULT";
|
|
-constexpr char STR_EVENT_CALL_INTERFACE[] = "CALL_INTERFACE";
|
|
-constexpr char STR_EVENT_QUERY_INFO[] = "QUERY_INFO";
|
|
-constexpr char STR_ERROR_TYPE[] = "ERROR_TYPE";
|
|
-constexpr char STR_ERROR_STR[] = "ERROR_STR";
|
|
-constexpr char STR_USER_ID[] = "USER_ID";
|
|
-constexpr char STR_COST_TIME[] = "COST_TIME";
|
|
-constexpr char STR_RET_CODE[] = "RET_CODE";
|
|
-constexpr char STR_SEC_LEVEL[] = "SEC_LEVEL";
|
|
-constexpr char STR_RET_MODE[] = "RET_MODE";
|
|
-constexpr char STR_LOCAL_MODEL[] = "LOCAL_MODEL";
|
|
-constexpr char STR_TARGET_MODEL[] = "TARGET_MODEL";
|
|
-constexpr char STR_PKG_NAME[] = "PKG_NAME";
|
|
-constexpr char STR_LOCAL_VERSION[] = "LOCAL_VERSION";
|
|
-constexpr char STR_TARGET_VERSION[] = "TARGET_VERSION";
|
|
-constexpr char STR_CRED_TYPE[] = "CRED_TYPE";
|
|
-} // namespace
|
|
+// namespace {
|
|
+// constexpr char STR_EVENT_START_FAILED[] = "SERVICE_START_FAILED";
|
|
+// constexpr char STR_EVENT_INIT_SELF_LEVEL_FAULT[] = "INIT_SELF_LEVEL_FAULT";
|
|
+// constexpr char STR_EVENT_CALL_INTERFACE[] = "CALL_INTERFACE";
|
|
+// constexpr char STR_EVENT_QUERY_INFO[] = "QUERY_INFO";
|
|
+// constexpr char STR_ERROR_TYPE[] = "ERROR_TYPE";
|
|
+// constexpr char STR_ERROR_STR[] = "ERROR_STR";
|
|
+// constexpr char STR_USER_ID[] = "USER_ID";
|
|
+// constexpr char STR_COST_TIME[] = "COST_TIME";
|
|
+// constexpr char STR_RET_CODE[] = "RET_CODE";
|
|
+// constexpr char STR_SEC_LEVEL[] = "SEC_LEVEL";
|
|
+// constexpr char STR_RET_MODE[] = "RET_MODE";
|
|
+// constexpr char STR_LOCAL_MODEL[] = "LOCAL_MODEL";
|
|
+// constexpr char STR_TARGET_MODEL[] = "TARGET_MODEL";
|
|
+// constexpr char STR_PKG_NAME[] = "PKG_NAME";
|
|
+// constexpr char STR_LOCAL_VERSION[] = "LOCAL_VERSION";
|
|
+// constexpr char STR_TARGET_VERSION[] = "TARGET_VERSION";
|
|
+// constexpr char STR_CRED_TYPE[] = "CRED_TYPE";
|
|
+// } // namespace
|
|
void ReportServiceStartFailedEvent(const uint32_t errorType)
|
|
{
|
|
- HiSysEventWrite(OHOS::HiviewDFX::HiSysEvent::Domain::DSLM, STR_EVENT_START_FAILED,
|
|
- OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, STR_ERROR_TYPE, errorType);
|
|
+ return;
|
|
+ // HiSysEventWrite(OHOS::HiviewDFX::HiSysEvent::Domain::DSLM, STR_EVENT_START_FAILED,
|
|
+ // OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, STR_ERROR_TYPE, errorType);
|
|
}
|
|
|
|
void ReportInitSelfFailedEvent(const char *errorString)
|
|
{
|
|
- HiSysEventWrite(OHOS::HiviewDFX::HiSysEvent::Domain::DSLM, STR_EVENT_INIT_SELF_LEVEL_FAULT,
|
|
- OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, STR_ERROR_STR, errorString);
|
|
+ return;
|
|
+ // HiSysEventWrite(OHOS::HiviewDFX::HiSysEvent::Domain::DSLM, STR_EVENT_INIT_SELF_LEVEL_FAULT,
|
|
+ // OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, STR_ERROR_STR, errorString);
|
|
}
|
|
|
|
void ReportAppInvokeEvent(const AppInvokeEvent *event)
|
|
@@ -56,10 +58,11 @@ void ReportAppInvokeEvent(const AppInvokeEvent *event)
|
|
return;
|
|
}
|
|
|
|
- HiSysEventWrite(OHOS::HiviewDFX::HiSysEvent::Domain::DSLM, STR_EVENT_CALL_INTERFACE,
|
|
- OHOS::HiviewDFX::HiSysEvent::EventType::STATISTIC, STR_USER_ID, event->uid, STR_COST_TIME, event->costTime,
|
|
- STR_RET_CODE, event->retCode, STR_SEC_LEVEL, event->secLevel, STR_RET_MODE, event->retMode, STR_LOCAL_MODEL,
|
|
- event->localModel, STR_TARGET_MODEL, event->targetModel, STR_PKG_NAME, event->pkgName);
|
|
+ return;
|
|
+ // HiSysEventWrite(OHOS::HiviewDFX::HiSysEvent::Domain::DSLM, STR_EVENT_CALL_INTERFACE,
|
|
+ // OHOS::HiviewDFX::HiSysEvent::EventType::STATISTIC, STR_USER_ID, event->uid, STR_COST_TIME, event->costTime,
|
|
+ // STR_RET_CODE, event->retCode, STR_SEC_LEVEL, event->secLevel, STR_RET_MODE, event->retMode, STR_LOCAL_MODEL,
|
|
+ // event->localModel, STR_TARGET_MODEL, event->targetModel, STR_PKG_NAME, event->pkgName);
|
|
}
|
|
|
|
void ReportSecurityInfoSyncEvent(const SecurityInfoSyncEvent *event)
|
|
@@ -67,12 +70,12 @@ void ReportSecurityInfoSyncEvent(const SecurityInfoSyncEvent *event)
|
|
if (event == nullptr) {
|
|
return;
|
|
}
|
|
-
|
|
- HiSysEventWrite(OHOS::HiviewDFX::HiSysEvent::Domain::DSLM, STR_EVENT_QUERY_INFO,
|
|
- OHOS::HiviewDFX::HiSysEvent::EventType::STATISTIC, STR_LOCAL_MODEL, event->localModel, STR_TARGET_MODEL,
|
|
- event->targetModel, STR_LOCAL_VERSION, event->localVersion, STR_TARGET_VERSION, event->targetVersion,
|
|
- STR_CRED_TYPE, event->credType, STR_RET_CODE, event->retCode, STR_COST_TIME, event->costTime, STR_SEC_LEVEL,
|
|
- event->secLevel);
|
|
+ return;
|
|
+ // HiSysEventWrite(OHOS::HiviewDFX::HiSysEvent::Domain::DSLM, STR_EVENT_QUERY_INFO,
|
|
+ // OHOS::HiviewDFX::HiSysEvent::EventType::STATISTIC, STR_LOCAL_MODEL, event->localModel, STR_TARGET_MODEL,
|
|
+ // event->targetModel, STR_LOCAL_VERSION, event->localVersion, STR_TARGET_VERSION, event->targetVersion,
|
|
+ // STR_CRED_TYPE, event->credType, STR_RET_CODE, event->retCode, STR_COST_TIME, event->costTime, STR_SEC_LEVEL,
|
|
+ // event->secLevel);
|
|
}
|
|
|
|
#ifdef __cplusplus
|
|
diff --git a/services/dfx/dslm_hitrace.cpp b/services/dfx/dslm_hitrace.cpp
|
|
index e610db8..727926d 100644
|
|
--- a/services/dfx/dslm_hitrace.cpp
|
|
+++ b/services/dfx/dslm_hitrace.cpp
|
|
@@ -15,7 +15,7 @@
|
|
|
|
#include "dslm_hitrace.h"
|
|
|
|
-#include "hitrace_meter.h"
|
|
+// #include "hitrace_meter.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
@@ -23,37 +23,43 @@ extern "C" {
|
|
|
|
void DslmStartProcessTrace(const char *value)
|
|
{
|
|
- StartTrace(HITRACE_TAG_DLSM, std::string(value));
|
|
+ return;
|
|
+ // StartTrace(HITRACE_TAG_DLSM, std::string(value));
|
|
}
|
|
|
|
void DslmStartStateMachineTrace(uint32_t machineId, uint32_t event)
|
|
{
|
|
- std::string traceValue =
|
|
- std::string("StartStateMachine_") + std::to_string(machineId) + "_" + std::to_string(event);
|
|
+ return;
|
|
+ // std::string traceValue =
|
|
+ // std::string("StartStateMachine_") + std::to_string(machineId) + "_" + std::to_string(event);
|
|
|
|
- StartTrace(HITRACE_TAG_DLSM, traceValue);
|
|
+ // StartTrace(HITRACE_TAG_DLSM, traceValue);
|
|
}
|
|
|
|
void DslmFinishProcessTrace(void)
|
|
{
|
|
- FinishTrace(HITRACE_TAG_DLSM);
|
|
+ return;
|
|
+ // FinishTrace(HITRACE_TAG_DLSM);
|
|
}
|
|
|
|
void DslmStartProcessTraceAsync(const char *value, uint32_t owner, uint32_t cookie)
|
|
{
|
|
- std::string traceValue = std::string(value) + "_" + std::to_string(owner) + "_" + std::to_string(cookie);
|
|
- StartAsyncTrace(HITRACE_TAG_DLSM, traceValue, cookie);
|
|
+ return;
|
|
+ // std::string traceValue = std::string(value) + "_" + std::to_string(owner) + "_" + std::to_string(cookie);
|
|
+ // StartAsyncTrace(HITRACE_TAG_DLSM, traceValue, cookie);
|
|
}
|
|
|
|
void DslmFinishProcessTraceAsync(const char *value, uint32_t owner, uint32_t cookie)
|
|
{
|
|
- std::string traceValue = std::string(value) + "_" + std::to_string(owner) + "_" + std::to_string(cookie);
|
|
- FinishAsyncTrace(HITRACE_TAG_DLSM, traceValue, cookie);
|
|
+ return;
|
|
+ // std::string traceValue = std::string(value) + "_" + std::to_string(owner) + "_" + std::to_string(cookie);
|
|
+ // FinishAsyncTrace(HITRACE_TAG_DLSM, traceValue, cookie);
|
|
}
|
|
|
|
void DslmCountTrace(const char *name, int64_t count)
|
|
{
|
|
- CountTrace(HITRACE_TAG_DLSM, std::string(name), count);
|
|
+ return;
|
|
+ // CountTrace(HITRACE_TAG_DLSM, std::string(name), count);
|
|
}
|
|
|
|
#ifdef __cplusplus
|
|
--
|
|
2.33.0
|
|
|