diff --git a/dm/test/systemtest/BUILD.gn b/dm/test/systemtest/BUILD.gn index 17887aa2..fcd59432 100644 --- a/dm/test/systemtest/BUILD.gn +++ b/dm/test/systemtest/BUILD.gn @@ -83,6 +83,8 @@ ohos_systemtest("dm_screenshot_cmd_test") { ] deps = [ ":dm_systemtest_common" ] + + external_deps = [ "hitrace_native:hitrace_meter" ] } ## SystemTest dm_screenshot_cmd_test }}} diff --git a/dm/test/unittest/BUILD.gn b/dm/test/unittest/BUILD.gn index 0f532fa6..c4cd8f5f 100644 --- a/dm/test/unittest/BUILD.gn +++ b/dm/test/unittest/BUILD.gn @@ -60,6 +60,8 @@ ohos_unittest("dm_snapshot_utils_test") { ] deps = [ ":dm_unittest_common" ] + + external_deps = [ "hitrace_native:hitrace_meter" ] } ## UnitTest dm_snapshot_utils_test }}} diff --git a/dmserver/src/abstract_display_controller.cpp b/dmserver/src/abstract_display_controller.cpp index 5a5fe602..86abf0f6 100644 --- a/dmserver/src/abstract_display_controller.cpp +++ b/dmserver/src/abstract_display_controller.cpp @@ -16,13 +16,13 @@ #include "abstract_display_controller.h" #include +#include #include #include "display_manager_agent_controller.h" #include "display_manager_service.h" #include "screen_group.h" #include "window_manager_hilog.h" -#include "wm_trace.h" namespace OHOS::Rosen { namespace { @@ -357,7 +357,7 @@ void AbstractDisplayController::ProcessDisplayUpdateOrientation(sptr absScreen) { - WM_SCOPED_TRACE("dms:ProcessDisplaySizeChange(%" PRIu64")", absScreen->dmsId_); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "dms:ProcessDisplaySizeChange(%" PRIu64")", absScreen->dmsId_); sptr info = absScreen->GetActiveScreenMode(); if (info == nullptr) { WLOGE("cannot get active screen info."); @@ -531,13 +531,13 @@ void AbstractDisplayController::AddScreenToExpandLocked(sptr abs void AbstractDisplayController::SetFreeze(std::vector displayIds, bool toFreeze) { - WM_SCOPED_TRACE("dms:SetAllFreeze"); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "dms:SetAllFreeze"); DisplayStateChangeType type = toFreeze ? DisplayStateChangeType::FREEZE : DisplayStateChangeType::UNFREEZE; DisplayChangeEvent event = toFreeze ? DisplayChangeEvent::DISPLAY_FREEZED : DisplayChangeEvent::DISPLAY_UNFREEZED; for (DisplayId displayId : displayIds) { sptr abstractDisplay; - WM_SCOPED_TRACE("dms:SetFreeze(%" PRIu64")", displayId); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "dms:SetFreeze(%" PRIu64")", displayId); { WLOGI("setfreeze display %{public}" PRIu64"", displayId); std::lock_guard lock(mutex_); diff --git a/dmserver/src/abstract_screen_controller.cpp b/dmserver/src/abstract_screen_controller.cpp index f7ed37db..2beabd3c 100644 --- a/dmserver/src/abstract_screen_controller.cpp +++ b/dmserver/src/abstract_screen_controller.cpp @@ -16,6 +16,7 @@ #include "abstract_screen_controller.h" #include +#include #include #include #include @@ -26,7 +27,6 @@ #include "event_runner.h" #include "screen_rotation_controller.h" #include "window_manager_hilog.h" -#include "wm_trace.h" namespace OHOS::Rosen { namespace { @@ -756,7 +756,7 @@ bool AbstractScreenController::SetScreenActiveMode(ScreenId screenId, uint32_t m void AbstractScreenController::ProcessScreenModeChanged(ScreenId dmsScreenId) { - WM_SCOPED_TRACE("dms:ProcessScreenModeChanged(%" PRIu64")", dmsScreenId); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "dms:ProcessScreenModeChanged(%" PRIu64")", dmsScreenId); sptr absScreen = nullptr; sptr absScreenCallback = nullptr; { diff --git a/dmserver/src/display_manager_service.cpp b/dmserver/src/display_manager_service.cpp index 21153b61..d3052bd0 100644 --- a/dmserver/src/display_manager_service.cpp +++ b/dmserver/src/display_manager_service.cpp @@ -16,6 +16,7 @@ #include "display_manager_service.h" #include +#include #include #include #include @@ -28,7 +29,6 @@ #include "screen_rotation_controller.h" #include "transaction/rs_interfaces.h" #include "window_manager_hilog.h" -#include "wm_trace.h" namespace OHOS::Rosen { namespace { @@ -175,7 +175,7 @@ sptr DisplayManagerService::GetDisplayInfoByScreen(ScreenId screenI ScreenId DisplayManagerService::CreateVirtualScreen(VirtualScreenOption option, const sptr& displayManagerAgent) { - WM_SCOPED_TRACE("dms:CreateVirtualScreen(%s)", option.name_.c_str()); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "dms:CreateVirtualScreen(%s)", option.name_.c_str()); ScreenId screenId = abstractScreenController_->CreateVirtualScreen(option, displayManagerAgent); CHECK_SCREEN_AND_RETURN(SCREEN_ID_INVALID); accessTokenIdMaps_[screenId] = IPCSkeleton::GetCallingTokenID(); @@ -191,7 +191,7 @@ DMError DisplayManagerService::DestroyVirtualScreen(ScreenId screenId) WLOGFI("DestroyVirtualScreen::ScreenId: %{public}" PRIu64 "", screenId); CHECK_SCREEN_AND_RETURN(DMError::DM_ERROR_INVALID_PARAM); - WM_SCOPED_TRACE("dms:DestroyVirtualScreen(%" PRIu64")", screenId); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "dms:DestroyVirtualScreen(%" PRIu64")", screenId); return abstractScreenController_->DestroyVirtualScreen(screenId); } @@ -204,25 +204,25 @@ DMError DisplayManagerService::SetVirtualScreenSurface(ScreenId screenId, sptrSetOrientation(screenId, orientation, false); } bool DisplayManagerService::SetOrientationFromWindow(ScreenId screenId, Orientation orientation) { - WM_SCOPED_TRACE("dms:SetOrientationFromWindow(%" PRIu64")", screenId); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "dms:SetOrientationFromWindow(%" PRIu64")", screenId); return abstractScreenController_->SetOrientation(screenId, orientation, true); } bool DisplayManagerService::SetRotationFromWindow(ScreenId screenId, Rotation targetRotation) { - WM_SCOPED_TRACE("dms:SetRotationFromWindow(%" PRIu64")", screenId); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "dms:SetRotationFromWindow(%" PRIu64")", screenId); return abstractScreenController_->SetRotation(screenId, targetRotation, true); } std::shared_ptr DisplayManagerService::GetDisplaySnapshot(DisplayId displayId) { - WM_SCOPED_TRACE("dms:GetDisplaySnapshot(%" PRIu64")", displayId); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "dms:GetDisplaySnapshot(%" PRIu64")", displayId); if (Permission::CheckCallingPermission("ohos.permission.CAPTURE_SCREEN") || Permission::IsStartByHdcd()) { return abstractDisplayController_->GetScreenSnapshot(displayId); @@ -307,7 +307,7 @@ bool DisplayManagerService::UnregisterDisplayManagerAgent(const sptrSetShotScreen(mainScreenId, shotScreenIds); - WM_SCOPED_TRACE("dms:MakeMirror"); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "dms:MakeMirror"); if (!allMirrorScreenIds.empty() && !abstractScreenController_->MakeMirror(mainScreenId, allMirrorScreenIds)) { WLOGFE("make mirror failed."); return SCREEN_ID_INVALID; @@ -540,7 +540,7 @@ ScreenId DisplayManagerService::MakeExpand(std::vector expandScreenIds startPoints.erase(startPointIter); } abstractScreenController_->SetShotScreen(defaultScreenId, shotScreenIds); - WM_SCOPED_TRACE("dms:MakeExpand"); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "dms:MakeExpand"); if (!allExpandScreenIds.empty() && !abstractScreenController_->MakeExpand(allExpandScreenIds, startPoints)) { WLOGFE("make expand failed."); return SCREEN_ID_INVALID; @@ -555,13 +555,14 @@ ScreenId DisplayManagerService::MakeExpand(std::vector expandScreenIds bool DisplayManagerService::SetScreenActiveMode(ScreenId screenId, uint32_t modeId) { - WM_SCOPED_TRACE("dms:SetScreenActiveMode(%" PRIu64", %u)", screenId, modeId); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "dms:SetScreenActiveMode(%" PRIu64", %u)", screenId, modeId); return abstractScreenController_->SetScreenActiveMode(screenId, modeId); } bool DisplayManagerService::SetVirtualPixelRatio(ScreenId screenId, float virtualPixelRatio) { - WM_SCOPED_TRACE("dms:SetVirtualPixelRatio(%" PRIu64", %f)", screenId, virtualPixelRatio); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "dms:SetVirtualPixelRatio(%" PRIu64", %f)", screenId, + virtualPixelRatio); return abstractScreenController_->SetVirtualPixelRatio(screenId, virtualPixelRatio); } diff --git a/extension/extension_connection/BUILD.gn b/extension/extension_connection/BUILD.gn index 7a0d527e..90160069 100644 --- a/extension/extension_connection/BUILD.gn +++ b/extension/extension_connection/BUILD.gn @@ -50,6 +50,7 @@ ohos_shared_library("libwindow_extension_client") { external_deps = [ "ability_base:want", "ability_runtime:ability_manager", + "hitrace_native:hitrace_meter", "input:libmmi-client", ] diff --git a/extension/extension_connection/src/window_extension_connection.cpp b/extension/extension_connection/src/window_extension_connection.cpp index 2659baca..faebd31b 100644 --- a/extension/extension_connection/src/window_extension_connection.cpp +++ b/extension/extension_connection/src/window_extension_connection.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include "window_extension_proxy.h" @@ -25,7 +26,6 @@ #include "window_manager_hilog.h" #include "wm_common.h" #include "wm_common_inner.h" -#include "wm_trace.h" namespace OHOS { namespace Rosen { @@ -106,7 +106,7 @@ int WindowExtensionConnection::Impl::ConnectExtension(const AppExecFwk::ElementN { AAFwk::Want want; want.SetElement(element); - WM_SCOPED_ASYNC_TRACE_BEGIN(static_cast(TraceTaskId::CONNECT_EXTENSION), + StartAsyncTraceArgs(HITRACE_TAG_WINDOW_MANAGER, static_cast(TraceTaskId::CONNECT_EXTENSION), "WindowExtension %s-%s", element.GetBundleName().c_str(), element.GetAbilityName().c_str()); want.SetParam(RECT_FORM_KEY_POS_X, rect.posX_); want.SetParam(RECT_FORM_KEY_POS_Y, rect.posY_); @@ -189,7 +189,7 @@ void WindowExtensionConnection::Impl::OnAbilityConnectDone(const AppExecFwk::Ele WLOGFI("GetExtensionWindow"); } WLOGFI("call end"); - WM_SCOPED_ASYNC_END(static_cast(TraceTaskId::CONNECT_EXTENSION), + FinishAsyncTraceArgs(HITRACE_TAG_WINDOW_MANAGER, static_cast(TraceTaskId::CONNECT_EXTENSION), "WindowExtension %s-%s", element.GetBundleName().c_str(), element.GetAbilityName().c_str()); } diff --git a/extension/window_extension/BUILD.gn b/extension/window_extension/BUILD.gn index 9c37063c..90f2a387 100644 --- a/extension/window_extension/BUILD.gn +++ b/extension/window_extension/BUILD.gn @@ -58,6 +58,7 @@ ohos_shared_library("libwindow_extension") { "ability_runtime:runtime", "graphic_graphic_2d:surface", "hilog_native:libhilog", + "hitrace_native:hitrace_meter", "input:libmmi-client", "utils_base:utils", ] diff --git a/extension/window_extension/src/js_window_extension.cpp b/extension/window_extension/src/js_window_extension.cpp index 412fd70e..cc3cde91 100644 --- a/extension/window_extension/src/js_window_extension.cpp +++ b/extension/window_extension/src/js_window_extension.cpp @@ -15,6 +15,7 @@ #include "js_window_extension.h" +#include #include #include #include @@ -27,7 +28,6 @@ #include "window_manager_hilog.h" #include "wm_common.h" #include "wm_common_inner.h" -#include "wm_trace.h" namespace OHOS { namespace Rosen { @@ -61,7 +61,7 @@ void JsWindowExtension::Init(const std::shared_ptr& handler, const sptr& token) { - WM_SCOPED_TRACE("WindowExtension Init"); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "WindowExtension Init"); WindowExtension::Init(record, application, handler, token); std::string srcPath; GetSrcPath(srcPath); @@ -143,7 +143,7 @@ void JsWindowExtension::GetSrcPath(std::string& srcPath) const sptr JsWindowExtension::OnConnect(const AAFwk::Want& want) { - WM_SCOPED_TRACE("WindowExtension Init %s-%s", + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "WindowExtension OnConnect %s-%s", want.GetElement().GetAbilityName().c_str(), want.GetElement().GetAbilityName().c_str()); WLOGFI("called."); Extension::OnConnect(want); @@ -194,7 +194,7 @@ void JsWindowExtension::OnDisconnect(const AAFwk::Want& want) void JsWindowExtension::OnStart(const AAFwk::Want& want) { - WM_SCOPED_TRACE("WindowExtension OnStart %s-%s", + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "WindowExtension OnStart %s-%s", want.GetElement().GetAbilityName().c_str(), want.GetElement().GetAbilityName().c_str()); Extension::OnStart(want); diff --git a/interfaces/kits/napi/screen_recorder/BUILD.gn b/interfaces/kits/napi/screen_recorder/BUILD.gn index 73f262fb..be89b195 100644 --- a/interfaces/kits/napi/screen_recorder/BUILD.gn +++ b/interfaces/kits/napi/screen_recorder/BUILD.gn @@ -52,6 +52,7 @@ ohos_shared_library("screenrecorder_napi") { "ability_base:want", "ability_runtime:ability_manager", "ability_runtime:runtime", + "hitrace_native:hitrace_meter", "hiviewdfx_hilog_native:libhilog", "napi:ace_napi", ] diff --git a/snapshot/BUILD.gn b/snapshot/BUILD.gn index 3c5f8073..a5218dd2 100644 --- a/snapshot/BUILD.gn +++ b/snapshot/BUILD.gn @@ -35,6 +35,7 @@ ohos_executable("snapshot_display") { ] external_deps = [ + "hitrace_native:hitrace_meter", "multimedia_image_standard:image_native", "utils_base:utils", ] @@ -61,6 +62,7 @@ ohos_executable("snapshot_virtual_screen") { ] external_deps = [ + "hitrace_native:hitrace_meter", "multimedia_image_standard:image_native", "utils_base:utils", ] diff --git a/snapshot/snapshot_utils.cpp b/snapshot/snapshot_utils.cpp index d4d2ba51..db085cae 100644 --- a/snapshot/snapshot_utils.cpp +++ b/snapshot/snapshot_utils.cpp @@ -16,11 +16,11 @@ #include "snapshot_utils.h" #include +#include #include #include #include #include -#include "wm_trace.h" using namespace OHOS::Media; using namespace OHOS::Rosen; @@ -142,7 +142,7 @@ bool SnapShotUtils::WriteToPng(const std::string &fileName, const WriteToPngPara return false; } - WM_SCOPED_TRACE("snapshot:WriteToPng(%s)", fileName.c_str()); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "snapshot:WriteToPng(%s)", fileName.c_str()); png_structp pngStruct = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); if (pngStruct == nullptr) { diff --git a/utils/BUILD.gn b/utils/BUILD.gn index 64b606ff..657637b7 100644 --- a/utils/BUILD.gn +++ b/utils/BUILD.gn @@ -39,7 +39,6 @@ ohos_shared_library("libwmutil") { "src/surface_reader_handler_impl.cpp", "src/window_property.cpp", "src/window_transition_info.cpp", - "src/wm_trace.cpp", ] configs = [ ":libwmutil_private_config" ] @@ -57,7 +56,6 @@ ohos_shared_library("libwmutil") { "access_token:libaccesstoken_sdk", "graphic_graphic_2d:surface", "hilog_native:libhilog", - "hitrace_native:hitrace_meter", "ipc:ipc_core", "multimedia_image_standard:image_native", "safwk:system_ability_fwk", diff --git a/utils/include/wm_trace.h b/utils/include/wm_trace.h deleted file mode 100644 index 0d7d0507..00000000 --- a/utils/include/wm_trace.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2021-2022 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_WM_INCLUDE_WM_TRACE_H -#define OHOS_WM_INCLUDE_WM_TRACE_H - -#include -#include -#include - -#include "noncopyable.h" - -#define WM_SCOPED_TRACE(fmt, ...) WmScopedTrace wmScopedTrace(fmt, ##__VA_ARGS__) -#ifdef WM_DEBUG -#define WM_DEBUG_SCOPED_TRACE(fmt, ...) WmScopedTrace wmScopedTrace(fmt, ##__VA_ARGS__) -#else -#define WM_DEBUG_SCOPED_TRACE(fmt, ...) -#endif - -#define WM_FUNCTION_TRACE() WM_SCOPED_TRACE(__func__) -#define WM_SCOPED_TRACE_BEGIN(fmt, ...) WmTraceBeginWithArgs(fmt, ##__VA_ARGS__) -#define WM_SCOPED_TRACE_END() WmTraceEnd() - -#define WM_SCOPED_ASYNC_TRACE_BEGIN(taskId, fmt, ...) WmAsyncTraceWithArgs(true, taskId, fmt, ##__VA_ARGS__) -#define WM_SCOPED_ASYNC_END(taskId, fmt, ...) WmAsyncTraceWithArgs(false, taskId, fmt, ##__VA_ARGS__) - -namespace OHOS { -namespace Rosen { -bool WmTraceEnabled(); -void WmTraceBegin(const char* name); -bool WmTraceBeginWithArgs(const char* format, ...) __attribute__((__format__(printf, 1, 2))); -bool WmTraceBeginWithArgv(const char* format, va_list args); -void WmTraceEnd(); -void WmAsyncTraceBegin(int32_t taskId, const char* name); -void WmAsyncTraceEnd(int32_t taskId, const char* name); -void WmAsyncTraceWithArgs(bool isBegin, int32_t taskId, - const char* format, ...) __attribute__((__format__(printf, 3, 4))); -void WmAsyncTraceWithArgv(bool isBegin, int32_t taskId, const char* format, va_list args); - -class WmScopedTrace final { -public: - explicit WmScopedTrace(const char* format, ...) __attribute__((__format__(printf, 2, 3))); - ~WmScopedTrace(); - - WM_DISALLOW_COPY_AND_MOVE(WmScopedTrace); - -private: - bool traceEnabled_ { false }; -}; -} // namespace OHOS -} -#endif // OHOS_WM_INCLUDE_WM_TRACE_H \ No newline at end of file diff --git a/utils/src/wm_trace.cpp b/utils/src/wm_trace.cpp deleted file mode 100644 index 2858f5bd..00000000 --- a/utils/src/wm_trace.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2021-2022 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wm_trace.h" - -#include - -#ifndef WINDOWS_PLATFORM -#include -#endif - -namespace OHOS { -namespace Rosen { -namespace { -const size_t MAX_STRING_SIZE = 128; -} - -bool WmTraceEnabled() -{ - return true; -} - -void WmTraceBegin(const char* name) -{ - if (name == nullptr) { - return; - } - std::string nameStr(name); - StartTrace(HITRACE_TAG_WINDOW_MANAGER, nameStr); -} - -void WmTraceEnd() -{ - if (WmTraceEnabled()) { - FinishTrace(HITRACE_TAG_WINDOW_MANAGER); - } -} - -void WmAsyncTraceBegin(int32_t taskId, const char* name) -{ - if (name == nullptr) { - return; - } - std::string nameStr(name); - StartAsyncTrace(HITRACE_TAG_WINDOW_MANAGER, nameStr, taskId); -} - -void WmAsyncTraceEnd(int32_t taskId, const char* name) -{ - if (name == nullptr) { - return; - } - std::string nameStr(name); - FinishAsyncTrace(HITRACE_TAG_WINDOW_MANAGER, nameStr, taskId); -} - -void WmAsyncTraceWithArgs(bool isBegin, int32_t taskId, const char* format, ...) -{ - if (WmTraceEnabled()) { - va_list args; - va_start(args, format); - WmAsyncTraceWithArgv(isBegin, taskId, format, args); - va_end(args); - } -} - -void WmAsyncTraceWithArgv(bool isBegin, int32_t taskId, const char* format, va_list args) -{ - char name[MAX_STRING_SIZE] = { 0 }; - if (vsnprintf_s(name, sizeof(name), sizeof(name) - 1, format, args) < 0) { - return; - } - if (isBegin) { - WmAsyncTraceBegin(taskId, name); - } else { - WmAsyncTraceEnd(taskId, name); - } -} - -bool WmTraceBeginWithArgv(const char* format, va_list args) -{ - char name[MAX_STRING_SIZE] = { 0 }; - if (vsnprintf_s(name, sizeof(name), sizeof(name) - 1, format, args) < 0) { - return false; - } - WmTraceBegin(name); - return true; -} - -bool WmTraceBeginWithArgs(const char* format, ...) -{ - if (WmTraceEnabled()) { - va_list args; - va_start(args, format); - bool retVal = WmTraceBeginWithArgv(format, args); - va_end(args); - return retVal; - } - return false; -} - -WmScopedTrace::WmScopedTrace(const char* format, ...) : traceEnabled_(WmTraceEnabled()) -{ - if (traceEnabled_) { - va_list args; - va_start(args, format); - traceEnabled_ = WmTraceBeginWithArgv(format, args); - va_end(args); - } -} - -WmScopedTrace::~WmScopedTrace() -{ - if (traceEnabled_) { - WmTraceEnd(); - } -} -} // namespace Rosen -} // namespace OHOS diff --git a/wmserver/src/avoid_area_controller.cpp b/wmserver/src/avoid_area_controller.cpp index 40a8869f..36558263 100644 --- a/wmserver/src/avoid_area_controller.cpp +++ b/wmserver/src/avoid_area_controller.cpp @@ -14,10 +14,12 @@ */ #include "avoid_area_controller.h" + +#include + #include "display_manager_config.h" #include "window_helper.h" #include "window_manager_hilog.h" -#include "wm_trace.h" namespace OHOS { namespace Rosen { @@ -70,7 +72,7 @@ void AvoidAreaController::AddOrRemoveOverlayWindowIfNeed(const sptr& WLOGFE("IsOverlayWindow Failed."); return; } - WM_FUNCTION_TRACE(); + HITRACE_METER(HITRACE_TAG_WINDOW_MANAGER); uint32_t overlayId = overlayNode->GetWindowId(); bool isRecorded = (overlayWindowMap_.find(overlayId) != overlayWindowMap_.end()); @@ -150,7 +152,7 @@ void AvoidAreaController::AddOrRemoveKeyboard(const sptr& keyboardNo void AvoidAreaController::UpdateOverlayWindowIfNeed(const sptr& node, const std::function)>& checkFunc) { - WM_FUNCTION_TRACE(); + HITRACE_METER(HITRACE_TAG_WINDOW_MANAGER); if (WindowHelper::IsOverlayWindow(node->GetWindowType())) { AvoidAreaType type = WindowHelper::IsSystemBarWindow(node->GetWindowType()) ? AvoidAreaType::TYPE_SYSTEM : AvoidAreaType::TYPE_KEYBOARD; diff --git a/wmserver/src/remote_animation.cpp b/wmserver/src/remote_animation.cpp index 47021891..33427ef6 100644 --- a/wmserver/src/remote_animation.cpp +++ b/wmserver/src/remote_animation.cpp @@ -17,11 +17,12 @@ #include #include +#include #include #include "minimize_app.h" #include "window_helper.h" #include "window_manager_hilog.h" -#include "wm_trace.h" + namespace OHOS { namespace Rosen { namespace { @@ -120,7 +121,7 @@ WMError RemoteAnimation::NotifyAnimationTransition(sptr sr []() { WLOGFI("RSWindowAnimation: on finish transition with minimizeAll!"); MinimizeApp::ExecuteMinimizeAll(); - WM_SCOPED_ASYNC_END(static_cast(TraceTaskId::REMOTE_ANIMATION), + FinishAsyncTraceArgs(HITRACE_TAG_WINDOW_MANAGER, static_cast(TraceTaskId::REMOTE_ANIMATION), "wms:async:ShowRemoteAnimation"); } ); @@ -181,7 +182,7 @@ WMError RemoteAnimation::NotifyAnimationMinimize(sptr srcI if (weakNode != nullptr && weakNode->abilityToken_ != nullptr) { WLOGFI("minimize windowId: %{public}u, name:%{public}s", weakNode->GetWindowId(), weakNode->GetWindowName().c_str()); - WM_SCOPED_ASYNC_END(static_cast(TraceTaskId::REMOTE_ANIMATION), + FinishAsyncTraceArgs(HITRACE_TAG_WINDOW_MANAGER, static_cast(TraceTaskId::REMOTE_ANIMATION), "wms:async:ShowRemoteAnimation"); AAFwk::AbilityManagerClient::GetInstance()->MinimizeAbility(weakNode->abilityToken_, true); } @@ -218,7 +219,8 @@ WMError RemoteAnimation::NotifyAnimationClose(sptr srcInfo weakNode->GetWindowId(), weakNode->GetWindowName().c_str()); AAFwk::AbilityManagerClient::GetInstance()->TerminateAbility(weakNode->abilityToken_, -1); } - WM_SCOPED_ASYNC_END(static_cast(TraceTaskId::REMOTE_ANIMATION), "wms:async:ShowRemoteAnimation"); + FinishAsyncTraceArgs(HITRACE_TAG_WINDOW_MANAGER, static_cast(TraceTaskId::REMOTE_ANIMATION), + "wms:async:ShowRemoteAnimation"); } }; sptr finishedCallback = new(std::nothrow) RSWindowAnimationFinishedCallback( @@ -252,7 +254,8 @@ WMError RemoteAnimation::NotifyAnimationByHome() auto func = []() { WLOGFI("NotifyAnimationByHome in animation callback"); MinimizeApp::ExecuteMinimizeAll(); - WM_SCOPED_ASYNC_END(static_cast(TraceTaskId::REMOTE_ANIMATION), "wms:async:ShowRemoteAnimation"); + FinishAsyncTraceArgs(HITRACE_TAG_WINDOW_MANAGER, static_cast(TraceTaskId::REMOTE_ANIMATION), + "wms:async:ShowRemoteAnimation"); }; sptr finishedCallback = new(std::nothrow) RSWindowAnimationFinishedCallback( func); diff --git a/wmserver/src/starting_window.cpp b/wmserver/src/starting_window.cpp index 97e96d00..718eaf16 100644 --- a/wmserver/src/starting_window.cpp +++ b/wmserver/src/starting_window.cpp @@ -16,11 +16,12 @@ #include "starting_window.h" #include #include +#include #include #include "remote_animation.h" #include "window_helper.h" #include "window_manager_hilog.h" -#include "wm_trace.h" + namespace OHOS { namespace Rosen { namespace { @@ -107,7 +108,7 @@ void StartingWindow::DrawStartingWindow(sptr& node, sptr pixelMap, uint32_t bkgColor, bool isColdStart) { // using snapshot to support hot start since node destroy when hide - WM_SCOPED_TRACE("wms:DrawStartingWindow(%u)", node->GetWindowId()); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "wms:DrawStartingWindow(%u)", node->GetWindowId()); if (!isColdStart) { return; } @@ -143,7 +144,8 @@ void StartingWindow::HandleClientWindowCreate(sptr& node, sptr weak = node; auto firstFrameCompleteCallback = [weak]() { std::lock_guard lock(mutex_); - WM_SCOPED_ASYNC_END(static_cast(TraceTaskId::STARTING_WINDOW), "wms:async:ShowStartingWindow"); + FinishAsyncTraceArgs(HITRACE_TAG_WINDOW_MANAGER, static_cast(TraceTaskId::STARTING_WINDOW), + "wms:async:ShowStartingWindow"); auto weakNode = weak.promote(); if (weakNode == nullptr || weakNode->leashWinSurfaceNode_ == nullptr) { WLOGFE("windowNode or leashWinSurfaceNode_ is nullptr"); diff --git a/wmserver/src/window_controller.cpp b/wmserver/src/window_controller.cpp index 12379fe7..2ad37893 100644 --- a/wmserver/src/window_controller.cpp +++ b/wmserver/src/window_controller.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -29,7 +30,6 @@ #include "window_manager_hilog.h" #include "window_helper.h" #include "wm_common.h" -#include "wm_trace.h" namespace OHOS { namespace Rosen { @@ -50,7 +50,8 @@ void WindowController::StartingWindow(sptr info, sptr(TraceTaskId::STARTING_WINDOW), "wms:async:ShowStartingWindow"); + StartAsyncTraceArgs(HITRACE_TAG_WINDOW_MANAGER, static_cast(TraceTaskId::STARTING_WINDOW), + "wms:async:ShowStartingWindow"); auto node = windowRoot_->FindWindowNodeWithToken(info->GetAbilityToken()); auto layoutMode = windowRoot_->GetCurrentLayoutMode(info->GetDisplayId()); if (node == nullptr) { @@ -101,8 +102,9 @@ void WindowController::CancelStartingWindow(sptr abilityToken) WLOGFE("CancelStartingWindow failed because client window has shown id:%{public}u", node->GetWindowId()); return; } - WM_SCOPED_TRACE("wms:CancelStartingWindow(%u)", node->GetWindowId()); - WM_SCOPED_ASYNC_END(static_cast(TraceTaskId::STARTING_WINDOW), "wms:async:ShowStartingWindow"); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "wms:CancelStartingWindow(%u)", node->GetWindowId()); + FinishAsyncTraceArgs(HITRACE_TAG_WINDOW_MANAGER, static_cast(TraceTaskId::STARTING_WINDOW), + "wms:async:ShowStartingWindow"); WLOGFI("CancelStartingWindow with id:%{public}u!", node->GetWindowId()); node->isAppCrash_ = true; WMError res = windowRoot_->DestroyWindow(node->GetWindowId(), false); @@ -124,7 +126,7 @@ WMError WindowController::NotifyWindowTransition(sptr& src if (!RemoteAnimation::CheckTransition(srcInfo, srcNode, dstInfo, dstNode)) { return WMError::WM_ERROR_NO_REMOTE_ANIMATION; } - WM_SCOPED_ASYNC_TRACE_BEGIN(static_cast(TraceTaskId::REMOTE_ANIMATION), + StartAsyncTraceArgs(HITRACE_TAG_WINDOW_MANAGER, static_cast(TraceTaskId::REMOTE_ANIMATION), "wms:async:ShowRemoteAnimation"); auto transitionEvent = RemoteAnimation::GetTransitionEvent(srcInfo, dstInfo, srcNode, dstNode); switch (transitionEvent) { @@ -369,7 +371,7 @@ WMError WindowController::RequestFocus(uint32_t windowId) WMError WindowController::SetWindowMode(uint32_t windowId, WindowMode dstMode) { - WM_FUNCTION_TRACE(); + HITRACE_METER(HITRACE_TAG_WINDOW_MANAGER); auto node = windowRoot_->GetWindowNode(windowId); if (node == nullptr) { WLOGFE("could not find window"); diff --git a/wmserver/src/window_layout_policy.cpp b/wmserver/src/window_layout_policy.cpp index 07fbc7e5..7bd0f8a4 100644 --- a/wmserver/src/window_layout_policy.cpp +++ b/wmserver/src/window_layout_policy.cpp @@ -18,7 +18,6 @@ #include "window_helper.h" #include "window_manager_hilog.h" #include "wm_common_inner.h" -#include "wm_trace.h" namespace OHOS { namespace Rosen { diff --git a/wmserver/src/window_layout_policy_cascade.cpp b/wmserver/src/window_layout_policy_cascade.cpp index f81450c2..5c8c6c6f 100644 --- a/wmserver/src/window_layout_policy_cascade.cpp +++ b/wmserver/src/window_layout_policy_cascade.cpp @@ -15,11 +15,12 @@ #include "window_layout_policy_cascade.h" +#include + #include "minimize_app.h" #include "window_helper.h" #include "window_inner_manager.h" #include "window_manager_hilog.h" -#include "wm_trace.h" namespace OHOS { namespace Rosen { @@ -121,7 +122,7 @@ void WindowLayoutPolicyCascade::LayoutWindowTree(DisplayId displayId) void WindowLayoutPolicyCascade::RemoveWindowNode(const sptr& node) { - WM_FUNCTION_TRACE(); + HITRACE_METER(HITRACE_TAG_WINDOW_MANAGER); auto type = node->GetWindowType(); // affect other windows, trigger off global layout if (avoidTypes_.find(type) != avoidTypes_.end()) { @@ -143,7 +144,7 @@ std::vector WindowLayoutPolicyCascade::GetExitSplitPoints(DisplayId dis void WindowLayoutPolicyCascade::UpdateWindowNode(const sptr& node, bool isAddWindow) { - WM_FUNCTION_TRACE(); + HITRACE_METER(HITRACE_TAG_WINDOW_MANAGER); auto type = node->GetWindowType(); const DisplayId& displayId = node->GetDisplayId(); // affect other windows, trigger off global layout @@ -174,7 +175,7 @@ void WindowLayoutPolicyCascade::UpdateWindowNode(const sptr& node, b void WindowLayoutPolicyCascade::AddWindowNode(const sptr& node) { - WM_FUNCTION_TRACE(); + HITRACE_METER(HITRACE_TAG_WINDOW_MANAGER); auto property = node->GetWindowProperty(); if (property == nullptr) { WLOGFE("window property is nullptr."); diff --git a/wmserver/src/window_layout_policy_tile.cpp b/wmserver/src/window_layout_policy_tile.cpp index 438099bf..5a6f4c34 100644 --- a/wmserver/src/window_layout_policy_tile.cpp +++ b/wmserver/src/window_layout_policy_tile.cpp @@ -15,11 +15,12 @@ #include "window_layout_policy_tile.h" #include +#include + #include "minimize_app.h" #include "window_helper.h" #include "window_inner_manager.h" #include "window_manager_hilog.h" -#include "wm_trace.h" namespace OHOS { namespace Rosen { @@ -117,7 +118,7 @@ void WindowLayoutPolicyTile::InitTileWindowRects(DisplayId displayId) void WindowLayoutPolicyTile::AddWindowNode(const sptr& node) { - WM_FUNCTION_TRACE(); + HITRACE_METER(HITRACE_TAG_WINDOW_MANAGER); // update window size limits when add window UpdateWindowSizeLimits(node); @@ -134,7 +135,7 @@ void WindowLayoutPolicyTile::AddWindowNode(const sptr& node) void WindowLayoutPolicyTile::UpdateWindowNode(const sptr& node, bool isAddWindow) { - WM_FUNCTION_TRACE(); + HITRACE_METER(HITRACE_TAG_WINDOW_MANAGER); WindowLayoutPolicy::UpdateWindowNode(node); if (avoidTypes_.find(node->GetWindowType()) != avoidTypes_.end()) { DisplayId displayId = node->GetDisplayId(); @@ -146,7 +147,7 @@ void WindowLayoutPolicyTile::UpdateWindowNode(const sptr& node, bool void WindowLayoutPolicyTile::RemoveWindowNode(const sptr& node) { - WM_FUNCTION_TRACE(); + HITRACE_METER(HITRACE_TAG_WINDOW_MANAGER); WLOGFI("RemoveWindowNode %{public}u in tile", node->GetWindowId()); auto type = node->GetWindowType(); auto displayId = node->GetDisplayId(); diff --git a/wmserver/src/window_manager_service.cpp b/wmserver/src/window_manager_service.cpp index 9ca7014d..4416df19 100644 --- a/wmserver/src/window_manager_service.cpp +++ b/wmserver/src/window_manager_service.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -36,7 +37,7 @@ #include "window_manager_config.h" #include "window_manager_hilog.h" #include "wm_common.h" -#include "wm_trace.h" + namespace OHOS { namespace Rosen { namespace { @@ -375,7 +376,7 @@ WMError WindowManagerService::CreateWindow(sptr& window, sptrScheduleTask([this, pid, uid, &window, &property, &surfaceNode, &windowId, &token]() { - WM_SCOPED_TRACE("wms:CreateWindow(%u)", windowId); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "wms:CreateWindow(%u)", windowId); return windowController_->CreateWindow(window, property, surfaceNode, windowId, token, pid, uid); }).get(); accessTokenIdMaps_[windowId] = IPCSkeleton::GetCallingTokenID(); @@ -400,7 +401,7 @@ WMError WindowManagerService::HandleAddWindow(sptr& property) WLOGFI("[WMS] Add: %{public}5d %{public}4d %{public}4d %{public}4d [%{public}4d %{public}4d " \ "%{public}4d %{public}4d]", windowId, property->GetWindowType(), property->GetWindowMode(), property->GetWindowFlags(), rect.posX_, rect.posY_, rect.width_, rect.height_); - WM_SCOPED_TRACE("wms:AddWindow(%u)", windowId); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "wms:AddWindow(%u)", windowId); WMError res = windowController_->AddWindowNode(property); if (property->GetWindowType() == WindowType::WINDOW_TYPE_DRAGGING_EFFECT) { dragController_->StartDrag(windowId); @@ -412,7 +413,7 @@ WMError WindowManagerService::RemoveWindow(uint32_t windowId) { return wmsTaskLooper_->ScheduleTask([this, windowId]() { WLOGFI("[WMS] Remove: %{public}u", windowId); - WM_SCOPED_TRACE("wms:RemoveWindow(%u)", windowId); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "wms:RemoveWindow(%u)", windowId); return windowController_->RemoveWindowNode(windowId); }).get(); } @@ -426,7 +427,7 @@ WMError WindowManagerService::DestroyWindow(uint32_t windowId, bool onlySelf) accessTokenIdMaps_.erase(windowId); return wmsTaskLooper_->ScheduleTask([this, windowId, onlySelf]() { WLOGFI("[WMS] Destroy: %{public}u", windowId); - WM_SCOPED_TRACE("wms:DestroyWindow(%u)", windowId); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "wms:DestroyWindow(%u)", windowId); auto node = windowRoot_->GetWindowNode(windowId); if (node != nullptr && node->GetWindowType() == WindowType::WINDOW_TYPE_DRAGGING_EFFECT) { dragController_->FinishDrag(windowId); @@ -523,7 +524,7 @@ void WindowManagerService::OnWindowEvent(Event event, const sptr& void WindowManagerService::NotifyDisplayStateChange(DisplayId defaultDisplayId, sptr displayInfo, const std::map>& displayInfoMap, DisplayStateChangeType type) { - WM_SCOPED_TRACE("wms:NotifyDisplayStateChange(%u)", type); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "wms:NotifyDisplayStateChange(%u)", type); DisplayId displayId = (displayInfo == nullptr) ? DISPLAY_ID_INVALID : displayInfo->GetDisplayId(); if (type == DisplayStateChangeType::FREEZE) { freezeDisplayController_->FreezeDisplay(displayId); @@ -564,7 +565,7 @@ void WindowManagerService::ProcessPointUp(uint32_t windowId) void WindowManagerService::MinimizeAllAppWindows(DisplayId displayId) { return wmsTaskLooper_->PostTask([this, displayId]() { - WM_SCOPED_TRACE("wms:MinimizeAllAppWindows(%" PRIu64")", displayId); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "wms:MinimizeAllAppWindows(%" PRIu64")", displayId); WLOGFI("displayId %{public}" PRIu64"", displayId); windowController_->MinimizeAllAppWindows(displayId); }); @@ -573,7 +574,7 @@ void WindowManagerService::MinimizeAllAppWindows(DisplayId displayId) WMError WindowManagerService::ToggleShownStateForAllAppWindows() { wmsTaskLooper_->PostTask([this]() { - WM_SCOPED_TRACE("wms:ToggleShownStateForAllAppWindows"); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "wms:ToggleShownStateForAllAppWindows"); return windowController_->ToggleShownStateForAllAppWindows(); }); return WMError::WM_OK; @@ -590,7 +591,7 @@ WMError WindowManagerService::SetWindowLayoutMode(WindowLayoutMode mode) { return wmsTaskLooper_->ScheduleTask([this, mode]() { WLOGFI("layoutMode: %{public}u", mode); - WM_SCOPED_TRACE("wms:SetWindowLayoutMode"); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "wms:SetWindowLayoutMode"); return windowController_->SetWindowLayoutMode(mode); }).get(); } @@ -608,7 +609,7 @@ WMError WindowManagerService::UpdateProperty(sptr& windowPropert return WMError::WM_OK; } return wmsTaskLooper_->ScheduleTask([this, &windowProperty, action]() { - WM_SCOPED_TRACE("wms:UpdateProperty"); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "wms:UpdateProperty"); WMError res = windowController_->UpdateProperty(windowProperty, action); if (action == PropertyChangeAction::ACTION_UPDATE_RECT && res == WMError::WM_OK && windowProperty->GetWindowSizeChangeReason() == WindowSizeChangeReason::MOVE) { diff --git a/wmserver/src/window_node_container.cpp b/wmserver/src/window_node_container.cpp index 694e433d..b85282dd 100644 --- a/wmserver/src/window_node_container.cpp +++ b/wmserver/src/window_node_container.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "common_event_manager.h" @@ -32,7 +33,6 @@ #include "window_manager_hilog.h" #include "wm_common.h" #include "wm_common_inner.h" -#include "wm_trace.h" namespace OHOS { namespace Rosen { @@ -361,7 +361,7 @@ void WindowNodeContainer::UpdateSizeChangeReason(sptr& node, WindowS void WindowNodeContainer::UpdateWindowTree(sptr& node) { - WM_FUNCTION_TRACE(); + HITRACE_METER(HITRACE_TAG_WINDOW_MANAGER); node->priority_ = zorderPolicy_->GetWindowPriority(node->GetWindowType()); RaiseInputMethodWindowPriorityIfNeeded(node); RaiseShowWhenLockedWindowIfNeeded(node); @@ -386,7 +386,7 @@ void WindowNodeContainer::UpdateWindowTree(sptr& node) bool WindowNodeContainer::UpdateRSTree(sptr& node, DisplayId displayId, bool isAdd, bool animationPlayed) { - WM_FUNCTION_TRACE(); + HITRACE_METER(HITRACE_TAG_WINDOW_MANAGER); if (node->GetWindowProperty()->GetCustomAnimation()) { WLOGFI("not need to update RsTree since SystemWindowAnimation is playing"); return false; @@ -424,9 +424,9 @@ bool WindowNodeContainer::UpdateRSTree(sptr& node, DisplayId display // default transition curve: EASE OUT static const Rosen::RSAnimationTimingCurve curve = Rosen::RSAnimationTimingCurve::EASE_OUT; // add window with transition animation - WM_SCOPED_TRACE_BEGIN("Animate(%u)", node->GetWindowId()); + StartTraceArgs(HITRACE_TAG_WINDOW_MANAGER, "Animate(%u)", node->GetWindowId()); RSNode::Animate(timingProtocol, curve, updateRSTreeFunc); - WM_SCOPED_TRACE_END(); + FinishTrace(HITRACE_TAG_WINDOW_MANAGER); } else { // add or remove window without animation WLOGFI("add or remove window without animation"); @@ -686,7 +686,8 @@ void WindowNodeContainer::HandleKeepScreenOn(const sptr& node, bool return; } WLOGFI("handle keep screen on: [%{public}s, %{public}d]", node->GetWindowName().c_str(), requireLock); - WM_SCOPED_TRACE("container:HandleKeepScreenOn(%s, %d)", node->GetWindowName().c_str(), requireLock); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "container:HandleKeepScreenOn(%s, %d)", + node->GetWindowName().c_str(), requireLock); ErrCode res; // reset ipc identity std::string identity = IPCSkeleton::ResetCallingIdentity(); @@ -790,7 +791,7 @@ void WindowNodeContainer::ProcessWindowAvoidAreaChangeWhenDisplayChange() const void WindowNodeContainer::NotifyIfSystemBarTintChanged(DisplayId displayId) const { - WM_FUNCTION_TRACE(); + HITRACE_METER(HITRACE_TAG_WINDOW_MANAGER); auto expectSystemBarProp = GetExpectImmersiveProperty(); SystemBarRegionTints tints; SysBarTintMap& sysBarTintMap = displayGroupController_->sysBarTintMaps_[displayId]; @@ -810,7 +811,7 @@ void WindowNodeContainer::NotifyIfSystemBarTintChanged(DisplayId displayId) cons void WindowNodeContainer::NotifyIfSystemBarRegionChanged(DisplayId displayId) const { - WM_FUNCTION_TRACE(); + HITRACE_METER(HITRACE_TAG_WINDOW_MANAGER); SystemBarRegionTints tints; SysBarTintMap& sysBarTintMap = displayGroupController_->sysBarTintMaps_[displayId]; SysBarNodeMap& sysBarNodeMap = displayGroupController_->sysBarNodeMaps_[displayId]; @@ -899,7 +900,7 @@ void WindowNodeContainer::NotifySystemBarTints(std::vector displayIdV void WindowNodeContainer::NotifyDockWindowStateChanged(sptr& node, bool isEnable) { - WM_FUNCTION_TRACE(); + HITRACE_METER(HITRACE_TAG_WINDOW_MANAGER); WLOGFI("[Immersive] begin isEnable: %{public}d", isEnable); if (isEnable) { for (auto& windowNode : appWindowNode_->children_) { diff --git a/wmserver/src/window_pair.cpp b/wmserver/src/window_pair.cpp index fc1f1962..4aafd31b 100644 --- a/wmserver/src/window_pair.cpp +++ b/wmserver/src/window_pair.cpp @@ -20,7 +20,6 @@ #include "minimize_app.h" #include "window_manager_hilog.h" #include "window_helper.h" -#include "wm_trace.h" #include "window_inner_manager.h" diff --git a/wmserver/src/window_root.cpp b/wmserver/src/window_root.cpp index 257a183f..66551850 100644 --- a/wmserver/src/window_root.cpp +++ b/wmserver/src/window_root.cpp @@ -18,13 +18,13 @@ #include #include #include +#include #include #include "display_manager_service_inner.h" #include "window_helper.h" #include "window_manager_hilog.h" #include "window_manager_service.h" -#include "wm_trace.h" #include "window_manager_agent_controller.h" namespace OHOS { @@ -216,7 +216,7 @@ WMError WindowRoot::SaveWindow(const sptr& node) WMError WindowRoot::MinimizeStructuredAppWindowsExceptSelf(sptr& node) { - WM_SCOPED_TRACE("root:MinimizeStructuredAppWindowsExceptSelf"); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "root:MinimizeStructuredAppWindowsExceptSelf"); auto container = GetOrCreateWindowNodeContainer(node->GetDisplayId()); if (container == nullptr) { WLOGFE("MinimizeAbility failed, window container could not be found"); diff --git a/wmserver/src/window_snapshot/snapshot_controller.cpp b/wmserver/src/window_snapshot/snapshot_controller.cpp index 82977585..c11638be 100644 --- a/wmserver/src/window_snapshot/snapshot_controller.cpp +++ b/wmserver/src/window_snapshot/snapshot_controller.cpp @@ -14,9 +14,11 @@ */ #include "snapshot_controller.h" + +#include + #include "window_manager_hilog.h" #include "wm_common.h" -#include "wm_trace.h" namespace OHOS { namespace Rosen { @@ -46,7 +48,7 @@ WMError SnapshotController::TakeSnapshot(const std::shared_ptr& s int32_t SnapshotController::GetSnapshot(const sptr &token, Snapshot& snapshot) { - WM_SCOPED_TRACE("wms:GetSnapshot"); + HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "wms:GetSnapshot"); if (token == nullptr) { WLOGFE("Get ailityToken failed!"); return static_cast(WMError::WM_ERROR_NULLPTR);