From 21c296f4dfb0b375989e66a9b3a31ee4f1042271 Mon Sep 17 00:00:00 2001 From: li-tiangang4 Date: Thu, 15 May 2025 11:29:06 +0800 Subject: [PATCH] =?UTF-8?q?trace=E6=97=A5=E5=BF=97=E6=89=93=E7=82=B9?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-tiangang4 --- utils/src/dh_utils_hitrace.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/utils/src/dh_utils_hitrace.cpp b/utils/src/dh_utils_hitrace.cpp index 3bc80bb3..f3e50c6b 100644 --- a/utils/src/dh_utils_hitrace.cpp +++ b/utils/src/dh_utils_hitrace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -20,7 +20,8 @@ namespace OHOS { namespace DistributedHardware { void DHCompMgrTraceStart(const std::string &anonyNetworkId, const std::string &anonyDHId, const std::string &msg) { - StartTrace(DHFWK_HITRACE_LABEL, anonyNetworkId + "_" + anonyDHId + "_" + msg); + std::string traceMsg = anonyNetworkId + "_" + anonyDHId + "_" + msg; + StartTraceEx(HiTraceOutputLevel::HITRACE_LEVEL_INFO, DHFWK_HITRACE_LABEL, traceMsg.c_str(), ""); } void DHQueryTraceStart(const DHType dhType) @@ -30,17 +31,18 @@ void DHQueryTraceStart(const DHType dhType) if (it != DHTypeStrMap.end()) { dhTypeStr = it->second; } - StartTrace(DHFWK_HITRACE_LABEL, dhTypeStr + "_" + DH_QUERY_START); + std::string traceMsg = dhTypeStr + "_" + DH_QUERY_START; + StartTraceEx(HiTraceOutputLevel::HITRACE_LEVEL_INFO, DHFWK_HITRACE_LABEL, traceMsg.c_str(), ""); } void DHTraceStart(const std::string &msg) { - StartTrace(DHFWK_HITRACE_LABEL, msg); + StartTraceEx(HiTraceOutputLevel::HITRACE_LEVEL_INFO, DHFWK_HITRACE_LABEL, msg.c_str(), ""); } void DHTraceEnd() { - FinishTrace(DHFWK_HITRACE_LABEL); + FinishTraceEx(HiTraceOutputLevel::HITRACE_LEVEL_INFO, DHFWK_HITRACE_LABEL); } } // namespace DistributedHardware } // namespace OHOS \ No newline at end of file -- Gitee