From e77c7669bee30b7c0099172cf0c38cef92412040 Mon Sep 17 00:00:00 2001 From: Dan Stoza Date: Fri, 13 May 2016 11:37:28 -0700 Subject: BufferQueue/SF: Add OccupancyTracker Adds an OccupancyTracker to BufferQueue. This module keeps track of how many buffers are in the queue over time, which, in combination with various aggregation of these statistics, allows SurfaceFlinger to report what fraction of the time a given layer was double- or triple-buffered. Change-Id: Ida6e967dc5483c00a633e9fe03998e420dd88502 --- libs/gui/ConsumerBase.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libs/gui/ConsumerBase.cpp') diff --git a/libs/gui/ConsumerBase.cpp b/libs/gui/ConsumerBase.cpp index a6a971282e..84965ef6da 100644 --- a/libs/gui/ConsumerBase.cpp +++ b/libs/gui/ConsumerBase.cpp @@ -235,6 +235,16 @@ status_t ConsumerBase::setDefaultBufferDataSpace( return mConsumer->setDefaultBufferDataSpace(defaultDataSpace); } +status_t ConsumerBase::getOccupancyHistory(bool forceFlush, + std::vector* outHistory) { + Mutex::Autolock _l(mMutex); + if (mAbandoned) { + CB_LOGE("getOccupancyHistory: ConsumerBase is abandoned!"); + return NO_INIT; + } + return mConsumer->getOccupancyHistory(forceFlush, outHistory); +} + void ConsumerBase::dump(String8& result) const { dump(result, ""); } -- cgit v1.2.3-59-g8ed1b