Loading libs/hwui/pipeline/skia/SkiaMemoryTracer.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,12 @@ void SkiaMemoryTracer::dumpNumericValue(const char* dumpName, const char* valueN mCurrentValues.insert({valueName, {units, value}}); } bool SkiaMemoryTracer::hasOutput() { // process any remaining elements processElement(); return mResults.size() > 0; } void SkiaMemoryTracer::logOutput(String8& log) { // process any remaining elements processElement(); Loading libs/hwui/pipeline/skia/SkiaMemoryTracer.h +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ public: SkiaMemoryTracer(const char* categoryKey, bool itemizeType); ~SkiaMemoryTracer() override {} bool hasOutput(); void logOutput(String8& log); void logTotals(String8& log); Loading libs/hwui/renderthread/CacheManager.cpp +10 −11 Original line number Diff line number Diff line Loading @@ -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"}, Loading @@ -149,20 +148,20 @@ void CacheManager::dumpMemoryUsage(String8& log, const RenderState* renderState) }; skiapipeline::SkiaMemoryTracer cpuTracer(cpuResourceMap, false); SkGraphics::DumpMemoryStatistics(&cpuTracer); if (cpuTracer.hasOutput()) { log.appendFormat("CPU Caches:\n"); cpuTracer.logOutput(log); } log.appendFormat("GPU Caches:\n"); skiapipeline::SkiaMemoryTracer gpuTracer("category", true); mGrContext->dumpMemoryStatistics(&gpuTracer); if (gpuTracer.hasOutput()) { log.appendFormat("GPU Caches:\n"); gpuTracer.logOutput(log); } log.appendFormat("Other Caches:\n"); log.appendFormat(" Current / Maximum\n"); if (renderState) { if (renderState->mActiveLayers.size() > 0) { if (renderState && renderState->mActiveLayers.size() > 0) { log.appendFormat("Layer Info:\n"); } const char* layerType = Properties::getRenderPipelineType() == RenderPipelineType::SkiaGL ? "GlLayer" Loading libs/hwui/renderthread/RenderProxy.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -249,10 +249,10 @@ uint32_t RenderProxy::frameTimePercentile(int percentile) { }); } void RenderProxy::dumpGraphicsMemory(int fd) { void RenderProxy::dumpGraphicsMemory(int fd, bool includeProfileData) { if (RenderThread::hasInstance()) { auto& thread = RenderThread::getInstance(); thread.queue().runSync([&]() { thread.dumpGraphicsMemory(fd); }); thread.queue().runSync([&]() { thread.dumpGraphicsMemory(fd, includeProfileData); }); } } Loading libs/hwui/renderthread/RenderProxy.h +1 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ public: // Not exported, only used for testing void resetProfileInfo(); uint32_t frameTimePercentile(int p); static void dumpGraphicsMemory(int fd); static void dumpGraphicsMemory(int fd, bool includeProfileData = true); static void rotateProcessStatsBuffer(); static void setProcessStatsBuffer(int fd); Loading Loading
libs/hwui/pipeline/skia/SkiaMemoryTracer.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,12 @@ void SkiaMemoryTracer::dumpNumericValue(const char* dumpName, const char* valueN mCurrentValues.insert({valueName, {units, value}}); } bool SkiaMemoryTracer::hasOutput() { // process any remaining elements processElement(); return mResults.size() > 0; } void SkiaMemoryTracer::logOutput(String8& log) { // process any remaining elements processElement(); Loading
libs/hwui/pipeline/skia/SkiaMemoryTracer.h +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ public: SkiaMemoryTracer(const char* categoryKey, bool itemizeType); ~SkiaMemoryTracer() override {} bool hasOutput(); void logOutput(String8& log); void logTotals(String8& log); Loading
libs/hwui/renderthread/CacheManager.cpp +10 −11 Original line number Diff line number Diff line Loading @@ -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"}, Loading @@ -149,20 +148,20 @@ void CacheManager::dumpMemoryUsage(String8& log, const RenderState* renderState) }; skiapipeline::SkiaMemoryTracer cpuTracer(cpuResourceMap, false); SkGraphics::DumpMemoryStatistics(&cpuTracer); if (cpuTracer.hasOutput()) { log.appendFormat("CPU Caches:\n"); cpuTracer.logOutput(log); } log.appendFormat("GPU Caches:\n"); skiapipeline::SkiaMemoryTracer gpuTracer("category", true); mGrContext->dumpMemoryStatistics(&gpuTracer); if (gpuTracer.hasOutput()) { log.appendFormat("GPU Caches:\n"); gpuTracer.logOutput(log); } log.appendFormat("Other Caches:\n"); log.appendFormat(" Current / Maximum\n"); if (renderState) { if (renderState->mActiveLayers.size() > 0) { if (renderState && renderState->mActiveLayers.size() > 0) { log.appendFormat("Layer Info:\n"); } const char* layerType = Properties::getRenderPipelineType() == RenderPipelineType::SkiaGL ? "GlLayer" Loading
libs/hwui/renderthread/RenderProxy.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -249,10 +249,10 @@ uint32_t RenderProxy::frameTimePercentile(int percentile) { }); } void RenderProxy::dumpGraphicsMemory(int fd) { void RenderProxy::dumpGraphicsMemory(int fd, bool includeProfileData) { if (RenderThread::hasInstance()) { auto& thread = RenderThread::getInstance(); thread.queue().runSync([&]() { thread.dumpGraphicsMemory(fd); }); thread.queue().runSync([&]() { thread.dumpGraphicsMemory(fd, includeProfileData); }); } } Loading
libs/hwui/renderthread/RenderProxy.h +1 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ public: // Not exported, only used for testing void resetProfileInfo(); uint32_t frameTimePercentile(int p); static void dumpGraphicsMemory(int fd); static void dumpGraphicsMemory(int fd, bool includeProfileData = true); static void rotateProcessStatsBuffer(); static void setProcessStatsBuffer(int fd); Loading