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
This commit is contained in:
Jimmy Shiu
2022-03-15 19:35:45 +08:00
parent 4ab407e5fe
commit 06d9139e8c

View File

@@ -133,6 +133,7 @@ int DrawFrameTask::drawFrame() {
}
void DrawFrameTask::postAndWait() {
ATRACE_CALL();
AutoMutex _lock(mLock);
mRenderThread->queue().post([this]() { run(); });
mSignal.wait(mLock);