diff --git a/rosen/modules/composer/vsync/BUILD.gn b/rosen/modules/composer/vsync/BUILD.gn index 7103adad93..59bd8e4589 100644 --- a/rosen/modules/composer/vsync/BUILD.gn +++ b/rosen/modules/composer/vsync/BUILD.gn @@ -92,6 +92,7 @@ ohos_shared_library("libvsync") { "c_utils:utils", "eventhandler:libeventhandler", "hilog:libhilog", + "hitrace:hitrace_meter", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", diff --git a/rosen/modules/composer/vsync/src/vsync_receiver.cpp b/rosen/modules/composer/vsync/src/vsync_receiver.cpp index 192f16d7cf..4c2473b525 100644 --- a/rosen/modules/composer/vsync/src/vsync_receiver.cpp +++ b/rosen/modules/composer/vsync/src/vsync_receiver.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include "event_handler.h" #include "graphic_common.h" #include "vsync_log.h" @@ -30,6 +31,7 @@ constexpr int32_t INVALID_FD = -1; } void VSyncCallBackListener::OnReadable(int32_t fileDescriptor) { + HitracePerfScoped perfTrace(ScopedDebugTrace::isEnabled(), HITRACE_TAG_GRAPHIC_AGP, "OnReadablePerfCount"); if (fileDescriptor < 0) { return; } diff --git a/utils/scoped_bytrace/export/scoped_bytrace.h b/utils/scoped_bytrace/export/scoped_bytrace.h index 35d2379bd8..ee5b6ff91d 100644 --- a/utils/scoped_bytrace/export/scoped_bytrace.h +++ b/utils/scoped_bytrace/export/scoped_bytrace.h @@ -34,6 +34,12 @@ class ScopedDebugTrace { public: ScopedDebugTrace(const std::string &traceStr); ~ScopedDebugTrace(); + + static bool isEnabled() + { + return debugTraceEnabled_; + } + private: static bool debugTraceEnabled_; };