summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderThread.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2021-05-11 17:04:54 -0400
committerJohn Reck <jreck@google.com>2021-05-11 17:06:53 -0400
commit66e06d4ff1e238e077f29294452325f7b4f7be1c (patch)
tree67eb988090bfb0d987e5922a85449e192a53c667 /libs/hwui/renderthread/RenderThread.cpp
parent3a8ea8727d703d8f0b790874cd6e63c87cc3f56b (diff)
Macrobenchmark tweaks & gpu memory dumping
Add support for glob matching Ensure glob matches are alphabetically sorted Add feature to dump GPU memory usage after a test pass Adjust gpu memory dump to be a bit more compact (skip empty outputs) Test: this Bug: 187718492 Change-Id: I6dc80b2d3379d8d10001116e1240727d9914bc10
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.cpp')
-rw-r--r--libs/hwui/renderthread/RenderThread.cpp35
1 files changed, 15 insertions, 20 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index 3421e01b1585..308352d34174 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -302,30 +302,25 @@ VulkanManager& RenderThread::vulkanManager() {
return *mVkManager.get();
}
-void RenderThread::dumpGraphicsMemory(int fd) {
- globalProfileData()->dump(fd);
-
- String8 cachesOutput;
- String8 pipeline;
- auto renderType = Properties::getRenderPipelineType();
- switch (renderType) {
- case RenderPipelineType::SkiaGL: {
- mCacheManager->dumpMemoryUsage(cachesOutput, mRenderState);
- pipeline.appendFormat("Skia (OpenGL)");
- break;
- }
- case RenderPipelineType::SkiaVulkan: {
- mCacheManager->dumpMemoryUsage(cachesOutput, mRenderState);
- pipeline.appendFormat("Skia (Vulkan)");
- break;
- }
+static const char* pipelineToString() {
+ switch (auto renderType = Properties::getRenderPipelineType()) {
+ case RenderPipelineType::SkiaGL:
+ return "Skia (OpenGL)";
+ case RenderPipelineType::SkiaVulkan:
+ return "Skia (Vulkan)";
default:
LOG_ALWAYS_FATAL("canvas context type %d not supported", (int32_t)renderType);
- break;
}
+}
- dprintf(fd, "\n%s\n", cachesOutput.string());
- dprintf(fd, "\nPipeline=%s\n", pipeline.string());
+void RenderThread::dumpGraphicsMemory(int fd, bool includeProfileData) {
+ if (includeProfileData) {
+ globalProfileData()->dump(fd);
+ }
+
+ String8 cachesOutput;
+ mCacheManager->dumpMemoryUsage(cachesOutput, mRenderState);
+ dprintf(fd, "\nPipeline=%s\n%s\n", pipelineToString(), cachesOutput.string());
}
Readback& RenderThread::readback() {