From bf3771d198e80cea940552a6b2c8ab7eee3a15f9 Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 10 Jan 2022 18:00:25 +0800 Subject: [PATCH] add trace Signed-off-by: yangzk Change-Id: I29bd2f766ed83597eb0db253d4eae96850f96913 --- .../kits/ability/ability_runtime/BUILD.gn | 1 + .../src/ability_context_impl.cpp | 26 +++++++------- .../kits/ability/native/src/ability.cpp | 18 +++++----- .../kits/ability/native/src/ability_impl.cpp | 4 ++- .../ability_runtime/js_ability_context.cpp | 2 ++ .../ability/native/src/ability_thread.cpp | 25 ++++++------- .../ability/native/src/extension_impl.cpp | 2 +- .../src/ability_connect_manager.cpp | 36 +++++++++---------- .../src/ability_manager_service.cpp | 32 ++++++++--------- services/abilitymgr/src/ability_record.cpp | 5 +-- .../abilitymgr/src/ability_stack_manager.cpp | 10 +++--- services/abilitymgr/src/app_scheduler.cpp | 11 +++--- .../src/kernal_system_app_manager.cpp | 2 +- .../abilitymgr/src/mission_list_manager.cpp | 2 ++ 14 files changed, 93 insertions(+), 83 deletions(-) diff --git a/frameworks/kits/ability/ability_runtime/BUILD.gn b/frameworks/kits/ability/ability_runtime/BUILD.gn index 4cb8bfd8cd0..25671b0711b 100644 --- a/frameworks/kits/ability/ability_runtime/BUILD.gn +++ b/frameworks/kits/ability/ability_runtime/BUILD.gn @@ -50,6 +50,7 @@ ohos_shared_library("ability_context_native") { external_deps = [ "aafwk_standard:runtime", + "bytrace_standard:bytrace_core", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "utils_base:utils", diff --git a/frameworks/kits/ability/ability_runtime/src/ability_context_impl.cpp b/frameworks/kits/ability/ability_runtime/src/ability_context_impl.cpp index d585dcd03d8..2abf85bd702 100644 --- a/frameworks/kits/ability/ability_runtime/src/ability_context_impl.cpp +++ b/frameworks/kits/ability/ability_runtime/src/ability_context_impl.cpp @@ -16,6 +16,7 @@ #include "ability_context_impl.h" #include "ability_manager_client.h" +#include "bytrace.h" #include "connection_manager.h" #include "hilog_wrapper.h" @@ -58,45 +59,46 @@ std::string AbilityContextImpl::GetDistributedFilesDir() ErrCode AbilityContextImpl::StartAbility(const AAFwk::Want &want, int requestCode) { - HILOG_DEBUG("AbilityContextImpl::StartAbility. Start calling ams->StartAbility."); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); + HILOG_DEBUG("AbilityContextImpl::StartAbility. Start calling StartAbility."); ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, token_, requestCode); - HILOG_INFO("AbilityContextImpl::StartAbility. End calling ams->StartAbility. ret=%{public}d", err); + HILOG_INFO("AbilityContextImpl::StartAbility. End calling StartAbility. ret=%{public}d", err); return err; } ErrCode AbilityContextImpl::StartAbility(const AAFwk::Want &want, const AAFwk::StartOptions &startOptions, int requestCode) { - HILOG_DEBUG("AbilityContextImpl::StartAbility. Start calling ams->StartAbility."); + HILOG_DEBUG("AbilityContextImpl::StartAbility. Start calling StartAbility."); ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, startOptions, token_, requestCode); - HILOG_INFO("AbilityContextImpl::StartAbility. End calling ams->StartAbility. ret=%{public}d", err); + HILOG_INFO("AbilityContextImpl::StartAbility. End calling StartAbility. ret=%{public}d", err); return err; } ErrCode AbilityContextImpl::StartAbilityForResult(const AAFwk::Want &want, int requestCode, RuntimeTask &&task) { - HILOG_DEBUG("%{public}s. Start calling ams->StartAbilityForResult.", __func__); + HILOG_DEBUG("%{public}s. Start calling StartAbilityForResult.", __func__); resultCallbacks_.insert(make_pair(requestCode, std::move(task))); ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, token_, requestCode); - HILOG_INFO("%{public}s. End calling ams->StartAbilityForResult. ret=%{public}d", __func__, err); + HILOG_INFO("%{public}s. End calling StartAbilityForResult. ret=%{public}d", __func__, err); return err; } ErrCode AbilityContextImpl::TerminateAbilityWithResult(const AAFwk::Want &want, int resultCode) { - HILOG_DEBUG("%{public}s. Start calling ams->TerminateAbilityWithResult.", __func__); + HILOG_DEBUG("%{public}s. Start calling TerminateAbilityWithResult.", __func__); ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->TerminateAbility(token_, resultCode, &want); - HILOG_INFO("%{public}s. End calling ams->TerminateAbilityWithResult. ret=%{public}d", __func__, err); + HILOG_INFO("%{public}s. End calling TerminateAbilityWithResult. ret=%{public}d", __func__, err); return err; } void AbilityContextImpl::OnAbilityResult(int requestCode, int resultCode, const AAFwk::Want &resultData) { - HILOG_DEBUG("%{public}s. Start calling ams->OnAbilityResult.", __func__); + HILOG_DEBUG("%{public}s. Start calling OnAbilityResult.", __func__); resultCallbacks_[requestCode](resultCode, resultData); resultCallbacks_.erase(requestCode); - HILOG_INFO("%{public}s. End calling ams->OnAbilityResult.", __func__); + HILOG_INFO("%{public}s. End calling OnAbilityResult.", __func__); } bool AbilityContextImpl::ConnectAbility(const AAFwk::Want &want, @@ -116,9 +118,9 @@ void AbilityContextImpl::DisconnectAbility(const AAFwk::Want &want, ErrCode ret = ConnectionManager::GetInstance().DisconnectAbility(token_, want.GetElement(), connectCallback); if (ret != ERR_OK) { - HILOG_ERROR("%{public}s end ams->DisconnectAbility error, ret=%{public}d", __func__, ret); + HILOG_ERROR("%{public}s end DisconnectAbility error, ret=%{public}d", __func__, ret); } - HILOG_INFO("%{public}s end ams->DisconnectAbility", __func__); + HILOG_INFO("%{public}s end DisconnectAbility", __func__); } std::string AbilityContextImpl::GetBundleName() const diff --git a/frameworks/kits/ability/native/src/ability.cpp b/frameworks/kits/ability/native/src/ability.cpp index c457361bee0..4811a080827 100644 --- a/frameworks/kits/ability/native/src/ability.cpp +++ b/frameworks/kits/ability/native/src/ability.cpp @@ -169,7 +169,7 @@ std::shared_ptr Ability::GetResourceManager() */ void Ability::OnStart(const Want &want) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("%{public}s begin.", __func__); if (abilityInfo_ == nullptr) { APP_LOGE("Ability::OnStart falied abilityInfo_ is nullptr."); @@ -244,7 +244,7 @@ void Ability::OnStart(const Want &want) */ void Ability::OnStop() { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("%{public}s begin.", __func__); if (scene_ != nullptr) { scene_ = nullptr; @@ -284,7 +284,7 @@ void Ability::OnStop() */ void Ability::OnActive() { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("%{public}s begin.", __func__); if (abilityWindow_ != nullptr) { APP_LOGI("%{public}s begin abilityWindow_->OnPostAbilityActive.", __func__); @@ -314,7 +314,7 @@ void Ability::OnActive() */ void Ability::OnInactive() { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("%{public}s begin.", __func__); if (abilityWindow_ != nullptr && abilityInfo_->type == AppExecFwk::AbilityType::PAGE) { APP_LOGI("%{public}s begin abilityWindow_->OnPostAbilityInactive.", __func__); @@ -378,7 +378,7 @@ void Ability::onSceneDestroyed() */ void Ability::OnForeground(const Want &want) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("%{public}s begin.", __func__); DoOnForeground(want); DispatchLifecycleOnForeground(want); @@ -427,7 +427,7 @@ void Ability::NotityContinuationResult(const Want& want, bool success) */ void Ability::OnBackground() { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("%{public}s begin.", __func__); if (abilityInfo_->type == AppExecFwk::AbilityType::PAGE) { APP_LOGI("%{public}s begin OnPostAbilityBackground.", __func__); @@ -476,7 +476,7 @@ void Ability::OnBackground() */ sptr Ability::OnConnect(const Want &want) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("%{public}s begin.", __func__); if (abilityLifecycleExecutor_ == nullptr) { APP_LOGE("Ability::OnConnect error. abilityLifecycleExecutor_ == nullptr."); @@ -501,7 +501,7 @@ sptr Ability::OnConnect(const Want &want) */ void Ability::OnDisconnect(const Want &want) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); } /** @@ -1140,7 +1140,7 @@ void Ability::SetVolumeTypeAdjustedByKey(int volumeType) */ void Ability::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("%{public}s begin restart=%{public}s,startId=%{public}d.", __func__, restart ? "true" : "false", startId); if (abilityLifecycleExecutor_ == nullptr) { APP_LOGE("Ability::OnCommand error. abilityLifecycleExecutor_ == nullptr."); diff --git a/frameworks/kits/ability/native/src/ability_impl.cpp b/frameworks/kits/ability/native/src/ability_impl.cpp index 31af78f66b7..1aafc595b53 100755 --- a/frameworks/kits/ability/native/src/ability_impl.cpp +++ b/frameworks/kits/ability/native/src/ability_impl.cpp @@ -28,7 +28,7 @@ void AbilityImpl::Init(std::shared_ptr &application, const std: std::shared_ptr &ability, std::shared_ptr &handler, const sptr &token, std::shared_ptr &contextDeal) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("AbilityImpl::init begin"); if ((token == nullptr) || (application == nullptr) || (handler == nullptr) || (record == nullptr) || ability == nullptr || contextDeal == nullptr) { @@ -203,6 +203,7 @@ void AbilityImpl::AfterUnFocused() void AbilityImpl::WindowLifeCycleImpl::AfterForeground() { + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("%{public}s begin.", __func__); auto owner = owner_.lock(); if (owner && owner->GetCompatibleVersion() < TARGET_VERSION_THRESHOLDS) { @@ -217,6 +218,7 @@ void AbilityImpl::WindowLifeCycleImpl::AfterForeground() void AbilityImpl::WindowLifeCycleImpl::AfterBackground() { + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("%{public}s begin.", __func__); auto owner = owner_.lock(); if (owner && owner->GetCompatibleVersion() < TARGET_VERSION_THRESHOLDS) { diff --git a/frameworks/kits/ability/native/src/ability_runtime/js_ability_context.cpp b/frameworks/kits/ability/native/src/ability_runtime/js_ability_context.cpp index 5c11d6ff05f..52a8a8bc64e 100644 --- a/frameworks/kits/ability/native/src/ability_runtime/js_ability_context.cpp +++ b/frameworks/kits/ability/native/src/ability_runtime/js_ability_context.cpp @@ -17,6 +17,7 @@ #include +#include "bytrace.h" #include "hilog_wrapper.h" #include "js_context_utils.h" #include "js_data_struct_converter.h" @@ -45,6 +46,7 @@ void JsAbilityContext::Finalizer(NativeEngine* engine, void* data, void* hint) NativeValue* JsAbilityContext::StartAbility(NativeEngine* engine, NativeCallbackInfo* info) { + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); JsAbilityContext* me = CheckParamsAndGetThis(engine, info); return (me != nullptr) ? me->OnStartAbility(*engine, *info) : nullptr; } diff --git a/frameworks/kits/ability/native/src/ability_thread.cpp b/frameworks/kits/ability/native/src/ability_thread.cpp index 7e23ce2e55d..cee7f5e6f31 100644 --- a/frameworks/kits/ability/native/src/ability_thread.cpp +++ b/frameworks/kits/ability/native/src/ability_thread.cpp @@ -166,7 +166,7 @@ void AbilityThread::Attach(std::shared_ptr &application, const std::shared_ptr &abilityRecord, const std::shared_ptr &mainRunner, const std::shared_ptr &stageContext) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("AbilityThread::Attach begin"); if ((application == nullptr) || (abilityRecord == nullptr) || (mainRunner == nullptr)) { APP_LOGE("AbilityThread::ability attach failed,context or record is nullptr"); @@ -235,7 +235,7 @@ void AbilityThread::Attach(std::shared_ptr &application, void AbilityThread::AttachExtension(std::shared_ptr &application, const std::shared_ptr &abilityRecord, const std::shared_ptr &mainRunner) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("AbilityThread::AttachExtension begin"); if ((application == nullptr) || (abilityRecord == nullptr) || (mainRunner == nullptr)) { APP_LOGE("AbilityThread::AttachExtension attach failed,context or record is nullptr"); @@ -290,7 +290,7 @@ void AbilityThread::AttachExtension(std::shared_ptr &applicatio void AbilityThread::AttachExtension(std::shared_ptr &application, const std::shared_ptr &abilityRecord) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("AbilityThread::AttachExtension begin"); if ((application == nullptr) || (abilityRecord == nullptr)) { APP_LOGE("AbilityThread::AttachExtension failed,context or record is nullptr"); @@ -349,7 +349,7 @@ void AbilityThread::Attach( std::shared_ptr &application, const std::shared_ptr &abilityRecord, const std::shared_ptr &stageContext) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("AbilityThread::Attach begin"); if ((application == nullptr) || (abilityRecord == nullptr)) { APP_LOGE("AbilityThread::ability attach failed,context or record is nullptr"); @@ -420,7 +420,7 @@ void AbilityThread::Attach( */ void AbilityThread::HandleAbilityTransaction(const Want &want, const LifeCycleStateInfo &lifeCycleStateInfo) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("AbilityThread::HandleAbilityTransaction begin"); if (abilityImpl_ == nullptr) { APP_LOGE("AbilityThread::HandleAbilityTransaction abilityImpl_ == nullptr"); @@ -446,7 +446,7 @@ void AbilityThread::HandleAbilityTransaction(const Want &want, const LifeCycleSt */ void AbilityThread::HandleExtensionTransaction(const Want &want, const LifeCycleStateInfo &lifeCycleStateInfo) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("AbilityThread::HandleExtensionTransaction begin"); if (extensionImpl_ == nullptr) { APP_LOGE("AbilityThread::HandleExtensionTransaction extensionImpl_ == nullptr"); @@ -462,7 +462,7 @@ void AbilityThread::HandleExtensionTransaction(const Want &want, const LifeCycle */ void AbilityThread::HandleConnectAbility(const Want &want) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("AbilityThread::HandleConnectAbility begin"); if (abilityImpl_ == nullptr) { APP_LOGE("AbilityThread::HandleConnectAbility abilityImpl_ == nullptr"); @@ -486,7 +486,7 @@ void AbilityThread::HandleConnectAbility(const Want &want) */ void AbilityThread::HandleDisconnectAbility(const Want &want) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("AbilityThread::HandleDisconnectAbility begin"); if (abilityImpl_ == nullptr) { APP_LOGE("AbilityThread::HandleDisconnectAbility abilityImpl_ == nullptr"); @@ -519,7 +519,7 @@ void AbilityThread::HandleDisconnectAbility(const Want &want) */ void AbilityThread::HandleCommandAbility(const Want &want, bool restart, int startId) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("AbilityThread::HandleCommandAbility begin"); APP_LOGI("AbilityThread::HandleCommandAbility before abilityImpl_->CommandAbility"); abilityImpl_->CommandAbility(want, restart, startId); @@ -540,7 +540,7 @@ void AbilityThread::HandleCommandAbility(const Want &want, bool restart, int sta */ void AbilityThread::HandleConnectExtension(const Want &want) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("AbilityThread::HandleConnectExtension begin"); if (extensionImpl_ == nullptr) { APP_LOGE("AbilityThread::HandleConnectExtension extensionImpl_ == nullptr"); @@ -559,7 +559,7 @@ void AbilityThread::HandleConnectExtension(const Want &want) */ void AbilityThread::HandleDisconnectExtension(const Want &want) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("AbilityThread::HandleDisconnectExtension begin"); if (extensionImpl_ == nullptr) { APP_LOGE("AbilityThread::HandleDisconnectExtension extensionImpl_ == nullptr"); @@ -585,7 +585,7 @@ void AbilityThread::HandleDisconnectExtension(const Want &want) */ void AbilityThread::HandleCommandExtension(const Want &want, bool restart, int startId) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("AbilityThread::HandleCommandExtension begin"); if (extensionImpl_ == nullptr) { APP_LOGE("AbilityThread::HandleCommandExtension extensionImpl_ == nullptr"); @@ -702,6 +702,7 @@ void AbilityThread::HandleUpdateConfiguration(const Configuration &config) */ void AbilityThread::ScheduleAbilityTransaction(const Want &want, const LifeCycleStateInfo &lifeCycleStateInfo) { + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); APP_LOGI("ScheduleAbilityTransaction begin: targeState = %{public}d, isNewWant = %{public}d", lifeCycleStateInfo.state, lifeCycleStateInfo.isNewWant); diff --git a/frameworks/kits/ability/native/src/extension_impl.cpp b/frameworks/kits/ability/native/src/extension_impl.cpp index 65361e81524..0286fddd179 100644 --- a/frameworks/kits/ability/native/src/extension_impl.cpp +++ b/frameworks/kits/ability/native/src/extension_impl.cpp @@ -28,7 +28,7 @@ void ExtensionImpl::Init(std::shared_ptr &applicati std::shared_ptr &handler, const sptr &token) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("ExtensionImpl Init begin."); if ((token == nullptr) || (application == nullptr) || (handler == nullptr) || (record == nullptr) || extension == nullptr) { diff --git a/services/abilitymgr/src/ability_connect_manager.cpp b/services/abilitymgr/src/ability_connect_manager.cpp index 8ee091e55da..29356963aa4 100644 --- a/services/abilitymgr/src/ability_connect_manager.cpp +++ b/services/abilitymgr/src/ability_connect_manager.cpp @@ -35,7 +35,7 @@ AbilityConnectManager::~AbilityConnectManager() int AbilityConnectManager::StartAbility(const AbilityRequest &abilityRequest) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); std::lock_guard guard(Lock_); return StartAbilityLocked(abilityRequest); } @@ -95,7 +95,7 @@ int AbilityConnectManager::TerminateAbilityResult(const sptr &tok int AbilityConnectManager::StartAbilityLocked(const AbilityRequest &abilityRequest) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("Start ability locked, ability_name: %{public}s", abilityRequest.want.GetElement().GetURI().c_str()); std::shared_ptr targetService; @@ -126,7 +126,7 @@ int AbilityConnectManager::StartAbilityLocked(const AbilityRequest &abilityReque int AbilityConnectManager::TerminateAbilityLocked(const sptr &token) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("Terminate ability locked."); auto abilityRecord = GetServiceRecordByToken(token); CHECK_POINTER_AND_RETURN(abilityRecord, ERR_INVALID_VALUE); @@ -153,7 +153,7 @@ int AbilityConnectManager::TerminateAbilityLocked(const sptr &tok int AbilityConnectManager::TerminateAbilityResultLocked(const sptr &token, int startId) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("Terminate ability result locked, startId: %{public}d", startId); CHECK_POINTER_AND_RETURN(token, ERR_INVALID_VALUE); @@ -170,7 +170,7 @@ int AbilityConnectManager::TerminateAbilityResultLocked(const sptr &targetService, bool &isLoadedAbility) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); AppExecFwk::ElementName element( abilityRequest.abilityInfo.deviceId, abilityRequest.abilityInfo.bundleName, abilityRequest.abilityInfo.name); auto serviceMapIter = serviceMap_.find(element.GetURI()); @@ -233,7 +233,7 @@ void AbilityConnectManager::GetConnectRecordListFromMap( int AbilityConnectManager::ConnectAbilityLocked(const AbilityRequest &abilityRequest, const sptr &connect, const sptr &callerToken) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("%{public}s, ability_name:%{public}s", __func__, abilityRequest.want.GetElement().GetURI().c_str()); std::lock_guard guard(Lock_); @@ -290,7 +290,7 @@ int AbilityConnectManager::ConnectAbilityLocked(const AbilityRequest &abilityReq int AbilityConnectManager::DisconnectAbilityLocked(const sptr &connect) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("Disconnect ability locked."); std::lock_guard guard(Lock_); @@ -335,7 +335,7 @@ int AbilityConnectManager::DisconnectAbilityLocked(const sptr &scheduler, const sptr &token) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); std::lock_guard guard(Lock_); auto abilityRecord = GetServiceRecordByToken(token); CHECK_POINTER_AND_RETURN(abilityRecord, ERR_INVALID_VALUE); @@ -355,7 +355,7 @@ int AbilityConnectManager::AttachAbilityThreadLocked( void AbilityConnectManager::OnAbilityRequestDone(const sptr &token, const int32_t state) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); std::lock_guard guard(Lock_); auto abilitState = DelayedSingleton::GetInstance()->ConvertToAppAbilityState(state); auto abilityRecord = GetServiceRecordByToken(token); @@ -385,7 +385,7 @@ void AbilityConnectManager::OnAppStateChanged(const AppInfo &info) int AbilityConnectManager::AbilityTransitionDone(const sptr &token, int state) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); std::lock_guard guard(Lock_); auto abilityRecord = GetServiceRecordByToken(token); CHECK_POINTER_AND_RETURN(abilityRecord, ERR_INVALID_VALUE); @@ -416,7 +416,7 @@ int AbilityConnectManager::AbilityTransitionDone(const sptr &toke int AbilityConnectManager::ScheduleConnectAbilityDoneLocked( const sptr &token, const sptr &remoteObject) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); std::lock_guard guard(Lock_); CHECK_POINTER_AND_RETURN(token, ERR_INVALID_VALUE); @@ -447,7 +447,7 @@ int AbilityConnectManager::ScheduleConnectAbilityDoneLocked( int AbilityConnectManager::ScheduleDisconnectAbilityDoneLocked(const sptr &token) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); std::lock_guard guard(Lock_); auto abilityRecord = GetServiceRecordByToken(token); CHECK_POINTER_AND_RETURN(abilityRecord, CONNECTION_NOT_EXIST); @@ -484,7 +484,7 @@ int AbilityConnectManager::ScheduleDisconnectAbilityDoneLocked(const sptr &token) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); std::lock_guard guard(Lock_); CHECK_POINTER_AND_RETURN(token, ERR_INVALID_VALUE); auto abilityRecord = Token::GetAbilityRecordByToken(token); @@ -561,7 +561,7 @@ void AbilityConnectManager::RemoveAll() void AbilityConnectManager::LoadAbility(const std::shared_ptr &abilityRecord) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); CHECK_POINTER(abilityRecord); PostTimeOutTask(abilityRecord, AbilityManagerService::LOAD_TIMEOUT_MSG); @@ -703,7 +703,7 @@ int AbilityConnectManager::DispatchTerminate(const std::shared_ptr &abilityRecord) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); CHECK_POINTER(abilityRecord); PostTimeOutTask(abilityRecord, AbilityConnectManager::CONNECT_TIMEOUT_MSG); abilityRecord->ConnectAbility(); @@ -711,7 +711,7 @@ void AbilityConnectManager::ConnectAbility(const std::shared_ptr void AbilityConnectManager::CommandAbility(const std::shared_ptr &abilityRecord) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); if (eventHandler_ != nullptr) { // first connect ability, There is at most one connect record. int recordId = abilityRecord->GetRecordId(); @@ -729,7 +729,7 @@ void AbilityConnectManager::CommandAbility(const std::shared_ptr void AbilityConnectManager::TerminateDone(const std::shared_ptr &abilityRecord) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); if (!abilityRecord->IsAbilityState(AbilityState::TERMINATING)) { std::string expect = AbilityRecord::ConvertAbilityState(AbilityState::TERMINATING); std::string actual = AbilityRecord::ConvertAbilityState(abilityRecord->GetAbilityState()); diff --git a/services/abilitymgr/src/ability_manager_service.cpp b/services/abilitymgr/src/ability_manager_service.cpp index 91749537537..4e13a4155ec 100644 --- a/services/abilitymgr/src/ability_manager_service.cpp +++ b/services/abilitymgr/src/ability_manager_service.cpp @@ -212,7 +212,7 @@ int AbilityManagerService::StartAbility(const Want &want, int requestCode) int AbilityManagerService::StartAbility(const Want &want, const sptr &callerToken, int requestCode) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); auto flags = want.GetFlags(); if ((flags & Want::FLAG_ABILITY_CONTINUATION) == Want::FLAG_ABILITY_CONTINUATION) { HILOG_ERROR("StartAbility with continuation flags is not allowed!"); @@ -230,7 +230,7 @@ int AbilityManagerService::StartAbility(const Want &want, const sptr &callerToken, int requestCode, int callerUid) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("%{public}s", __func__); if (callerToken != nullptr && !VerificationToken(callerToken)) { return ERR_INVALID_VALUE; @@ -278,7 +278,7 @@ int AbilityManagerService::StartAbility( int AbilityManagerService::StartAbility(const Want &want, const AbilityStartSetting &abilityStartSetting, const sptr &callerToken, int requestCode) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("Start ability setting."); if (callerToken != nullptr && !VerificationToken(callerToken)) { return ERR_INVALID_VALUE; @@ -328,7 +328,7 @@ int AbilityManagerService::StartAbility(const Want &want, const AbilityStartSett int AbilityManagerService::StartAbility(const Want &want, const StartOptions &startOptions, const sptr &callerToken, int requestCode) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("Start ability options."); if (callerToken != nullptr && !VerificationToken(callerToken)) { return ERR_INVALID_VALUE; @@ -372,7 +372,7 @@ int AbilityManagerService::StartAbility(const Want &want, const StartOptions &st int AbilityManagerService::TerminateAbility(const sptr &token, int resultCode, const Want *resultWant) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("Terminate ability for result: %{public}d", (resultWant != nullptr)); if (!VerificationToken(token)) { return ERR_INVALID_VALUE; @@ -739,7 +739,7 @@ int AbilityManagerService::RemoveStack(int id) int AbilityManagerService::ConnectAbility( const Want &want, const sptr &connect, const sptr &callerToken) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("Connect ability."); CHECK_POINTER_AND_RETURN(connect, ERR_INVALID_VALUE); CHECK_POINTER_AND_RETURN(connect->AsObject(), ERR_INVALID_VALUE); @@ -753,7 +753,7 @@ int AbilityManagerService::ConnectAbility( int AbilityManagerService::DisconnectAbility(const sptr &connect) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_DEBUG("Disconnect ability."); CHECK_POINTER_AND_RETURN(connect, ERR_INVALID_VALUE); CHECK_POINTER_AND_RETURN(connect->AsObject(), ERR_INVALID_VALUE); @@ -766,7 +766,7 @@ int AbilityManagerService::DisconnectAbility(const sptr &con int AbilityManagerService::ConnectLocalAbility( const Want &want, const sptr &connect, const sptr &callerToken) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("%{public}s begin ConnectAbilityLocal", __func__); AbilityRequest abilityRequest; ErrCode result = GenerateAbilityRequest(want, DEFAULT_INVAL_VALUE, abilityRequest, callerToken); @@ -1415,7 +1415,7 @@ int AbilityManagerService::ReleaseDataAbility( int AbilityManagerService::AttachAbilityThread( const sptr &scheduler, const sptr &token) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("Attach ability thread."); CHECK_POINTER_AND_RETURN(scheduler, ERR_INVALID_VALUE); @@ -1621,7 +1621,7 @@ void AbilityManagerService::DumpState(const std::string &args, std::vector &token, int state, const PacMap &saveData) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("Ability transition done, state:%{public}d", state); if (!VerificationToken(token)) { return ERR_INVALID_VALUE; @@ -1657,7 +1657,7 @@ int AbilityManagerService::AbilityTransitionDone(const sptr &toke int AbilityManagerService::ScheduleConnectAbilityDone( const sptr &token, const sptr &remoteObject) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("Schedule connect ability done."); if (!VerificationToken(token)) { return ERR_INVALID_VALUE; @@ -1677,7 +1677,7 @@ int AbilityManagerService::ScheduleConnectAbilityDone( int AbilityManagerService::ScheduleDisconnectAbilityDone(const sptr &token) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("Schedule disconnect ability done."); if (!VerificationToken(token)) { return ERR_INVALID_VALUE; @@ -1697,7 +1697,7 @@ int AbilityManagerService::ScheduleDisconnectAbilityDone(const sptr &token) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("Schedule command ability done."); if (!VerificationToken(token)) { return ERR_INVALID_VALUE; @@ -1726,7 +1726,7 @@ void AbilityManagerService::AddWindowInfo(const sptr &token, int3 void AbilityManagerService::OnAbilityRequestDone(const sptr &token, const int32_t state) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("On ability request done."); if (!VerificationToken(token)) { return; @@ -1908,7 +1908,7 @@ void AbilityManagerService::StartSystemUi(const std::string abilityName) int AbilityManagerService::GenerateAbilityRequest( const Want &want, int requestCode, AbilityRequest &request, const sptr &callerToken) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); request.want = want; request.requestCode = requestCode; request.callerToken = callerToken; @@ -1989,7 +1989,7 @@ int AbilityManagerService::TerminateAbilityResult(const sptr &tok int AbilityManagerService::StopServiceAbility(const Want &want) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_DEBUG("Stop service ability."); AbilityRequest abilityRequest; int result = GenerateAbilityRequest(want, DEFAULT_INVAL_VALUE, abilityRequest, nullptr); diff --git a/services/abilitymgr/src/ability_record.cpp b/services/abilitymgr/src/ability_record.cpp index d07294c6092..99b6e06c02f 100644 --- a/services/abilitymgr/src/ability_record.cpp +++ b/services/abilitymgr/src/ability_record.cpp @@ -138,7 +138,7 @@ bool AbilityRecord::Init() int AbilityRecord::LoadAbility() { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("%s", __func__); startTime_ = AbilityUtil::SystemTimeMillis(); CHECK_POINTER_AND_RETURN(token_, ERR_INVALID_VALUE); @@ -165,6 +165,7 @@ int AbilityRecord::LoadAbility() void AbilityRecord::ForegroundAbility() { + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("ForegroundAbility."); CHECK_POINTER(lifecycleDeal_); @@ -703,7 +704,7 @@ void AbilityRecord::RemoveConnectRecordFromList(const std::shared_ptr &callerToken, int requestCode) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("Add caller record."); auto abilityRecord = Token::GetAbilityRecordByToken(callerToken); CHECK_POINTER(abilityRecord); diff --git a/services/abilitymgr/src/ability_stack_manager.cpp b/services/abilitymgr/src/ability_stack_manager.cpp index c849d7f7139..a40e31ddad7 100644 --- a/services/abilitymgr/src/ability_stack_manager.cpp +++ b/services/abilitymgr/src/ability_stack_manager.cpp @@ -125,7 +125,7 @@ int AbilityStackManager::StartAbility(const AbilityRequest &abilityRequest) int AbilityStackManager::StartAbilityLocked( const std::shared_ptr ¤tTopAbility, const AbilityRequest &abilityRequest) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); // lock screen state if (IsLockScreenState()) { HILOG_DEBUG("Start ability with white list ..."); @@ -200,7 +200,7 @@ int AbilityStackManager::StartAbilityAsDefaultLocked( int AbilityStackManager::StartAbilityLifeCycle(std::shared_ptr lastTopAbility, std::shared_ptr currentTopAbility, std::shared_ptr targetAbility) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); CHECK_POINTER_AND_RETURN(targetAbility, ERR_INVALID_VALUE); CHECK_POINTER_AND_RETURN(currentTopAbility, ERR_INVALID_VALUE); enum ChangeType { T_ACTIVE = 0, T_CHANGE, T_DEFAULT } changeType; @@ -310,7 +310,7 @@ int AbilityStackManager::GetTargetChangeType(bool isMissionChanged, bool isStack int AbilityStackManager::StartAbilityAsMultiWindowLocked( const std::shared_ptr ¤tTopAbility, const AbilityRequest &abilityRequest) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_DEBUG("Start ability as special locked."); CHECK_POINTER_AND_RETURN(currentTopAbility, INNER_ERR); @@ -397,7 +397,7 @@ int AbilityStackManager::StartAbilityAsMultiWindowLocked( int AbilityStackManager::StartAbilityByAllowListLocked( const std::shared_ptr ¤tTopAbility, const AbilityRequest &abilityRequest) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_DEBUG("Start ability as allow list locked."); // 1. lockscreen stack is target mission stack std::shared_ptr targetStack = GetTargetMissionStack(abilityRequest); @@ -453,7 +453,7 @@ void AbilityStackManager::SortPreMission( void AbilityStackManager::MoveMissionAndAbility(const std::shared_ptr ¤tTopAbility, std::shared_ptr &targetAbilityRecord, std::shared_ptr &targetMissionRecord) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("Move mission and ability."); CHECK_POINTER(targetAbilityRecord); CHECK_POINTER(targetMissionRecord); diff --git a/services/abilitymgr/src/app_scheduler.cpp b/services/abilitymgr/src/app_scheduler.cpp index 6d8c49c463c..7a6b868ad66 100644 --- a/services/abilitymgr/src/app_scheduler.cpp +++ b/services/abilitymgr/src/app_scheduler.cpp @@ -56,7 +56,6 @@ bool AppScheduler::Init(const std::weak_ptr &callback) int AppScheduler::LoadAbility(const sptr &token, const sptr &preToken, const AppExecFwk::AbilityInfo &abilityInfo, const AppExecFwk::ApplicationInfo &applicationInfo) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); HILOG_DEBUG("Load ability."); CHECK_POINTER_AND_RETURN(appMgrClient_, INNER_ERR); /* because the errcode type of AppMgr Client API will be changed to int, @@ -71,7 +70,7 @@ int AppScheduler::LoadAbility(const sptr &token, const sptr &token) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_DEBUG("Terminate ability."); CHECK_POINTER_AND_RETURN(appMgrClient_, INNER_ERR); /* because the errcode type of AppMgr Client API will be changed to int, @@ -86,7 +85,7 @@ int AppScheduler::TerminateAbility(const sptr &token) void AppScheduler::MoveToForground(const sptr &token) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_DEBUG("Move to forground."); CHECK_POINTER(appMgrClient_); appMgrClient_->UpdateAbilityState(token, AppExecFwk::AbilityState::ABILITY_STATE_FOREGROUND); @@ -94,7 +93,7 @@ void AppScheduler::MoveToForground(const sptr &token) void AppScheduler::MoveToBackground(const sptr &token) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_DEBUG("Move to background."); CHECK_POINTER(appMgrClient_); appMgrClient_->UpdateAbilityState(token, AppExecFwk::AbilityState::ABILITY_STATE_BACKGROUND); @@ -152,7 +151,7 @@ AppAbilityState AppScheduler::GetAbilityState() const void AppScheduler::OnAbilityRequestDone(const sptr &token, const AppExecFwk::AbilityState state) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("On ability request done, state:%{public}d", static_cast(state)); auto callback = callback_.lock(); CHECK_POINTER(callback); @@ -210,7 +209,7 @@ int AppScheduler::CompelVerifyPermission(const std::string &permission, int pid, void AppScheduler::OnAppStateChanged(const AppExecFwk::AppProcessData &appData) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); auto callback = callback_.lock(); CHECK_POINTER(callback); AppInfo info; diff --git a/services/abilitymgr/src/kernal_system_app_manager.cpp b/services/abilitymgr/src/kernal_system_app_manager.cpp index 0198a55b6c6..fca9ab85755 100644 --- a/services/abilitymgr/src/kernal_system_app_manager.cpp +++ b/services/abilitymgr/src/kernal_system_app_manager.cpp @@ -32,7 +32,7 @@ KernalSystemAppManager::~KernalSystemAppManager() int KernalSystemAppManager::StartAbility(const AbilityRequest &abilityRequest) { - BYTRACE(BYTRACE_TAG_ABILITY_MANAGER); + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_INFO("start kernal systerm ability."); std::lock_guard guard(stackLock_); if (!waittingAbilityQueue_.empty()) { diff --git a/services/abilitymgr/src/mission_list_manager.cpp b/services/abilitymgr/src/mission_list_manager.cpp index dc6995bcac1..175ad156940 100644 --- a/services/abilitymgr/src/mission_list_manager.cpp +++ b/services/abilitymgr/src/mission_list_manager.cpp @@ -18,6 +18,7 @@ #include "ability_manager_errors.h" #include "ability_manager_service.h" #include "ability_util.h" +#include "bytrace.h" #include "errors.h" #include "hilog_wrapper.h" #include "mission_info_mgr.h" @@ -661,6 +662,7 @@ int MissionListManager::DispatchForegroundNew(const std::shared_ptr &abilityRecord) { + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); std::lock_guard guard(managerLock_); CHECK_POINTER(abilityRecord); -- Gitee