diff options
author | Jorim Jaggi <jjaggi@google.com> | 2021-01-19 00:08:02 +0100 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2021-04-13 15:18:27 +0000 |
commit | 10f328c580fe1e897b51a7e4b38ee4c341d970f1 (patch) | |
tree | b5719df2aa8460ef2925440e72ecec07020557b1 /libs/hwui/ProfileData.cpp | |
parent | a373e1ed5a59997b2cc8ac86615963d8597e4a2b (diff) |
Change hwui jank detection to use deadline & gpu completion (1/2)
- Use GPU finish time as well as actual deadline to determine jank
rate.
- Use dynamic interval to adjust for 60/90hz switching
- Move frame metrics reporting into JankTracker to adjust the
deadline communicated to the app when in stuffing scenario.
- Adjust double-stuffing detection to be a bit more readable.
Test: GraphicsStatsValidationTest.java
Test: adb shell dumpsys gfxinfo
Test: FrameMetricsListenerTest
Test: Log output of FrameMetricsObserver
Bug: 169858044
Change-Id: I3a6b8ed163e2cf9cf2b67667110340ebe35f98a1
Diffstat (limited to 'libs/hwui/ProfileData.cpp')
-rw-r--r-- | libs/hwui/ProfileData.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/hwui/ProfileData.cpp b/libs/hwui/ProfileData.cpp index a8e36e37905d..dd8439647fd3 100644 --- a/libs/hwui/ProfileData.cpp +++ b/libs/hwui/ProfileData.cpp @@ -24,7 +24,8 @@ namespace uirenderer { static const char* JANK_TYPE_NAMES[] = { "Missed Vsync", "High input latency", "Slow UI thread", - "Slow bitmap uploads", "Slow issue draw commands", "Frame deadline missed"}; + "Slow bitmap uploads", "Slow issue draw commands", "Frame deadline missed", + "Frame deadline missed (legacy)"}; // The bucketing algorithm controls so to speak // If a frame is <= to this it goes in bucket 0 @@ -94,6 +95,8 @@ void ProfileData::mergeWith(const ProfileData& other) { } mJankFrameCount >>= divider; mJankFrameCount += other.mJankFrameCount; + mJankLegacyFrameCount >>= divider; + mJankLegacyFrameCount += other.mJankLegacyFrameCount; mTotalFrameCount >>= divider; mTotalFrameCount += other.mTotalFrameCount; if (mStatStartTime > other.mStatStartTime || mStatStartTime == 0) { @@ -112,6 +115,9 @@ void ProfileData::dump(int fd) const { dprintf(fd, "\nJanky frames: %u (%.2f%%)", mJankFrameCount, mTotalFrameCount == 0 ? 0.0f : (float)mJankFrameCount / (float)mTotalFrameCount * 100.0f); + dprintf(fd, "\nJanky frames (legacy): %u (%.2f%%)", mJankLegacyFrameCount, mTotalFrameCount == 0 + ? 0.0f + : (float)mJankLegacyFrameCount / (float)mTotalFrameCount * 100.0f); dprintf(fd, "\n50th percentile: %ums", findPercentile(50)); dprintf(fd, "\n90th percentile: %ums", findPercentile(90)); dprintf(fd, "\n95th percentile: %ums", findPercentile(95)); @@ -158,6 +164,7 @@ void ProfileData::reset() { mSlowFrameCounts.fill(0); mTotalFrameCount = 0; mJankFrameCount = 0; + mJankLegacyFrameCount = 0; mStatStartTime = systemTime(SYSTEM_TIME_MONOTONIC); mPipelineType = Properties::getRenderPipelineType(); } |