diff options
| author | 2017-03-27 23:30:18 +0000 | |
|---|---|---|
| committer | 2017-03-27 23:30:22 +0000 | |
| commit | 55bea5e30808856eb039d74e2fa7e06ee0dd05e7 (patch) | |
| tree | c6c474df1147a89443c5f68911a21876f819bf57 /libs/hwui/JankTracker.cpp | |
| parent | 52b716df852d1190b282f0393c24803ffd56059f (diff) | |
| parent | 1b7184f8d206505804042833a3825a3b8a9649dc (diff) | |
Merge "Add a few asserts for possible corruption cases"
Diffstat (limited to 'libs/hwui/JankTracker.cpp')
| -rw-r--r-- | libs/hwui/JankTracker.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/hwui/JankTracker.cpp b/libs/hwui/JankTracker.cpp index 7be71eec4f76..8126d57a3a79 100644 --- a/libs/hwui/JankTracker.cpp +++ b/libs/hwui/JankTracker.cpp @@ -264,10 +264,15 @@ void JankTracker::addFrame(const FrameInfo& frame) { // the actual time spent blocked. nsecs_t forgiveAmount = std::min(expectedDequeueDuration, frame[FrameInfoIndex::DequeueBufferDuration]); + LOG_ALWAYS_FATAL_IF(forgiveAmount >= totalDuration, + "Impossible dequeue duration! dequeue duration reported %" PRId64 + ", total duration %" PRId64, forgiveAmount, totalDuration); totalDuration -= forgiveAmount; } } + LOG_ALWAYS_FATAL_IF(totalDuration <= 0, "Impossible totalDuration %" PRId64, totalDuration); uint32_t framebucket = frameCountIndexForFrameTime(totalDuration); + LOG_ALWAYS_FATAL_IF(framebucket < 0, "framebucket < 0 (%u)", framebucket); // Keep the fast path as fast as possible. if (CC_LIKELY(totalDuration < mFrameInterval)) { mData->frameCounts[framebucket]++; |