diff --git a/dmserver/src/display_manager_service.cpp b/dmserver/src/display_manager_service.cpp index e133cf72..54a82468 100644 --- a/dmserver/src/display_manager_service.cpp +++ b/dmserver/src/display_manager_service.cpp @@ -19,10 +19,11 @@ #include #include #include -#include "display_manager_agent_controller.h" -#include "window_manager_hilog.h" +#include "display_manager_agent_controller.h" #include "transaction/rs_interfaces.h" +#include "window_manager_hilog.h" +#include "wm_trace.h" namespace OHOS::Rosen { namespace { @@ -90,6 +91,7 @@ DisplayInfo DisplayManagerService::GetDisplayInfoById(DisplayId displayId) ScreenId DisplayManagerService::CreateVirtualScreen(VirtualScreenOption option) { + WM_SCOPED_TRACE("dms:CreateVirtualScreen(%s)", option.name_.c_str()); ScreenId screenId = abstractScreenController_->CreateVirtualScreen(option); if (screenId == SCREEN_ID_INVALD) { WLOGFE("DisplayManagerService::CreateVirtualScreen: Get virtualScreenId failed"); @@ -105,6 +107,7 @@ DMError DisplayManagerService::DestroyVirtualScreen(ScreenId screenId) WLOGFE("DisplayManagerService: virtualScreenId is invalid"); return DMError::DM_ERROR_INVALID_PARAM; } + WM_SCOPED_TRACE("dms:DestroyVirtualScreen(%" PRIu64")", screenId); std::map>::iterator iter = displayNodeMap_.find(screenId); if (iter == displayNodeMap_.end()) { WLOGFE("DisplayManagerService: displayNode is nullptr"); @@ -117,6 +120,7 @@ DMError DisplayManagerService::DestroyVirtualScreen(ScreenId screenId) std::shared_ptr DisplayManagerService::GetDispalySnapshot(DisplayId displayId) { + WM_SCOPED_TRACE("dms:GetDispalySnapshot(%" PRIu64")", displayId); std::shared_ptr screenSnapshot = abstractDisplayController_->GetScreenSnapshot(displayId); return screenSnapshot; @@ -208,6 +212,7 @@ DMError DisplayManagerService::AddMirror(ScreenId mainScreenId, ScreenId mirrorS if (mainScreenId == SCREEN_ID_INVALID) { return DMError::DM_ERROR_INVALID_PARAM; } + WM_SCOPED_TRACE("dms:AddMirror"); std::shared_ptr displayNode = SingletonContainer::Get().GetDisplayNode(mainScreenId); if (displayNode == nullptr) { diff --git a/snapshot/snapshot_utils.cpp b/snapshot/snapshot_utils.cpp index 92323572..90d1d9f1 100644 --- a/snapshot/snapshot_utils.cpp +++ b/snapshot/snapshot_utils.cpp @@ -18,6 +18,7 @@ #include #include #include +#include "wm_trace.h" using namespace OHOS::Media; using namespace OHOS::Rosen; @@ -36,6 +37,7 @@ void SnapShotUtils::PrintUsage(const std::string &cmdLine) bool SnapShotUtils::CheckFileNameValid(const std::string &fileName) { + WM_SCOPED_TRACE("snapshot:CheckFileNameValid(%s)", fileName.c_str()); if (fileName.length() < strlen(VALID_SNAPSHOT_SUFFIX)) { printf("error: fileName %s invalid, file length too short!\n", fileName.c_str()); return false; @@ -95,6 +97,8 @@ bool SnapShotUtils::WriteToPng(const std::string &fileName, const WriteToPngPara if (!CheckParamValid(param)) { return false; } + + WM_SCOPED_TRACE("snapshot:WriteToPng(%s)", fileName.c_str()); png_structp pngStruct = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); if (pngStruct == nullptr) { @@ -153,6 +157,7 @@ bool SnapShotUtils::WriteToPngWithPixelMap(const std::string &fileName, PixelMap static bool ProcessDisplayId(DisplayId &displayId) { + WM_SCOPED_TRACE("snapshot:ProcessDisplayId(%" PRIu64")", displayId); if (displayId == DISPLAY_ID_INVALD) { displayId = DisplayManager::GetInstance().GetDefaultDisplayId(); } else {