From e10971d903560488b6c7df5dc4935d631742e870 Mon Sep 17 00:00:00 2001 From: John Reck Date: Tue, 7 Feb 2017 15:31:03 -0500 Subject: [PATCH] Fix capturing systrace while hwuimacro is running Test: manual; ran hwuimacro -c 10000 and started a systrace while it was running. verified trace tags showed up as expected Change-Id: Iedc20c6825e77b76ad79660512b627201f61969f --- libs/hwui/tests/common/TestContext.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/hwui/tests/common/TestContext.cpp b/libs/hwui/tests/common/TestContext.cpp index 5e937f3239ff1..c1ca1e7ac28ae 100644 --- a/libs/hwui/tests/common/TestContext.cpp +++ b/libs/hwui/tests/common/TestContext.cpp @@ -16,6 +16,8 @@ #include "tests/common/TestContext.h" +#include + namespace android { namespace uirenderer { namespace test { @@ -98,6 +100,11 @@ void TestContext::createOffscreenSurface() { } void TestContext::waitForVsync() { + // Hacky fix for not getting sysprop change callbacks + // We just poll the sysprop in vsync since it's when the UI thread is + // "idle" and shouldn't burn too much time + atrace_update_tags(); + if (mConsumer.get()) { BufferItem buffer; if (mConsumer->acquireBuffer(&buffer, 0, false) == OK) {