diff --git a/services/common/src/parse_util.cpp b/services/common/src/parse_util.cpp index e2640d7da36a530ea76c0007e095339e55449e92..8a22b65e801e31071f12a363c5c1817875cee8af 100644 --- a/services/common/src/parse_util.cpp +++ b/services/common/src/parse_util.cpp @@ -156,7 +156,7 @@ void ParseUtil::OpenSo(SaProfile& saProfile) } int64_t duration = GetTickCount() - begin; ReportSaLoadDuration(saProfile.saId, SA_LOAD_OPENSO, duration); - KHILOGI("SA:%{public}d OpenSo spend %{public}" PRId64 "ms", + KHILOGI("SA:%{public}d OpenSo %{public}" PRId64 "ms", saProfile.saId, duration); if (handle == nullptr) { std::vector libPathVec; diff --git a/services/samgr/native/source/collect/common_event_collect.cpp b/services/samgr/native/source/collect/common_event_collect.cpp index 57b7f34b6800c6766dd06269dd9d20f3fc695f32..a11bd6835d0b6c149dce124c9fba68fc0a16e111 100644 --- a/services/samgr/native/source/collect/common_event_collect.cpp +++ b/services/samgr/native/source/collect/common_event_collect.cpp @@ -345,7 +345,7 @@ int64_t CommonEventCollect::SaveOnDemandReasonExtraData(const EventFwk::CommonEv int64_t extraDataId = GenerateExtraDataIdLocked(); extraDatas_[extraDataId] = extraData; - HILOGI("CommonEventCollect save extraData %{public}d", static_cast(extraDataId)); + HILOGD("CommonEventCollect save extraData %{public}d", static_cast(extraDataId)); if (workHandler_ == nullptr) { HILOGI("CommonEventCollect workHandler is nullptr"); return -1; @@ -586,8 +586,7 @@ void CommonEventSubscriber::OnReceiveEvent(const EventFwk::CommonEventData& data } collect->SaveAction(action); int64_t extraDataId = collect->SaveOnDemandReasonExtraData(data); - HILOGI("OnReceiveEvent get action: %{public}s code: %{public}d, extraDataId %{public}d", - action.c_str(), code, static_cast(extraDataId)); + HILOGI("RecvEvent:%{public}s,%{public}d_%{public}d", action.c_str(), code, static_cast(extraDataId)); collect->SaveOnDemandConditionExtraData(data); OnDemandEvent event = {COMMON_EVENT, action, std::to_string(code), extraDataId}; collect->ReportEvent(event); diff --git a/services/samgr/native/source/collect/device_networking_collect.cpp b/services/samgr/native/source/collect/device_networking_collect.cpp index 97ad65b0f3c1f962189b8569faef50171ee29235..a27610991f210f7f5e5ef84a749b19afe3214618 100644 --- a/services/samgr/native/source/collect/device_networking_collect.cpp +++ b/services/samgr/native/source/collect/device_networking_collect.cpp @@ -125,7 +125,7 @@ bool DeviceNetworkingCollect::ReportMissedEvents() bool DeviceNetworkingCollect::AddDeviceChangeListener() { - HILOGI("AddDeviceChangeListener called"); + HILOGI("AddDMListener called"); if (IsDmReady()) { int32_t ret = DeviceManager::GetInstance().InitDeviceManager(PKG_NAME, initCallback_); if (ret != ERR_OK) { @@ -142,7 +142,7 @@ bool DeviceNetworkingCollect::AddDeviceChangeListener() HILOGE("RegisterDevStateCallback error"); return false; } - HILOGI("AddDeviceChangeListener success"); + HILOGI("AddDMListener success"); return true; } return false; @@ -292,7 +292,7 @@ void WorkHandler::ProcessEvent(uint32_t eventId) return; } if (!collect_->AddDeviceChangeListener()) { - HILOGW("AddDeviceChangeListener retry"); + HILOGW("AddDMListener retry"); auto task = [this] {this->ProcessEvent(INIT_EVENT);}; if (handler_ == nullptr) { HILOGE("NetworkingCollect ProcessEvent handler is null!"); diff --git a/services/samgr/native/source/ffrt_handler.cpp b/services/samgr/native/source/ffrt_handler.cpp index 866605e5dba3768618d83494cda11b4ebbf1b1e8..9753dcb3db74a56ece1f81aa443689bfcefbda7b 100644 --- a/services/samgr/native/source/ffrt_handler.cpp +++ b/services/samgr/native/source/ffrt_handler.cpp @@ -99,7 +99,7 @@ void FFRTHandler::RemoveTask(const std::string& name) std::unique_lock lock(mutex_); auto item = taskMap_.find(name); if (item == taskMap_.end()) { - HILOGW("rm task %{public}s no find", name.c_str()); + HILOGW("rm task %{public}s NF", name.c_str()); return; } if (item->second != nullptr) { @@ -116,7 +116,7 @@ void FFRTHandler::DelTask(const std::string& name) std::unique_lock lock(mutex_); auto item = taskMap_.find(name); if (item == taskMap_.end()) { - HILOGW("del task %{public}s not find", name.c_str()); + HILOGW("del task %{public}s NF", name.c_str()); return; } HILOGD("erase task %{public}s ", name.c_str()); diff --git a/services/samgr/native/source/schedule/system_ability_state_machine.cpp b/services/samgr/native/source/schedule/system_ability_state_machine.cpp index dbc340e5fa86437a6e81bc3c0154542dab7ebaac..2a83f3a2be723421828276b508715ba4b33ee2ac 100644 --- a/services/samgr/native/source/schedule/system_ability_state_machine.cpp +++ b/services/samgr/native/source/schedule/system_ability_state_machine.cpp @@ -62,7 +62,7 @@ int32_t SystemAbilityStateMachine::AbilityStateTransitionLocked(const std::share return ERR_OK; } if (!handler->CanEnter(currentState)) { - HILOGE("Scheduler SA:%{public}d can't transiton from state %{public}d to %{public}d", + HILOGE("Scheduler SA:%{public}d can't state %{public}d to %{public}d", context->systemAbilityId, currentState, nextState); return TRANSIT_SA_STATE_FAIL; } @@ -71,7 +71,7 @@ int32_t SystemAbilityStateMachine::AbilityStateTransitionLocked(const std::share return UPDATE_STATE_COUNT_FAIL; } context->state = nextState; - HILOGD("Scheduler SA:%{public}d transiton from state %{public}d to %{public}d", + HILOGD("Scheduler SA:%{public}d state %{public}d to %{public}d", context->systemAbilityId, currentState, nextState); handler->OnEnter(context); return ERR_OK; @@ -123,12 +123,12 @@ int32_t SystemAbilityStateMachine::ProcessStateTransitionLocked(const std::share return ERR_OK; } if (!handler->CanEnter(currentState)) { - HILOGI("Scheduler proc:%{public}s can't transiton from state %{public}d to %{public}d", + HILOGI("Scheduler proc:%{public}s can't state %{public}d to %{public}d", Str16ToStr8(context->processName).c_str(), currentState, nextState); return TRANSIT_PROC_STATE_FAIL; } context->state = nextState; - HILOGI("Scheduler proc:%{public}s transiton from state %{public}d to %{public}d", + HILOGI("Scheduler proc:%{public}s state %{public}d to %{public}d", Str16ToStr8(context->processName).c_str(), currentState, nextState); handler->OnEnter(context); return ERR_OK; diff --git a/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp b/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp index 05a70f906a71e1773bf3ca8075a455f0364c205e..4cce71da6a888ef6a20019ec9bd6836aae26cef9 100644 --- a/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp +++ b/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp @@ -272,8 +272,8 @@ int32_t SystemAbilityStateScheduler::HandleLoadAbilityEvent(const LoadRequestInf if (!GetSystemAbilityContext(loadRequestInfo.systemAbilityId, abilityContext)) { return GET_SA_CONTEXT_FAIL; } - HILOGI("Scheduler SA:%{public}d load event start,callpid:%{public}d,evtid:%{public}d," - "ProcSta:%{public}d,SASta:%{public}d", loadRequestInfo.systemAbilityId, loadRequestInfo.callingPid, + HILOGI("Scheduler SA:%{public}d load start %{public}d,%{public}d_" + "%{public}d_%{public}d", loadRequestInfo.systemAbilityId, loadRequestInfo.callingPid, loadRequestInfo.loadEvent.eventId, abilityContext->ownProcessContext->state, abilityContext->state); std::lock_guard autoLock(abilityContext->ownProcessContext->processLock); int32_t result = HandleLoadAbilityEventLocked(abilityContext, loadRequestInfo); @@ -333,8 +333,8 @@ int32_t SystemAbilityStateScheduler::HandleUnloadAbilityEvent( if (!GetSystemAbilityContext(unloadRequestInfo->systemAbilityId, abilityContext)) { return GET_SA_CONTEXT_FAIL; } - HILOGI("Scheduler SA:%{public}d handle unload start callPid:%{public}d,evtId:%{public}d," - "ProcSta:%{public}d,SASta:%{public}d", unloadRequestInfo->systemAbilityId, unloadRequestInfo->callingPid, + HILOGI("Scheduler SA:%{public}d unload start %{public}d,%{public}d_" + "%{public}d_%{public}d", unloadRequestInfo->systemAbilityId, unloadRequestInfo->callingPid, unloadRequestInfo->unloadEvent.eventId, abilityContext->ownProcessContext->state, abilityContext->state); std::lock_guard autoLock(abilityContext->ownProcessContext->processLock); int32_t result = HandleUnloadAbilityEventLocked(abilityContext, unloadRequestInfo); @@ -811,8 +811,8 @@ int32_t SystemAbilityStateScheduler::KillSystemProcessLocked( } ReportProcessStopDuration(Str16ToStr8(processContext->processName), processContext->pid, processContext->uid, duration); - KHILOGI("Scheduler proc:%{public}s kill proc,pid:%{public}d,uid:%{public}d,ret:%{public}d," - "spend %{public}" PRId64 "ms", Str16ToStr8(processContext->processName).c_str(), processContext->pid, + KHILOGI("Scheduler proc:%{public}s kill pid:%{public}d,%{public}d_%{public}d_" + "%{public}" PRId64 "ms", Str16ToStr8(processContext->processName).c_str(), processContext->pid, processContext->uid, result, duration); return result; } diff --git a/services/samgr/native/source/system_ability_manager.cpp b/services/samgr/native/source/system_ability_manager.cpp index 892aba1d2f05fa87027f742375fc431f256deb07..1f5de27de92284e17f694633e297ffa711115b2b 100644 --- a/services/samgr/native/source/system_ability_manager.cpp +++ b/services/samgr/native/source/system_ability_manager.cpp @@ -506,8 +506,7 @@ int32_t SystemAbilityManager::UpdateOnDemandPolicy(int32_t systemAbilityId, OnDe void SystemAbilityManager::ProcessOnDemandEvent(const OnDemandEvent& event, const std::list& saControlList) { - HILOGI("DoEvent:%{public}d name:%{public}s value:%{public}s", - event.eventId, event.name.c_str(), event.value.c_str()); + HILOGI("DoEvent:%{public}d K:%{public}s V:%{public}s", event.eventId, event.name.c_str(), event.value.c_str()); if (collectManager_ != nullptr) { collectManager_->SaveCacheCommonEventSaExtraId(event, saControlList); } @@ -565,8 +564,7 @@ sptr SystemAbilityManager::CheckSystemAbility(int32_t systemAbili HILOGD("found SA:%{public}d,callpid:%{public}d", systemAbilityId, IPCSkeleton::GetCallingPid()); return iter->second.remoteObj; } - HILOGI("NF SA:%{public}d,pid:%{public}d,n:%{public}d", - systemAbilityId, IPCSkeleton::GetCallingPid(), count); + HILOGI("NF SA:%{public}d,%{public}d_%{public}d", systemAbilityId, IPCSkeleton::GetCallingPid(), count); return nullptr; } @@ -617,8 +615,7 @@ void SystemAbilityManager::NotifySystemAbilityChanged(int32_t systemAbilityId, c int32_t SystemAbilityManager::FindSystemAbilityNotify(int32_t systemAbilityId, const std::string& deviceId, int32_t code) { - HILOGI("FindSaNotify called:SA:%{public}d,code:%{public}d,size:%{public}zu", - systemAbilityId, code, listenerMap_.size()); + HILOGI("FindSaNotify SA:%{public}d,%{public}d_%{public}zu", systemAbilityId, code, listenerMap_.size()); lock_guard autoLock(listenerMapLock_); auto iter = listenerMap_.find(systemAbilityId); if (iter == listenerMap_.end()) { @@ -727,8 +724,7 @@ int32_t SystemAbilityManager::AddOnDemandSystemAbilityInfo(int32_t systemAbility } } onDemandAbilityMap_[systemAbilityId] = procName; - HILOGI("insert onDemand SA:%{public}d. size:%{public}zu", systemAbilityId, - onDemandAbilityMap_.size()); + HILOGI("insert onDemand SA:%{public}d_%{public}zu", systemAbilityId, onDemandAbilityMap_.size()); if (startingAbilityMap_.count(systemAbilityId) != 0) { if (workHandler_ != nullptr) { auto pendingTask = [procName, systemAbilityId, this] () { @@ -754,9 +750,9 @@ int32_t SystemAbilityManager::StartOnDemandAbilityLocked(int32_t systemAbilityId auto iter = onDemandAbilityMap_.find(systemAbilityId); if (iter == onDemandAbilityMap_.end()) { isExist = false; + HILOGI("NF onDemand SA:%{public}d", systemAbilityId); return ERR_INVALID_VALUE; } - HILOGI("found onDemand SA:%{public}d.", systemAbilityId); isExist = true; AbilityItem& abilityItem = startingAbilityMap_[systemAbilityId]; return StartOnDemandAbilityInner(iter->second, systemAbilityId, abilityItem); @@ -825,7 +821,7 @@ int32_t SystemAbilityManager::RemoveSystemAbility(int32_t systemAbilityId) ability->RemoveDeathRecipient(abilityDeath_); } (void)abilityMap_.erase(itSystemAbility); - KHILOGI("%{public}s called, SA:%{public}d, size:%{public}zu", __func__, systemAbilityId, abilityMap_.size()); + KHILOGI("rm SA:%{public}d_%{public}zu", systemAbilityId, abilityMap_.size()); } if (abilityStateScheduler_ == nullptr) { HILOGE("abilityStateScheduler is nullptr"); @@ -858,8 +854,7 @@ int32_t SystemAbilityManager::RemoveSystemAbility(const sptr& abi if (abilityDeath_ != nullptr) { ability->RemoveDeathRecipient(abilityDeath_); } - KHILOGI("%{public}s called, SA:%{public}d removed, size:%{public}zu", __func__, saId, - abilityMap_.size()); + KHILOGI("rm DeadSA:%{public}d_%{public}zu", saId, abilityMap_.size()); break; } } @@ -895,8 +890,7 @@ int32_t SystemAbilityManager::RemoveDiedSystemAbility(int32_t systemAbilityId) } (void)abilityMap_.erase(itSystemAbility); ReportSaCrash(systemAbilityId); - KHILOGI("%{public}s called, SA:%{public}d removed, size:%{public}zu", __func__, systemAbilityId, - abilityMap_.size()); + KHILOGI("rm DeadObj SA:%{public}d_%{public}zu", systemAbilityId, abilityMap_.size()); } SendSystemAbilityRemovedMsg(systemAbilityId); return ERR_OK; @@ -925,8 +919,8 @@ void SystemAbilityManager::CheckListenerNotify(int32_t systemAbilityId, if (listener->AsObject() == itemListener.listener->AsObject()) { int32_t callingPid = itemListener.callingPid; if (itemListener.state == ListenerState::INIT) { - HILOGI("NotifySaChanged add SA:%{public}d,cnt:%{public}d,callpid:%{public}d", - systemAbilityId, subscribeCountMap_[callingPid], callingPid); + HILOGI("NotifyAddSA:%{public}d,%{public}d_%{public}d", + systemAbilityId, callingPid, subscribeCountMap_[callingPid]); NotifySystemAbilityChanged(systemAbilityId, "", static_cast(SamgrInterfaceCode::ADD_SYSTEM_ABILITY_TRANSACTION), listener); itemListener.state = ListenerState::NOTIFIED; @@ -963,16 +957,13 @@ int32_t SystemAbilityManager::SubscribeSystemAbility(int32_t systemAbilityId, return ERR_PERMISSION_DENIED; } ++count; + bool ret = false; if (abilityStatusDeath_ != nullptr) { - bool ret = listener->AsObject()->AddDeathRecipient(abilityStatusDeath_); + ret = listener->AsObject()->AddDeathRecipient(abilityStatusDeath_); listeners.emplace_back(listener, callingPid); - if (!ret) { - HILOGW("Subscribe SA:%{public}d AddDeath fail,cnt:%{public}d," - "callpid:%{public}d", systemAbilityId, count, callingPid); - } } - HILOGI("Subscribe SA:%{public}d,size:%{public}zu,cnt:%{public}d,callpid:%{public}d", - systemAbilityId, listeners.size(), count, callingPid); + HILOGI("SubscribeSA:%{public}d,%{public}d_%{public}zu_%{public}d%{public}s", + systemAbilityId, callingPid, listeners.size(), count, ret ? "" : ",AddDeath fail"); } CheckListenerNotify(systemAbilityId, listener); return ERR_OK; @@ -1003,14 +994,14 @@ void SystemAbilityManager::UnSubscribeSystemAbilityLocked( } } listenerList.erase(item); - HILOGI("rm SA listener callPid:%{public}d,size:%{public}zu", callpid, listenerList.size()); + HILOGI("rm SAListener %{public}d,%{public}zu", callpid, listenerList.size()); } int32_t SystemAbilityManager::UnSubscribeSystemAbility(int32_t systemAbilityId, const sptr& listener) { if (!CheckInputSysAbilityId(systemAbilityId) || listener == nullptr) { - HILOGW("UnSubscribeSa saId or listener invalid"); + HILOGW("UnSubscribeSA saId or listener invalid"); return ERR_INVALID_VALUE; } @@ -1020,14 +1011,14 @@ int32_t SystemAbilityManager::UnSubscribeSystemAbility(int32_t systemAbilityId, if (abilityStatusDeath_ != nullptr) { listener->AsObject()->RemoveDeathRecipient(abilityStatusDeath_); } - HILOGI("UnSubscribeSa:%{public}d,size:%{public}zu", systemAbilityId, listeners.size()); + HILOGI("UnSubscribeSA:%{public}d_%{public}zu", systemAbilityId, listeners.size()); return ERR_OK; } void SystemAbilityManager::UnSubscribeSystemAbility(const sptr& remoteObject) { lock_guard autoLock(listenerMapLock_); - HILOGD("UnSubscribeSa remote object dead! size:%{public}zu", listenerMap_.size()); + HILOGD("UnSubscribeSA remote object dead! size:%{public}zu", listenerMap_.size()); for (auto& item : listenerMap_) { auto& listeners = item.second; UnSubscribeSystemAbilityLocked(listeners, remoteObject); @@ -1095,7 +1086,7 @@ int32_t SystemAbilityManager::AddSystemAbility(int32_t systemAbilityId, const sp systemAbilityId, callingPid, callingUid); } abilityMap_[systemAbilityId] = std::move(saInfo); - KHILOGI("insert %{public}d. size:%{public}zu", systemAbilityId, abilityMap_.size()); + KHILOGI("insert SA:%{public}d_%{public}zu", systemAbilityId, abilityMap_.size()); } RemoveCheckLoadedMsg(systemAbilityId); RegisterDistribute(systemAbilityId, extraProp.isDistributed); @@ -1138,26 +1129,22 @@ int32_t SystemAbilityManager::AddSystemProcess(const u16string& procName, return ERR_INVALID_VALUE; } systemProcessMap_[procName] = procObject; - HILOGI("AddProc:%{public}s. size:%{public}zu", Str16ToStr8(procName).c_str(), - systemProcessMap_.size()); } + bool ret = false; if (systemProcessDeath_ != nullptr) { - bool ret = procObject->AddDeathRecipient(systemProcessDeath_); - if (!ret) { - HILOGW("AddProc:%{public}s,size:%{public}zu,AddDeath fail", - Str16ToStr8(procName).c_str(), systemProcessMap_.size()); - } + ret = procObject->AddDeathRecipient(systemProcessDeath_); } + int64_t duration = 0; { lock_guard autoLock(startingProcessMapLock_); auto iterStarting = startingProcessMap_.find(procName); if (iterStarting != startingProcessMap_.end()) { - int64_t end = GetTickCount(); - HILOGI("AddProc start proc:%{public}s spend %{public}" PRId64 "ms", - Str16ToStr8(procName).c_str(), (end - iterStarting->second)); + duration = GetTickCount() - iterStarting->second; startingProcessMap_.erase(iterStarting); } } + HILOGI("AddProc:%{public}s,%{public}zu_%{public}" PRId64 "ms%{public}s", Str16ToStr8(procName).c_str(), + systemProcessMap_.size(), duration, ret ? "" : ",AddDeath fail"); if (abilityStateScheduler_ == nullptr) { HILOGE("abilityStateScheduler is nullptr"); return ERR_INVALID_VALUE; @@ -1190,7 +1177,7 @@ int32_t SystemAbilityManager::RemoveSystemProcess(const sptr& pro std::string name = Str16ToStr8(procName); processName = procName; (void)systemProcessMap_.erase(procName); - HILOGI("RemoveProc:%{public}s dead, size:%{public}zu", name.c_str(), + HILOGI("rm DeadProc:%{public}s,%{public}zu", name.c_str(), systemProcessMap_.size()); result = ERR_OK; break; @@ -1352,16 +1339,16 @@ void SystemAbilityManager::SendCheckLoadedMsg(int32_t systemAbilityId, const std HILOGE("SendCheckLoadedMsg workHandler_ is null"); } if (CheckSystemAbility(systemAbilityId) != nullptr) { - HILOGI("SendCheckLoadedMsg SA:%{public}d loaded.", systemAbilityId); + HILOGI("SendCheckLoadedMsg SA:%{public}d loaded", systemAbilityId); return; } - HILOGI("SendCheckLoadedMsg handle for SA:%{public}d.", systemAbilityId); + HILOGI("SendCheckLoadedMsg handle for SA:%{public}d", systemAbilityId); CleanCallbackForLoadFailed(systemAbilityId, name, srcDeviceId, callback); if (abilityStateScheduler_ == nullptr) { HILOGE("abilityStateScheduler is nullptr"); return; } - HILOGI("SendCheckLoadedMsg SA:%{public}d, load timeout.", systemAbilityId); + HILOGI("SendCheckLoadedMsg SA:%{public}d, load timeout", systemAbilityId); ReportSamgrSaLoadFail(systemAbilityId, IPCSkeleton::GetCallingPid(), IPCSkeleton::GetCallingUid(), "time out"); SamgrUtil::SendUpdateSaState(systemAbilityId, "loadfail"); @@ -1473,7 +1460,7 @@ void SystemAbilityManager::NotifySystemAbilityLoaded(int32_t systemAbilityId, co auto& abilityItem = iter->second; for (auto& [deviceId, callbackList] : abilityItem.callbackMap) { for (auto& callbackItem : callbackList) { - HILOGI("notify SA:%{public}d,SaSize:%{public}zu,ProcSize:%{public}zu,CbSize:%{public}d", + HILOGI("notify SA:%{public}d,%{public}zu_%{public}zu_%{public}d", systemAbilityId, abilityMap_.size(), systemProcessMap_.size(), callbackItem.second); NotifySystemAbilityLoaded(systemAbilityId, remoteObject, callbackItem.first); RemoveStartingAbilityCallbackLocked(callbackItem); @@ -1529,7 +1516,7 @@ int32_t SystemAbilityManager::StartDynamicSystemProcess(const std::u16string& na ReportProcessStartFail(Str16ToStr8(name), callingPid, callingUid, "err:" + ToString(result)); } ReportProcessStartDuration(Str16ToStr8(name), callingPid, callingUid, duration); - KHILOGI("Start dynamic proc:%{public}s,SA:%{public}d,ret:%{public}d,spend %{public}" PRId64 "ms", + KHILOGI("Start dynamic proc:%{public}s,%{public}d,%{public}d_%{public}" PRId64 "ms", Str16ToStr8(name).c_str(), systemAbilityId, result, duration); return result; } @@ -1545,9 +1532,6 @@ int32_t SystemAbilityManager::StartingSystemProcessLocked(const std::u16string& if (isProcessStarted) { bool isExist = false; StartOnDemandAbilityLocked(systemAbilityId, isExist); - if (!isExist) { - HILOGE("no find onDemandSA:%{public}d", systemAbilityId); - } return ERR_OK; } // call init start process @@ -1583,9 +1567,6 @@ int32_t SystemAbilityManager::StartingSystemProcess(const std::u16string& procNa if (isProcessStarted) { bool isExist = false; StartOnDemandAbility(systemAbilityId, isExist); - if (!isExist) { - HILOGE("no find onDemandSA:%{public}d.", systemAbilityId); - } return ERR_OK; } // call init start process @@ -1615,7 +1596,10 @@ int32_t SystemAbilityManager::DoLoadSystemAbility(int32_t systemAbilityId, const { sptr targetObject = CheckSystemAbility(systemAbilityId); if (targetObject != nullptr) { - HILOGI("DoLoadSystemAbility notify SA:%{public}d callpid:%{public}d!", systemAbilityId, callingPid); + if (event.eventId != INTERFACE_CALL) { + return ERR_OK; + } + HILOGI("DoLoadSA SA:%{public}d notify callpid:%{public}d!", systemAbilityId, callingPid); NotifySystemAbilityLoaded(systemAbilityId, targetObject, callback); return ERR_OK; } @@ -1637,16 +1621,13 @@ int32_t SystemAbilityManager::DoLoadSystemAbility(int32_t systemAbilityId, const ++count; abilityItem.callbackMap[LOCAL_DEVICE].emplace_back(callback, callingPid); abilityItem.event = event; + bool ret = false; if (abilityCallbackDeath_ != nullptr) { - bool ret = callback->AsObject()->AddDeathRecipient(abilityCallbackDeath_); - if (!ret) { - HILOGW("LoadSa SA:%{public}d AddDeath fail,cnt:%{public}d,callpid:%{public}d", - systemAbilityId, count, callingPid); - } + ret = callback->AsObject()->AddDeathRecipient(abilityCallbackDeath_); } ReportSamgrSaLoad(systemAbilityId, IPCSkeleton::GetCallingPid(), IPCSkeleton::GetCallingUid(), event.eventId); - HILOGI("LoadSa SA:%{public}d size:%{public}zu,count:%{public}d", - systemAbilityId, abilityItem.callbackMap[LOCAL_DEVICE].size(), count); + HILOGI("DoLoadSA:%{public}d,%{public}zu_%{public}d%{public}s", systemAbilityId, + abilityItem.callbackMap[LOCAL_DEVICE].size(), count, ret ? "" : ",AddDeath fail"); } result = StartingSystemProcess(procName, systemAbilityId, event); SendCheckLoadedMsg(systemAbilityId, procName, LOCAL_DEVICE, callback);