summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/CacheManager.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/CacheManager.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/CacheManager.cpp')
-rw-r--r--libs/hwui/renderthread/CacheManager.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/libs/hwui/renderthread/CacheManager.cpp b/libs/hwui/renderthread/CacheManager.cpp
index d998e5031984..5047be979e41 100644
--- a/libs/hwui/renderthread/CacheManager.cpp
+++ b/libs/hwui/renderthread/CacheManager.cpp
@@ -140,7 +140,6 @@ void CacheManager::dumpMemoryUsage(String8& log, const RenderState* renderState)
log.appendFormat(" Size: %.2f kB \n", SkGraphics::GetFontCacheUsed() / 1024.0f);
log.appendFormat(" Glyph Count: %d \n", SkGraphics::GetFontCacheCountUsed());
- log.appendFormat("CPU Caches:\n");
std::vector<skiapipeline::ResourcePair> cpuResourceMap = {
{"skia/sk_resource_cache/bitmap_", "Bitmaps"},
{"skia/sk_resource_cache/rrect-blur_", "Masks"},
@@ -149,20 +148,20 @@ void CacheManager::dumpMemoryUsage(String8& log, const RenderState* renderState)
};
skiapipeline::SkiaMemoryTracer cpuTracer(cpuResourceMap, false);
SkGraphics::DumpMemoryStatistics(&cpuTracer);
- cpuTracer.logOutput(log);
+ if (cpuTracer.hasOutput()) {
+ log.appendFormat("CPU Caches:\n");
+ cpuTracer.logOutput(log);
+ }
- log.appendFormat("GPU Caches:\n");
skiapipeline::SkiaMemoryTracer gpuTracer("category", true);
mGrContext->dumpMemoryStatistics(&gpuTracer);
- gpuTracer.logOutput(log);
-
- log.appendFormat("Other Caches:\n");
- log.appendFormat(" Current / Maximum\n");
+ if (gpuTracer.hasOutput()) {
+ log.appendFormat("GPU Caches:\n");
+ gpuTracer.logOutput(log);
+ }
- if (renderState) {
- if (renderState->mActiveLayers.size() > 0) {
- log.appendFormat(" Layer Info:\n");
- }
+ if (renderState && renderState->mActiveLayers.size() > 0) {
+ log.appendFormat("Layer Info:\n");
const char* layerType = Properties::getRenderPipelineType() == RenderPipelineType::SkiaGL
? "GlLayer"