Loading libs/ui/GraphicBufferAllocator.cpp +9 −0 Original line number Original line Diff line number Diff line Loading @@ -60,6 +60,15 @@ GraphicBufferAllocator::GraphicBufferAllocator() : mMapper(GraphicBufferMapper:: GraphicBufferAllocator::~GraphicBufferAllocator() {} GraphicBufferAllocator::~GraphicBufferAllocator() {} size_t GraphicBufferAllocator::getTotalSize() const { Mutex::Autolock _l(sLock); size_t total = 0; for (size_t i = 0; i < sAllocList.size(); ++i) { total += sAllocList.valueAt(i).size; } return total; } void GraphicBufferAllocator::dump(std::string& result) const { void GraphicBufferAllocator::dump(std::string& result) const { Mutex::Autolock _l(sLock); Mutex::Autolock _l(sLock); KeyedVector<buffer_handle_t, alloc_rec_t>& list(sAllocList); KeyedVector<buffer_handle_t, alloc_rec_t>& list(sAllocList); Loading libs/ui/include/ui/GraphicBufferAllocator.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -49,6 +49,8 @@ public: status_t free(buffer_handle_t handle); status_t free(buffer_handle_t handle); size_t getTotalSize() const; void dump(std::string& res) const; void dump(std::string& res) const; static void dumpToSystemLog(); static void dumpToSystemLog(); Loading services/surfaceflinger/SurfaceFlinger.cpp +6 −0 Original line number Original line Diff line number Diff line Loading @@ -2093,6 +2093,12 @@ void SurfaceFlinger::postComposition() if (mLumaSampling && mRegionSamplingThread) { if (mLumaSampling && mRegionSamplingThread) { mRegionSamplingThread->notifyNewContent(); mRegionSamplingThread->notifyNewContent(); } } // Even though ATRACE_INT64 already checks if tracing is enabled, it doesn't prevent the // side-effect of getTotalSize(), so we check that again here if (ATRACE_ENABLED()) { ATRACE_INT64("Total Buffer Size", GraphicBufferAllocator::get().getTotalSize()); } } } void SurfaceFlinger::computeLayerBounds() { void SurfaceFlinger::computeLayerBounds() { Loading Loading
libs/ui/GraphicBufferAllocator.cpp +9 −0 Original line number Original line Diff line number Diff line Loading @@ -60,6 +60,15 @@ GraphicBufferAllocator::GraphicBufferAllocator() : mMapper(GraphicBufferMapper:: GraphicBufferAllocator::~GraphicBufferAllocator() {} GraphicBufferAllocator::~GraphicBufferAllocator() {} size_t GraphicBufferAllocator::getTotalSize() const { Mutex::Autolock _l(sLock); size_t total = 0; for (size_t i = 0; i < sAllocList.size(); ++i) { total += sAllocList.valueAt(i).size; } return total; } void GraphicBufferAllocator::dump(std::string& result) const { void GraphicBufferAllocator::dump(std::string& result) const { Mutex::Autolock _l(sLock); Mutex::Autolock _l(sLock); KeyedVector<buffer_handle_t, alloc_rec_t>& list(sAllocList); KeyedVector<buffer_handle_t, alloc_rec_t>& list(sAllocList); Loading
libs/ui/include/ui/GraphicBufferAllocator.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -49,6 +49,8 @@ public: status_t free(buffer_handle_t handle); status_t free(buffer_handle_t handle); size_t getTotalSize() const; void dump(std::string& res) const; void dump(std::string& res) const; static void dumpToSystemLog(); static void dumpToSystemLog(); Loading
services/surfaceflinger/SurfaceFlinger.cpp +6 −0 Original line number Original line Diff line number Diff line Loading @@ -2093,6 +2093,12 @@ void SurfaceFlinger::postComposition() if (mLumaSampling && mRegionSamplingThread) { if (mLumaSampling && mRegionSamplingThread) { mRegionSamplingThread->notifyNewContent(); mRegionSamplingThread->notifyNewContent(); } } // Even though ATRACE_INT64 already checks if tracing is enabled, it doesn't prevent the // side-effect of getTotalSize(), so we check that again here if (ATRACE_ENABLED()) { ATRACE_INT64("Total Buffer Size", GraphicBufferAllocator::get().getTotalSize()); } } } void SurfaceFlinger::computeLayerBounds() { void SurfaceFlinger::computeLayerBounds() { Loading