Dump profile info after running test
Bug: 20824843
Not really a proper "benchmark mode" but it turns out
we already have reasonably good profile data, so tweak
the test app to spit it out after a run.
Change-Id: Iaee9c0d61b5508daf282fe5f95d0b37ee419a8f1
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index 7c04f40..a7bfb84 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -383,8 +383,10 @@
mRenderThread.queueAtFront(task);
}
-CREATE_BRIDGE3(dumpProfileInfo, CanvasContext* context, int fd, int dumpFlags) {
+CREATE_BRIDGE4(dumpProfileInfo, CanvasContext* context, RenderThread* thread,
+ int fd, int dumpFlags) {
args->context->profiler().dumpData(args->fd);
+ args->thread->jankTracker().dump(args->fd);
if (args->dumpFlags & DumpFlags::kFrameStats) {
args->context->dumpFrames(args->fd);
}
@@ -397,11 +399,23 @@
void RenderProxy::dumpProfileInfo(int fd, int dumpFlags) {
SETUP_TASK(dumpProfileInfo);
args->context = mContext;
+ args->thread = &mRenderThread;
args->fd = fd;
args->dumpFlags = dumpFlags;
postAndWait(task);
}
+CREATE_BRIDGE1(resetProfileInfo, CanvasContext* context) {
+ args->context->resetFrameStats();
+ return nullptr;
+}
+
+void RenderProxy::resetProfileInfo() {
+ SETUP_TASK(resetProfileInfo);
+ args->context = mContext;
+ postAndWait(task);
+}
+
CREATE_BRIDGE2(dumpGraphicsMemory, int fd, RenderThread* thread) {
args->thread->jankTracker().dump(args->fd);