From 157396204614b97cb74a51f00fed33903d26f622 Mon Sep 17 00:00:00 2001 From: gongguilin Date: Sat, 21 Dec 2024 18:52:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E7=82=B9=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gongguilin --- services/common/src/parse_util.cpp | 13 ++++++++----- .../samgr/native/source/system_ability_manager.cpp | 5 +++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/services/common/src/parse_util.cpp b/services/common/src/parse_util.cpp index 7e14c499..f7f495e5 100644 --- a/services/common/src/parse_util.cpp +++ b/services/common/src/parse_util.cpp @@ -78,6 +78,7 @@ constexpr const char* BOOT_START_PHASE = "BootStartPhase"; constexpr const char* CORE_START_PHASE = "CoreStartPhase"; constexpr const char* HIGH_LOAD_PRIORITY = "HighPriority"; constexpr const char* MEDIUM_LOAD_PRIORITY = "MediumPriority"; +constexpr int32_t WINDOW_MANAGER_SERVICE_ID = 4606; enum { BOOT_START = 1, @@ -157,9 +158,7 @@ void ParseUtil::OpenSo(SaProfile& saProfile) handle = dlopen(saProfile.libPath.c_str(), RTLD_NOW); } int64_t duration = GetTickCount() - begin; - ReportSaLoadDuration(saProfile.saId, SA_LOAD_OPENSO, duration); - KHILOGI("SA:%{public}d OpenSo %{public}" PRId64 "ms", - saProfile.saId, duration); + KHILOGI("SA:%{public}d OpenSo %{public}" PRId64 "ms", saProfile.saId, duration); if (handle == nullptr) { std::vector libPathVec; string fileName = ""; @@ -167,10 +166,14 @@ void ParseUtil::OpenSo(SaProfile& saProfile) if (libPathVec.size() > 0) { fileName = libPathVec[libPathVec.size() - 1]; } - ReportAddSystemAbilityFailed(saProfile.saId, getpid(), getuid(), fileName); HILOGE("SA:%{public}d dlopen %{public}s failed with errno:%{public}s!", saProfile.saId, fileName.c_str(), dlerror()); - return; + if (saProfile.saId == WINDOW_MANAGER_SERVICE_ID) { + return; + } + ReportAddSystemAbilityFailed(saProfile.saId, getpid(), getuid(), fileName); + } else if (duration != 0){ + ReportSaLoadDuration(saProfile.saId, SA_LOAD_OPENSO, duration); } saProfile.handle = handle; } else { diff --git a/services/samgr/native/source/system_ability_manager.cpp b/services/samgr/native/source/system_ability_manager.cpp index 57ddc72b..742d24e4 100644 --- a/services/samgr/native/source/system_ability_manager.cpp +++ b/services/samgr/native/source/system_ability_manager.cpp @@ -317,7 +317,7 @@ void SystemAbilityManager::InitSaProfile() onDemandSaIdsSet_.insert(saInfo.saId); } } - HILOGI("InitProfile spend %{public}" PRId64 "ms", GetTickCount() - begin); + KHILOGI("InitProfile spend %{public}" PRId64 "ms", GetTickCount() - begin); } void SystemAbilityManager::OndemandLoadForPerf() @@ -1447,8 +1447,9 @@ int32_t SystemAbilityManager::StartDynamicSystemProcess(const std::u16string& na auto callingUid = IPCSkeleton::GetCallingUid(); if (result != 0) { ReportProcessStartFail(Str16ToStr8(name), callingPid, callingUid, "err:" + ToString(result)); + } else { + ReportProcessStartDuration(Str16ToStr8(name), callingPid, callingUid, duration); } - ReportProcessStartDuration(Str16ToStr8(name), callingPid, callingUid, duration); KHILOGI("Start dynamic proc:%{public}s,%{public}d,%{public}d_%{public}" PRId64 "ms", Str16ToStr8(name).c_str(), systemAbilityId, result, duration); return result; -- Gitee