From 06d9139e8c056ff29ce3fd1d0952ec1133aae4ad Mon Sep 17 00:00:00 2001 From: Jimmy Shiu Date: Tue, 15 Mar 2022 19:35:45 +0800 Subject: [PATCH] Add postAndWait() trace for calculating frame drawing time postAndWait() shows the duration that UI Thread waits for RenderThread. The trace is helpful for perfetto parser to calculate the actual frame drawing time from CPU resource perspective. Bug: 224653682 Test: capture trace and check App UI Thread. Change-Id: Ic3a11b60abb1fea8cc7b44ce6889ab1e3c2788fd --- libs/hwui/renderthread/DrawFrameTask.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/hwui/renderthread/DrawFrameTask.cpp b/libs/hwui/renderthread/DrawFrameTask.cpp index 8c98c723dbb35..2357dfec72a6e 100644 --- a/libs/hwui/renderthread/DrawFrameTask.cpp +++ b/libs/hwui/renderthread/DrawFrameTask.cpp @@ -133,6 +133,7 @@ int DrawFrameTask::drawFrame() { } void DrawFrameTask::postAndWait() { + ATRACE_CALL(); AutoMutex _lock(mLock); mRenderThread->queue().post([this]() { run(); }); mSignal.wait(mLock);