mirror of
https://github.com/openharmony/distributed_hardware_fwk.git
synced 2026-07-19 13:45:35 -04:00
@@ -66,7 +66,7 @@ std::map<std::string, DHType> g_mapDhTypeName = {
|
||||
|
||||
int32_t ComponentLoader::Init()
|
||||
{
|
||||
DHTraceStart("COMPONENT_LOAD_START");
|
||||
DHTraceStart(COMPONENT_LOAD_START);
|
||||
int32_t ret = ParseConfig();
|
||||
DHTraceEnd();
|
||||
|
||||
@@ -275,7 +275,7 @@ int32_t ComponentLoader::ReleaseHandler(void *&handler)
|
||||
int32_t ComponentLoader::UnInit()
|
||||
{
|
||||
DHLOGI("release all handler");
|
||||
DHTraceStart("COMPONENT_RELEASE_START");
|
||||
DHTraceStart(COMPONENT_RELEASE_START);
|
||||
int32_t ret = DH_FWK_SUCCESS;
|
||||
for (std::map<DHType, CompHandler>::iterator iter = compHandlerMap_.begin();
|
||||
iter != compHandlerMap_.end(); iter++) {
|
||||
|
||||
+2
-2
@@ -252,7 +252,7 @@ int32_t ComponentManager::Enable(const std::string &networkId, const std::string
|
||||
}
|
||||
auto compEnable = std::make_shared<ComponentEnable>();
|
||||
|
||||
CompEnableTraceStart(dhType);
|
||||
DHCompMgrTraceStart(GetAnonyString(networkId), GetAnonyString(dhId), ENABLE_START);
|
||||
auto result = compEnable->Enable(networkId, dhId, param, find->second);
|
||||
if (result != DH_FWK_SUCCESS) {
|
||||
for (int32_t retryCount = 0; retryCount < ENABLE_RETRY_MAX_TIMES; retryCount++) {
|
||||
@@ -288,7 +288,7 @@ int32_t ComponentManager::Disable(const std::string &networkId, const std::strin
|
||||
}
|
||||
auto compDisable = std::make_shared<ComponentDisable>();
|
||||
|
||||
CompDisableTraceStart(dhType);
|
||||
DHCompMgrTraceStart(GetAnonyString(networkId), GetAnonyString(dhId), DISABLE_START);
|
||||
auto result = compDisable->Disable(networkId, dhId, find->second);
|
||||
if (result != DH_FWK_SUCCESS) {
|
||||
for (int32_t retryCount = 0; retryCount < DISABLE_RETRY_MAX_TIMES; retryCount++) {
|
||||
|
||||
+3
@@ -48,7 +48,10 @@ void LocalHardwareManager::Init()
|
||||
DHLOGE("Initialize %#X failed", dhType);
|
||||
continue;
|
||||
}
|
||||
|
||||
DHQeryTraceStart(dhType);
|
||||
QueryLocalHardware(dhType, hardwareHandler);
|
||||
DHTraceEnd();
|
||||
if (!hardwareHandler->IsSupportPlugin()) {
|
||||
DHLOGI("hardwareHandler is not support hot swap plugin, release!");
|
||||
ComponentLoader::GetInstance().ReleaseHardwareHandler(dhType);
|
||||
|
||||
@@ -25,8 +25,15 @@ namespace OHOS {
|
||||
namespace DistributedHardware {
|
||||
constexpr uint64_t DHFWK_HITRACE_LABEL = HITRACE_TAG_DISTRIBUTED_HARDWARE_FWK;
|
||||
|
||||
void CompEnableTraceStart(const DHType dhType);
|
||||
void CompDisableTraceStart(const DHType dhType);
|
||||
const std::string COMPONENT_LOAD_START = "COMPONENT_LOAD_START";
|
||||
const std::string COMPONENT_RELEASE_START = "COMPONENT_RELEASE_START";
|
||||
const std::string COMPONENT_INIT_START = "COMPONENT_INIT_START";
|
||||
const std::string QUERY_START = "QUERY_START";
|
||||
const std::string ENABLE_START = "ENABLE_START";
|
||||
const std::string DISABLE_START = "DISABLE_START";
|
||||
|
||||
void DHCompMgrTraceStart(const std::string &anonyNetworkId, const std::string &anonyDHId, const std::string &msg);
|
||||
void DHQeryTraceStart(const DHType dhType);
|
||||
void DHTraceStart(const std::string &msg);
|
||||
void DHTraceEnd();
|
||||
} // namespace DistributedHardware
|
||||
|
||||
@@ -19,24 +19,19 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace DistributedHardware {
|
||||
void CompEnableTraceStart(const DHType dhType)
|
||||
void DHCompMgrTraceStart(const std::string &anonyNetworkId, const std::string &anonyDHId, const std::string &msg)
|
||||
{
|
||||
std::string dhTypeStr = "UNKNOWN";
|
||||
auto it = DHTypeStrMap.find(dhType);
|
||||
if (it != DHTypeStrMap.end()) {
|
||||
dhTypeStr = it->second;
|
||||
}
|
||||
StartTrace(DHFWK_HITRACE_LABEL, dhTypeStr + "_ENABLE_START");
|
||||
StartTrace(DHFWK_HITRACE_LABEL, anonyNetworkId + "_" + anonyDHId + "_" + msg);
|
||||
}
|
||||
|
||||
void CompDisableTraceStart(const DHType dhType)
|
||||
void DHQeryTraceStart(const DHType dhType)
|
||||
{
|
||||
std::string dhTypeStr = "UNKNOWN";
|
||||
auto it = DHTypeStrMap.find(dhType);
|
||||
if (it != DHTypeStrMap.end()) {
|
||||
dhTypeStr = it->second;
|
||||
}
|
||||
StartTrace(DHFWK_HITRACE_LABEL, dhTypeStr + "_DISABLE_START");
|
||||
StartTrace(DHFWK_HITRACE_LABEL, dhTypeStr + "_" + QUERY_START);
|
||||
}
|
||||
|
||||
void DHTraceStart(const std::string &msg)
|
||||
|
||||
Reference in New Issue
Block a user