summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/BufferQueueLayer.cpp
diff options
context:
space:
mode:
author Alec Mouri <alecmouri@google.com> 2020-01-30 08:48:58 -0800
committer Alec Mouri <alecmouri@google.com> 2020-01-31 12:59:35 -0800
commit91f6df3b650507e04e43eb41feac02f5f92d16d0 (patch)
tree4ef814e6f115d533fe8118ada41abd3f5292590d /services/surfaceflinger/BufferQueueLayer.cpp
parent329f126bd5a78f66620dd0b113681e88192d51ed (diff)
[TimeStats] Expose pathological latch counters
* Missed latch because the acquire fence didn't fire * Latched early because the desired present time was bad Bug: 135478131 Test: libsurfaceflinger_unittest Change-Id: Id02a62c222cb497c05889dd198be5fea6d64893a
Diffstat (limited to 'services/surfaceflinger/BufferQueueLayer.cpp')
-rw-r--r--services/surfaceflinger/BufferQueueLayer.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/services/surfaceflinger/BufferQueueLayer.cpp b/services/surfaceflinger/BufferQueueLayer.cpp
index b55e62b88c..bd8eafe683 100644
--- a/services/surfaceflinger/BufferQueueLayer.cpp
+++ b/services/surfaceflinger/BufferQueueLayer.cpp
@@ -117,6 +117,10 @@ bool BufferQueueLayer::shouldPresentNow(nsecs_t expectedPresentTime) const {
"relative to expectedPresent %" PRId64,
getDebugName(), addedTime, expectedPresentTime);
+ if (!isPlausible) {
+ mFlinger->mTimeStats->incrementBadDesiredPresent(getSequence());
+ }
+
const bool isDue = addedTime < expectedPresentTime;
return isDue || !isPlausible;
}
@@ -154,7 +158,14 @@ bool BufferQueueLayer::fenceHasSignaled() const {
// able to be latched. To avoid this, grab this buffer anyway.
return true;
}
- return mQueueItems[0].mFenceTime->getSignalTime() != Fence::SIGNAL_TIME_PENDING;
+ const bool fenceSignaled =
+ mQueueItems[0].mFenceTime->getSignalTime() != Fence::SIGNAL_TIME_PENDING;
+ if (!fenceSignaled) {
+ mFlinger->mTimeStats->incrementLatchSkipped(getSequence(),
+ TimeStats::LatchSkipReason::LateAcquire);
+ }
+
+ return fenceSignaled;
}
bool BufferQueueLayer::framePresentTimeIsCurrent(nsecs_t expectedPresentTime) const {