summaryrefslogtreecommitdiff
path: root/libs/hwui/JankTracker.cpp
AgeCommit message (Collapse)Author
2021-07-09Properly protect mFrameMetricsReporterSiarhei Vishniakou
This field actually requires a special lock, mFrameMetricsReporterMutex. But there isn't a GUARDED_BY annotation for it. And even if there was, the compiler feature of -Wthread-safety was not active in this code, so this error would not have been caught. To fix this, enable the compiler annotation and add GUARDED_BY annotation to mFrameMetricsReporter. And finally, use this lock to properly protect this field. Bug: 192330836 Test: atest hwui_unit_tests Change-Id: I76950bfa01bbd7ccdc54c4e8c114430b5aeddf1a
2021-06-01libandroid_runtime & libhwui: use libstats*_lazyTej Singh
Update libandroid_runtime and libhwui, both of which are dependencies of bootanimation, to use listatssocket_lazy and libstatspull_lazy, which are new static versions of libstatssocket and libstatspull. This means that bootanimation does not depend on these libraries, which are shipped from the statsd apex. The change enables removing the statsd apex from the bootstrap apexes. Test: m Test: boots Test: no fatal linker errors after removing statsd from the bootstrap apexes Bug: 178480419 Change-Id: I78f4abe71f4b3718bbd97522c16f1c5ab88f77ae
2021-04-13Change hwui jank detection to use deadline & gpu completion (1/2)Jorim Jaggi
- 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
2021-02-24Merge "Add presentTime to FrameInfo" into sc-devSiarhei Vishniakou
2021-02-24Revert to previous metric for jank reportingJorim Jaggi
Test: adb shell dumpsys gfxinfo com.android.systemui Fixes: 180959287 Change-Id: I47deb32b61c6a49a720946447c4fc48b9779d58a
2021-02-22Don't double lock when resetting jank testsJorim Jaggi
Fixes: 180875541 Test: adb shell dumpsys com.android.systemui reset Change-Id: Ie656730bbbbb249e6798617cf236b93332e79eb6
2021-02-18Add presentTime to FrameInfoSiarhei Vishniakou
Present time is available to apps, but is not currently stored inside FrameInfo. In this CL, we add a location for storing the present time inside FrameInfo. Currently, the metrics reporter is triggered after the buffer is sent to SurfaceFlinger. That means, metrics for anything that happens after gpu draw completes are currently not available. In a future CL, we will populate the 'presentTime' field. In a future CL, we will register a metrics observer inside ViewRootImpl in order to send this data to InputDispatcher. This will enable end-to-end touch latency metrics collection. Bug: 169866723 Test: printed present time inside FrameTimeline.cpp (surfaceflinger side) and compared to the values printed inside a metrics observer registered in ViewRootImpl (not done in this CL) Test: atest ViewFrameInfoTest Change-Id: I7d0f8c5d7b5a2572abdc4e107123e8938a36f582
2021-02-17Add GPU completion to FrameMetrics (1/3)Jorim Jaggi
- Add SurfaceStatsCallback to TransactionCompletedListener - Register a callback in RenderProxy to be called when we have surface stats from SF via the BLAST callback. - Instead of finishing a frame for frame metrics reporting immediately, wait until BLAST callback fires, note GPU completion time and finish frame. - Expose GPU_COMPLETION in FrameMetrics - Modify TOTAL_DURATION to also include GPU_COMPLETION Test: FrameMetricsListenerTest Fixes: 171046219 Change-Id: I16fa1d80cfc4e7a5527c18fec7e885409f17ee4d
2020-11-09Deprecate DaveyOccurred AtomJeffrey Huang
Bug: 172692115 Test: m libhwui Change-Id: I56df46ac5b8e00acc251f222bd6d0c1f4e0f17ac
2020-07-24fix uninitialization issue in JankTrackerZhiyin Luo (罗植尹)
We should initialize mSwapDeadline in JankTracker, or it can be a very large randomized value and then makes jank tracker not collect concrete jank type of frames appropriately as expected. Bug: 161656795 Test: run cts -m CtsIncidentHostTestCases -t com.android.server.cts.GraphicsStatsValidationTest#testJankyDrawFrame Change-Id: I057a50a74502918619204f9164f6a954f8e9c5de
2019-12-26[HWUI] use AChoreographer in place of DisplayEventReceiver.Alec Mouri
Bug: 136262896 Test: builds, boots Test: scroll through settings app Test: Toggle between 60/90hz and observe systrace Change-Id: I8eef306a968525c55f3863ae688545faa43b23be
2019-10-25[HWUI] Get DeviceInfo through stable ABIAlec Mouri
This also removes the dependency on ui/DeviceInfo other than in test code. Bug: 136263392 Bug: 136263238 Test: builds, boots Change-Id: I6a4687e981359f0e6beb83be8a5501ed7fd16f15
2019-08-01Add GPU draw stats to gfxinfo and GraphicsStatsServiceStan Iliev
Test: ran dumpsys with gfxinfo and graphicsstats Change-Id: Id9950de87dc4343c6878baa6a6dd42fbc8aeddef
2019-05-28Merge "Avoid fake high input latency while vsync drifting" am: 3996c9eb72Gao Shuo
am: 151f38fe89 Change-Id: Ida223a2af7a0669cf495bac8ccb8fa90414d159d
2019-05-27Avoid fake high input latency while vsync driftingGao Shuo
Usually isTrippleBuffered should be true when mSwapDeadline bigger than IntendedVsync. However, vsync could be drifting on some platforms, which make isTrippleBuffered to be true and report a fake high input latency. So add a small threshold to avoid this case. Test: Manually Change-Id: Ib6ff1046cfb94f89f4985361b84ad2d34850f783 Signed-off-by: Gao Shuo <shuo.gao@intel.com> Signed-off-by: Wu Zhongmin <zhongmin.wu@intel.com> Signed-off-by: Zhu Tingting <tingting.zhu@intel.com>
2018-11-28Merge "Remove USE_HWC2 usage" am: 8757179e52 am: 70a2813e86John Reck
am: 0ff158799a Change-Id: I8e87f4661e51b422886c72ef506f196608a32a42
2018-11-28Remove USE_HWC2 usageJohn Reck
It's always true now Test: didn't Change-Id: Ibefde5feaeaec8fb68cbc6ea1c019bf8b5e608bb
2018-10-10Log the davey event.Yangster-mac
Test: statsd test Fix: 117528646 Change-Id: Idb7cc37cd18047120adabbc9fbda1c89b109f3a7
2018-09-14Don't run comparisons on non-jank framesJohn Reck
Unclear why mSwapDeadline doesn't already account for this, but the handling of vsync phase offsets may be throwing things off a bit. For now just do the simple fix. Bug: 109894489 Test: builds, patch was verified by reporter Change-Id: I5a6f25ceac4986d366293fe7b5e3af64a326114c
2018-04-20Add socket listener to statsd. And remove Davey atom.Yao Chen
+ The socket listener is behind a flag. It's disabled until we get sepolicy changes in. + Data parsing code is from logd, because we use the same format. + Removed Davey from JankTracker because it violates our new sepolicy Test: manually Bug: 78239479 Change-Id: Ib17729fbc362cdb13385f780e2d636a95adf9bc3
2018-03-19Revert "Revert "Break down jank between frame drops vs. triple buffered""John Reck
This reverts commit a6d8fbf4ea634f5f605b2b7db3ca98975f8625b5. Fixes an out-of-bounds read in COMPARISONS by switching up how comparisons works. Instead of requiring all jank types to have an associated COMPARISON's entry, which kHighInputLatency and kMissedDeadline don't, instead have each COMPARISON indicate which JankType it applies to so it can be independently sized from JankTypes. Bug: 70220906 Bug: 75566601 Test: launching & using maps works Change-Id: I7fd90daeb320b4627e42c3418c89726d860998c1
2018-03-19Revert "Break down jank between frame drops vs. triple buffered"Aaron Whyte
This reverts commit 09979fbee7201b46158c2c033194529e4284ea13. Reason for revert: Based on stacktraces and change history, I think this is causing a cluster of P crashes. https://b.corp.google.com/issues?q=(%22android%22%20%22:uirenderer::JankTracker::finishFrame%22) Bug: 75566601 Bug: 75811585 Bug: 75407175 Bug: 75736222 Bug: 75391447 Bug: 75659839 Change-Id: I59a8c2d8906d347210c77fb3628f5801bc299bfb
2018-03-14Break down jank between frame drops vs. triple bufferedJohn Reck
Bug: 70220906 Test: JankyScene vs. systrace vs. jankstats Change-Id: Ia012685020cc5bcabbd3f92f0bdeb84eaf50733d
2018-02-26Updates jank metrics in statsd to include uid.David Chen
We need the uid to easily know which app to blame for producing the frame with excessively long render time. Also updates the errors so it's more obvious if the error is in parsing versus the other checks. Test: Test that statsd builds and verified CTS test still passes. Change-Id: Ib6518f2d9fe6f9c78d548b6dcbdb67a0f211ff5c
2018-02-01Atom: DaveyOccurredTej Singh
Atom for davey occurred Test: cts test accompanying && statsd unit tests && hwui unit tests Change-Id: I715ac213b09ef2b3ef1de75bc456a5edf7e0a244
2017-12-15Log daveysJohn Reck
Bug: 70339576 Test: Checked that it logged with a lower threshold Change-Id: I271f8af2a3ee63769edc71291b70f19512974d78
2017-11-13Fix leak of FILE* in dumpingJohn Reck
Avoid fdopen as fclose, which frees the FILE*, will close the FD which we don't want. Just normalize on dprintf instead, and we can add buffering if it turns out to matter at some point Test: ran 'dumpsys gfxinfo framestats' in a loop while observing PSS Change-Id: I7808753641aa1055cfdf570c3e017017f11f1dee
2017-11-03Format the world (or just HWUI)John Reck
Test: No code changes, just ran through clang-format Change-Id: Id23aa4ec7eebc0446fe3a30260f33e7fd455bb8c
2017-07-05Move frame history into jank trackerJohn Reck
Test: hwui_unit_tests & manual Change-Id: If761947652750640268217cd8cd97c8382441b44
2017-07-05Split out jank data from policyJohn Reck
Move ProfileData out to its own file with helper accessors. This keeps policy (what is/isn't jank) outside of the data storage. Also use lambdas to iterate over the histogram to make it nicer for dumping & proto-ifying. Test: hwui_unit_tests pass & jank data still dumps Change-Id: I88488369ec77590a2867f51128e65bb786aa34e6
2017-05-01Merge "Remove no-op std::max call" am: c00af4c533 am: ef5e579cecYi Kong
am: f3310cb3b1 Change-Id: I553be70f9ba04feaf4da01041bfb3edc6ae38252
2017-04-30Remove no-op std::max callYi Kong
This was calling std::max on an unsigned integer and 0, which is essentially no-op. Remove this code. Test: Build Bug: 37752547 Change-Id: I74ce45b95960621dff11f574fbe1af60ad147cf0
2017-03-27Add a few asserts for possible corruption casesJohn Reck
Bug: 36502346 Test: builds & boots Change-Id: Id96a26a30e4a8c6f51a68bf07cfe6bd6d07c244e
2017-02-21Overhaul GraphicsStatsServiceJohn Reck
* LRU cache of recently-used is dead, replaced disk storage * ASHMEM size is read from native by the system service, no longer requires keeping a sizeof() in sync with a constant in Java * Supports dumping in proto format by passing --proto * Rotates logs on a daily basis * Keeps a history of the most recent 3 days Bug: 33705836 Test: Manual. Verified log rotating works by setting it up to rotate every minute instead of day. Confirmed /data/system/graphicsstats only has the most recent 3 entries after several minutes Change-Id: Ib84bafb26c58701cc86f123236de4fff01aaa4aa
2017-01-11Replace cutils/log.h and log/logger.h with android/log.h or log/log.hMark Salyzyn
(part deux) Test: compile Bug: 26552300 Bug: 31289077 Change-Id: I7417936c4d3666608fccfe51a312c90ecefba2fb
2017-01-09Replace cutils/log.h and log/logger.h with log/log.hMark Salyzyn
Test: compile Bug: 26552300 Bug: 31289077 Change-Id: I578b15b48f0fc2807a92abbc69a377c3d2191496
2016-07-29Teach JankTracker about new swap behaviorsJohn Reck
Bug: 30440166 If we are using HWC2, there's a change in timing when in triple buffering with the pipelined offsets. This changes JankTracker to recognize that and silently erase that from the total duration Change-Id: Ib1fd4209070f17dbd2baed707c8cf73fb11c3cf2
2016-04-15Switch JankTracker to FrameInfo::duration()John Reck
Fixes: 27533462 FrameInfo::duration() will remove time spent waiting in the queue from the duration. This is desired because that time is otherwise accounted for by the previous frame, so we don't want to double count it. This shows up mostly in TestSceneRunner & shadowgrid2 due to a combination of slow frame times and continous rendering. Change-Id: I27c42d5c24d266de4ada8ea00ec9164d518754f8
2016-04-12Fix reset() to zero slowFrameCountsJohn Reck
Change-Id: I9f7f7280bcd28c361e5665de39a4bd7c594ab521 Fixes: 26386641
2016-03-31Expand JankTrackerJohn Reck
Bug: 27922347 * Dump the full histogram * Expand the histogram to have a slow-frame section with large 50ms buckets to raise the cap to 5s to give more insight into system-health * Stop excluding first-frame metrics as we want to include those in our global tracking. Automated tests already filter these out by doing resets before running anyway. Change-Id: Idaba8aad591f59d10a6477b11efc0767ff715083
2016-03-30Add an option to try and filter out test overheadJohn Reck
Bug: 26912651 By setting debug.hwui.filter_test_overhead to true, hwui's janktracker will attempt to filter out overhead caused by the event injection that automated testing uses Change-Id: I75c8dc5e7798e06e3009baf396108507c7240eec
2016-03-28Fix array out of bounds access in JankTrackerJohn Reck
Fixes: 27873879 If frametime > max janktracker would accidentally double-increment totalFrameCount due to overflowing the end of frameCounts Change-Id: Iebfd1349b7014ade807f42d9c196139274a96684
2016-03-24Track slowest framesJohn Reck
Fixes: 27795291 Track the 10 slowest frames over the last 24 hours to try and give approximate insight into total system health. Change-Id: I8aa646cef0bea185d46b3c78478266bc01d17fd7
2015-12-16Add some options to macrobenchJohn Reck
Change-Id: If8d5f5d3ace050577986a554182b2b66fd2257e1
2015-07-06Adjust for pipeline stallsJohn Reck
Bug: 20853441 Calculating duration that crosses the UI-RT sync point will now subtract out the time spent waiting in queue under the assumption that this time will be accounted for in the previous frame's metrics Change-Id: Ia8213f4410638840613f5ae439e98dfb77532a6a
2015-06-03Delete MAKE_ENUM_FLAGSChris Craik
bug:21595702 Settle on namespace-enum for consistency. Also removes k prefix. Change-Id: Ib89f94cb9263de40b6e4636577dca4860867d0d8
2015-04-07Fix 64-bit build.Ying Wang
Change-Id: I9f2e2edf276f98864b65708b746bf938a4a3c8d6
2015-04-06Add stat collection start timeJohn Reck
Add CLOCK_MONOTONIC to signal when the stat collection started to allow for tracking stats over time Change-Id: Iab7c52f21184eea603ddc8572b9d91a951b45a00
2015-03-31Fix warn log formatJohn Reck
Change-Id: I7876dd5d0d0f68dde4cb0768699d800daff754f1
2015-03-27Add GraphicsStatsServiceJohn Reck
More S's for More Speed Split JankTracker's backing data from the class to allow for data relocation to/from ashmem regions Pack the jank tracking data to fit in 256 bytes Change-Id: Ife86a64b71a328fbd0c8075fe6a0404e081f725b