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);
diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h
index cc475fa..a1dbc7d 100644
--- a/libs/hwui/renderthread/RenderProxy.h
+++ b/libs/hwui/renderthread/RenderProxy.h
@@ -96,6 +96,8 @@
ANDROID_API void notifyFramePending();
ANDROID_API void dumpProfileInfo(int fd, int dumpFlags);
+ // Not exported, only used for testing
+ void resetProfileInfo();
ANDROID_API static void dumpGraphicsMemory(int fd);
ANDROID_API void setTextureAtlas(const sp<GraphicBuffer>& buffer, int64_t* map, size_t size);