!1014 DFX: 雷达打点精简 & dfx目录整理

Merge pull request !1014 from zhx/master
This commit is contained in:
openharmony_ci 2024-07-27 11:21:07 +00:00 committed by Gitee
commit d2a0f04eec
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
20 changed files with 32 additions and 84 deletions

View File

@ -107,6 +107,9 @@ ohos_shared_library("distributedschedsvr") {
"src/continue_scene_session_handler.cpp",
"src/datashare_manager.cpp",
"src/deviceManager/dms_device_info.cpp",
"src/dfx/distributed_radar.cpp",
"src/dfx/distributed_sched_dumper.cpp",
"src/dfx/distributed_ue.cpp",
"src/dfx/dms_continue_time_dumper.cpp",
"src/dfx/dms_hisysevent_report.cpp",
"src/dfx/dms_hitrace_chain.cpp",
@ -117,15 +120,12 @@ ohos_shared_library("distributedschedsvr") {
"src/distributedWant/distributed_want_params_wrapper.cpp",
"src/distributed_device_node_listener.cpp",
"src/distributed_event_died_listener.cpp",
"src/distributed_radar.cpp",
"src/distributed_sched_adapter.cpp",
"src/distributed_sched_continuation.cpp",
"src/distributed_sched_dumper.cpp",
"src/distributed_sched_permission.cpp",
"src/distributed_sched_proxy.cpp",
"src/distributed_sched_service.cpp",
"src/distributed_sched_stub.cpp",
"src/distributed_ue.cpp",
"src/dms_callback_task.cpp",
"src/dms_free_install_callback.cpp",
"src/dms_free_install_callback_proxy.cpp",

View File

@ -20,7 +20,7 @@
#include "ability_manager_client.h"
#include "caller_info.h"
#include "device_auth.h"
#include "distributed_radar.h"
#include "dfx/distributed_radar.h"
#include "distributed_sched_interface.h"
#include "event_handler.h"
#include "if_system_ability_manager.h"

View File

@ -24,12 +24,12 @@
#include "bundle/bundle_manager_internal.h"
#include "continue_scene_session_handler.h"
#include "datetime_ex.h"
#include "dfx/distributed_radar.h"
#include "dfx/distributed_ue.h"
#include "dfx/dms_continue_time_dumper.h"
#include "distributed_radar.h"
#include "distributed_sched_permission.h"
#include "distributed_sched_service.h"
#include "distributed_sched_utils.h"
#include "distributed_ue.h"
#include "dsched_continue_event.h"
#include "dsched_continue_manager.h"
#include "dsched_data_buffer.h"

View File

@ -21,7 +21,7 @@
#include "cJSON.h"
#include "continue_scene_session_handler.h"
#include "distributed_radar.h"
#include "dfx/distributed_radar.h"
#include "distributed_sched_utils.h"
#include "dsched_transport_softbus_adapter.h"
#include "dtbschedmgr_device_info_storage.h"
@ -440,7 +440,7 @@ void DSchedContinueManager::NotifyTerminateContinuation(const int32_t missionId)
HILOGW("No continuation in progress.");
return;
}
AliveMissionInfo missionInfo;
int32_t ret = DMSContinueSendMgr::GetInstance().GetAliveMissionInfo(missionId, missionInfo);
if (ret != ERR_OK) {

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "distributed_radar.h"
#include "dfx/distributed_radar.h"
#include "hisysevent.h"

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "distributed_sched_dumper.h"
#include "dfx/distributed_sched_dumper.h"
#include "accesstoken_kit.h"
#include "dfx/dms_continue_time_dumper.h"

View File

@ -13,8 +13,8 @@
* limitations under the License.
*/
#include "dfx/distributed_ue.h"
#include "dfx/dms_continue_time_dumper.h"
#include "distributed_ue.h"
#include "dms_constant.h"
#include "hisysevent.h"

View File

@ -45,13 +45,13 @@
#include "bundle/bundle_manager_internal.h"
#include "connect_death_recipient.h"
#include "datashare_manager.h"
#include "dfx/distributed_radar.h"
#include "dfx/distributed_sched_dumper.h"
#include "dfx/distributed_ue.h"
#include "dfx/dms_continue_time_dumper.h"
#include "distributed_radar.h"
#include "distributed_sched_adapter.h"
#include "distributed_sched_dumper.h"
#include "distributed_sched_permission.h"
#include "distributed_sched_utils.h"
#include "distributed_ue.h"
#include "dms_callback_task.h"
#include "dms_constant.h"
#include "dms_free_install_callback.h"

View File

@ -16,7 +16,7 @@
#include "mission/distributed_mission_focused_listener.h"
#include "continue/dsched_continue_manager.h"
#include "distributed_radar.h"
#include "dfx/distributed_radar.h"
#include "dtbschedmgr_log.h"
#include "mission/dms_continue_send_manager.h"
@ -51,7 +51,6 @@ void DistributedMissionFocusedListener::OnMissionMovedToFront(int32_t missionId)
void DistributedMissionFocusedListener::OnMissionFocused(int32_t missionId)
{
HILOGD("OnMissionFocused, missionId = %{public}d", missionId);
DmsRadar::GetInstance().DmsFocused("OnMissionFocused", NORMAL);
DMSContinueSendMgr::GetInstance().NotifyMissionFocused(missionId, FocusedReason::NORMAL);
}

View File

@ -19,17 +19,17 @@
#include "datetime_ex.h"
#include "datashare_manager.h"
#include "dfx/distributed_radar.h"
#include "dfx/distributed_ue.h"
#include "distributed_sched_utils.h"
#include "distributed_radar.h"
#include "distributed_sched_adapter.h"
#include "dtbschedmgr_device_info_storage.h"
#include "dtbschedmgr_log.h"
#include "distributed_ue.h"
#include "mission/wifi_state_adapter.h"
#include "parcel_helper.h"
#include "softbus_adapter/softbus_adapter.h"
#include "switch_status_dependency.h"
#include "datashare_manager.h"
#include "mission/wifi_state_adapter.h"
namespace OHOS {
namespace DistributedSchedule {
@ -113,9 +113,6 @@ void DMSContinueRecvMgr::NotifyDataRecv(std::string& senderNetworkId,
int32_t state = ACTIVE;
if (type == DMS_UNFOCUSED_TYPE) {
state = INACTIVE;
DmsRadar::GetInstance().RecvUnfocused("NotifyDataRecv");
} else {
DmsRadar::GetInstance().RecvFocused("NotifyDataRecv");
}
PostOnBroadcastBusiness(senderNetworkId, bundleNameId, continueTypeId, state);
HILOGI("NotifyDataRecv end");
@ -261,11 +258,6 @@ int32_t DMSContinueRecvMgr::DealOnBroadcastBusiness(const std::string& senderNet
GetAnonymStr(senderNetworkId).c_str(), bundleNameId, state);
std::string bundleName;
int32_t ret = BundleManagerInternal::GetBundleNameById(senderNetworkId, bundleNameId, bundleName);
bool res = (state == INACTIVE) ? DmsRadar::GetInstance().UnfocusedGetBundleName("GetBundleNameById", ret)
: DmsRadar::GetInstance().FocusedGetBundleName("GetBundleNameById", ret);
if (!res) {
HILOGE("%{public}s failed", (state == INACTIVE) ? "UnfocusedGetBundleName" : "FocusedGetBundleName");
}
if (ret != ERR_OK) {
HILOGW("get bundleName failed, ret: %{public}d, try = %{public}d", ret, retry);
return RetryPostBroadcast(senderNetworkId, bundleNameId, continueTypeId, state, retry);
@ -327,11 +319,6 @@ void DMSContinueRecvMgr::NotifyRecvBroadcast(const sptr<IRemoteObject>& obj,
PARCEL_WRITE_HELPER_NORET(data, String, continueType);
HILOGI("[PerformanceTest] NotifyRecvBroadcast called, IPC begin = %{public}" PRId64, GetTickCount());
int32_t error = obj->SendRequest(ON_CALLBACK, data, reply, option);
bool res = (state == INACTIVE) ? DmsRadar::GetInstance().NotifyDockUnfocused("NotifyRecvBroadcast", error)
: DmsRadar::GetInstance().NotifyDockFocused("NotifyRecvBroadcast", error);
if (!res) {
HILOGE("%{public}s failed", (state == INACTIVE) ? "NotifyDockUnfocused" : "NotifyDockFocused");
}
if (state != INACTIVE) {
std::string bName = bundleName;
std::string cType = continueType;

View File

@ -21,16 +21,16 @@
#include "adapter/mmi_adapter.h"
#include "datetime_ex.h"
#include "datashare_manager.h"
#include "distributed_radar.h"
#include "dfx/distributed_radar.h"
#include "distributed_sched_adapter.h"
#include "distributed_sched_utils.h"
#include "dtbschedmgr_device_info_storage.h"
#include "dtbschedmgr_log.h"
#include "mission/dms_continue_recv_manager.h"
#include "mission/wifi_state_adapter.h"
#include "parcel_helper.h"
#include "softbus_adapter/softbus_adapter.h"
#include "switch_status_dependency.h"
#include "mission/dms_continue_recv_manager.h"
#include "mission/wifi_state_adapter.h"
namespace OHOS {
namespace DistributedSchedule {
@ -67,7 +67,6 @@ void DMSContinueSendMgr::Init()
HILOGW("GetCurrentMissionId failed, init end. ret: %{public}d", missionId);
return;
}
DmsRadar::GetInstance().DmsFocused("Init", INIT);
NotifyMissionFocused(missionId, FocusedReason::INIT);
HILOGI("Init end");
}
@ -115,7 +114,6 @@ void DMSContinueSendMgr::PostUnfocusedTaskWithDelay(const int32_t missionId, Unf
}
if (reason == UnfocusedReason::TIMEOUT) {
auto funcOut = [this, missionId]() {
DmsRadar::GetInstance().RecordTime("funcOut");
DealUnfocusedBusiness(missionId, UnfocusedReason::TIMEOUT);
};
std::string timeoutTaskName = TIMEOUT_UNFOCUSED_TASK + std::to_string(missionId);
@ -164,7 +162,6 @@ void DMSContinueSendMgr::NotifyMissionFocused(const int32_t missionId, FocusedRe
void DMSContinueSendMgr::NotifyMissionUnfocused(const int32_t missionId, UnfocusedReason reason)
{
HILOGI("NotifyMissionUnfocused start, missionId: %{public}d, reason: %{public}d", missionId, reason);
DmsRadar::GetInstance().DmsUnfocused("NotifyMissionUnfocused");
if (reason <= UnfocusedReason::MIN || reason >= UnfocusedReason::MAX) {
HILOGE("unknown unfocused reason!");
return;
@ -300,7 +297,7 @@ int32_t DMSContinueSendMgr::DealFocusedBusiness(const int32_t missionId)
return REMOTE_DEVICE_BIND_ABILITY_ERR;
}
focusedMission_[bundleName] = missionId;
std::string abilityName = info.want.GetElement().GetAbilityName();
focusedMissionAbility_[missionId] = abilityName;
aliveMission_[missionId] = { bundleName, abilityName };
@ -322,7 +319,6 @@ int32_t DMSContinueSendMgr::FocusedBusinessSendEvent(std::string bundleName, con
{
uint16_t bundleNameId = 0;
int32_t ret = BundleManagerInternal::GetBundleNameId(bundleName, bundleNameId);
DmsRadar::GetInstance().NormalFocusedGetAccessTokenIdRes("GetBundleNameId", ret);
if (ret != ERR_OK) {
HILOGE("Get focused bundleNameId failed, bundleNameId: %{public}u, ret: %{public}d", bundleNameId, ret);
return ret;
@ -336,7 +332,6 @@ int32_t DMSContinueSendMgr::FocusedBusinessSendEvent(std::string bundleName, con
}
ret = SendSoftbusEvent(bundleNameId, continueTypeId, DMS_FOCUSED_TYPE);
DmsRadar::GetInstance().NormalFocusedSendEventRes("SendSoftbusEvent", ret);
if (ret != ERR_OK) {
HILOGE("SendSoftbusEvent focused failed, ret: %{public}d", ret);
}
@ -375,7 +370,7 @@ int32_t DMSContinueSendMgr::DealUnfocusedBusiness(const int32_t missionId, Unfoc
}
HILOGI("Get bundleName success, mission is continuable, missionId: %{public}d, bundleName: %{public}s",
missionId, bundleName.c_str());
std::string abilityName;
ret = GetAbilityNameByMissionId(missionId, abilityName);
if (ret != ERR_OK) {
@ -452,7 +447,7 @@ int32_t DMSContinueSendMgr::SendScreenOffEvent(uint8_t type)
HILOGE("Get focused contineTypeId failed, abilityName: %{public}s, ret: %{public}d", abilityName.c_str(), ret);
return ret;
}
ret = SendSoftbusEvent(bundleNameId, continueTypeId, type);
if (ret != ERR_OK) {
HILOGE("SendSoftbusEvent unfocused failed, ret: %{public}d", ret);
@ -537,11 +532,6 @@ int32_t DMSContinueSendMgr::DealSetMissionContinueStateBusiness(const int32_t mi
const AAFwk::ContinueState &state)
{
HILOGI("DealSetMissionContinueStateBusiness start, missionId: %{public}d, state: %{public}d", missionId, state);
if (state == AAFwk::ContinueState::CONTINUESTATE_INACTIVE) {
DmsRadar::GetInstance().SetUnfocusedState("DealSetMissionContinueStateBusiness");
} else {
DmsRadar::GetInstance().SetFocusedState("DealSetMissionContinueStateBusiness");
}
if (info_.currentMissionId != missionId) {
HILOGE("mission is not focused, broadcast task abort, missionId: %{public}d", missionId);
return INVALID_PARAMETERS_ERR;
@ -551,7 +541,7 @@ int32_t DMSContinueSendMgr::DealSetMissionContinueStateBusiness(const int32_t mi
HILOGI("mission is not continuable, broadcast task abort, missionId: %{public}d", missionId);
return INVALID_PARAMETERS_ERR;
}
uint16_t bundleNameId = 0;
uint8_t continueTypeId = 0;
int32_t ret = GetBundleNameIdAndContinueTypeId(missionId, state, bundleNameId, continueTypeId);
@ -586,11 +576,6 @@ int32_t DMSContinueSendMgr::GetBundleNameIdAndContinueTypeId(const int32_t missi
}
ret = BundleManagerInternal::GetBundleNameId(bundleName, bundleNameId);
if (state == AAFwk::ContinueState::CONTINUESTATE_INACTIVE) {
DmsRadar::GetInstance().ChangeStateUnfocusedGetAccessTokenIdRes("GetBundleNameId", ret);
} else {
DmsRadar::GetInstance().ChangeStateFocusedGetAccessTokenIdRes("GetBundleNameId", ret);
}
if (ret != ERR_OK) {
HILOGE("get bundleNameId failed, bundleNameId: %{public}u, ret: %{public}d", bundleNameId, ret);
return ret;
@ -610,7 +595,6 @@ int32_t DMSContinueSendMgr::GetBundleNameIdAndContinueTypeId(const int32_t missi
void DMSContinueSendMgr::OnMMIEvent()
{
HILOGD("OnMMIEvent, missionId = %{public}d", info_.currentMissionId);
DmsRadar::GetInstance().DmsFocused("OnMMIEvent", MULTIMODE);
DMSContinueSendMgr::GetInstance().NotifyMissionFocused(info_.currentMissionId, FocusedReason::MMI);
}
@ -620,7 +604,6 @@ int32_t DMSContinueSendMgr::NotifyDeviceOnline()
if (GetCurrentMissionId() <= 0) {
return INVALID_MISSION_ID;
}
DmsRadar::GetInstance().DmsFocused("NotifyDeviceOnline", DEVICEONLINE);
NotifyMissionFocused(info_.currentMissionId, FocusedReason::ONLINE);
return ERR_OK;
}
@ -729,13 +712,6 @@ int32_t DMSContinueSendMgr::GetAccessTokenIdSendEvent(std::string bundleName,
UnfocusedReason reason, uint16_t& bundleNameId, uint8_t& continueTypeId)
{
int32_t ret = BundleManagerInternal::GetBundleNameId(bundleName, bundleNameId);
bool res = (reason != UnfocusedReason::TIMEOUT)
? DmsRadar::GetInstance().NormalUnfocusedGetAccessTokenIdRes("GetBundleNameId", ret)
: DmsRadar::GetInstance().MultimodeUnfocusedGetAccessTokenIdRes("GetBundleNameId", ret);
if (!res) {
HILOGE("%{public}s failed", (reason != UnfocusedReason::TIMEOUT) ? "NormalUnfocusedGetAccessTokenIdRes"
: "MultimodeUnfocusedGetAccessTokenIdRes");
}
if (ret != ERR_OK) {
HILOGE("Get unfocused bundleNameId failed, bundleNameId: %{public}u, ret: %{public}d", bundleNameId, ret);
return ret;
@ -743,13 +719,6 @@ int32_t DMSContinueSendMgr::GetAccessTokenIdSendEvent(std::string bundleName,
if (screenOffHandler_ != nullptr && screenOffHandler_->IsDeviceScreenOn()) {
ret = SendSoftbusEvent(bundleNameId, continueTypeId, DMS_UNFOCUSED_TYPE);
bool res = (reason != UnfocusedReason::TIMEOUT)
? DmsRadar::GetInstance().NormalUnfocusedSendEventRes("SendSoftbusEvent", ret)
: DmsRadar::GetInstance().MultimodeUnfocusedSendEventRes("SendSoftbusEvent", ret);
if (!res) {
HILOGE("%{public}s failed", (reason != UnfocusedReason::TIMEOUT) ? "NormalUnfocusedSendEventRes"
: "MultimodeUnfocusedSendEventRes");
}
if (ret != ERR_OK) {
HILOGE("SendSoftbusEvent unfocused failed, ret: %{public}d", ret);
return ret;
@ -775,13 +744,6 @@ int32_t DMSContinueSendMgr::SetStateSendEvent(const uint16_t bundleNameId, const
uint8_t type = state == AAFwk::ContinueState::CONTINUESTATE_INACTIVE ? DMS_UNFOCUSED_TYPE : DMS_FOCUSED_TYPE;
int32_t ret = SendSoftbusEvent(bundleNameId, continueTypeId, type);
bool res = (state == AAFwk::ContinueState::CONTINUESTATE_INACTIVE)
? DmsRadar::GetInstance().ChangeStateUnfocusedSendEventRes("SendSoftbusEvent", ret)
: DmsRadar::GetInstance().ChangeStateFocusedSendEventRes("SendSoftbusEvent", ret);
if (!res) {
HILOGE("%{public}s failed", (state == AAFwk::ContinueState::CONTINUESTATE_INACTIVE) ?
"ChangeStateUnfocusedSendEventRes" : "ChangeStateFocusedSendEventRes");
}
if (ret != ERR_OK) {
HILOGE("SendSoftbusEvent setContinueState failed, ret: %{public}d", ret);
return ret;
@ -795,7 +757,7 @@ void DMSContinueSendMgr::DeleteAliveMissionInfo(const int32_t missionId)
std::lock_guard<std::mutex> aliveMissionMapLock(eventMutex_);
aliveMission_.erase(missionId);
}
int32_t DMSContinueSendMgr::GetAliveMissionInfo(const int32_t missionId, AliveMissionInfo& missionInfo)
{
HILOGD("start, missionId: %{public}d", missionId);

View File

@ -15,7 +15,7 @@
#include "softbus_adapter/softbus_adapter.h"
#include "broadcast.h"
#include "distributed_radar.h"
#include "dfx/distributed_radar.h"
#include "dtbschedmgr_log.h"
#include "softbus_error_code.h"

View File

@ -138,9 +138,9 @@ ohos_unittest("distributedschedsvrtest") {
sources = [
"unittest/continue_scene_session_handler_test.cpp",
"unittest/distributed_radar_test.cpp",
"unittest/dfx/distributed_radar_test.cpp",
"unittest/dfx/distributed_sched_dumper_test.cpp",
"unittest/distributed_sched_adapter_test.cpp",
"unittest/distributed_sched_dumper_test.cpp",
"unittest/distributed_sched_service_first_test.cpp",
"unittest/distributed_sched_service_second_test.cpp",
"unittest/distributed_sched_stub_test.cpp",

View File

@ -19,7 +19,7 @@
#include "gtest/gtest.h"
#include "test_log.h"
#include "distributed_radar.h"
#include "dfx/distributed_radar.h"
namespace OHOS {
namespace DistributedSchedule {

View File

@ -19,7 +19,7 @@
#include "gtest/gtest.h"
#define private public
#include "distributed_sched_dumper.h"
#include "dfx/distributed_sched_dumper.h"
#undef private
namespace OHOS {