summaryrefslogtreecommitdiff
path: root/core/java/android/view/FrameMetrics.java
Commit message (Collapse)AuthorAgeFilesLines
* Make GPU duration metrics more accurate for VulkanAlec Mouri2022-06-011-2/+3
| | | | | | | | | | | | | | | | | | | | In the Vulkan pipeline, the GPU start time was measured to be when swapBuffers starts. But the command queue has already been submitted at this point, which means that the GPU work would already have begun. This means that it's possible to measure a negative time since for very light GPU workloads, the GPU fence can fire prior to CPU making it to swapBuffers(). To compensate, instead measure from after skia completed submitting GPU commands, until the GPU fence fires. Since it is theoretically possible for GPU work to complete if the render thread gets descheduled immediately after submitting the GPU, we also add some clamping to ensure that the duration from command submission -> completion of GPU work is nonnegative. Bug: 230713131 Test: atest android.view.cts.FrameMetricsListenerTest Change-Id: Ia30b7732eaab71e4e29766f788d5cd94ec63c38a
* Mark first frames in metrics properlyJorim Jaggi2021-05-031-3/+3
| | | | | | | | | | Such that we only set the flag in case window visibility actually changes. There are a lot of other cases where we need to do a window relayout which can lead to visible jank. Test: FrameMetricsListenerTest, manual Bug: 185902609 Change-Id: Ia09ce640f3a89bf9dd4ff0f4e4469e88a513709a
* Change hwui jank detection to use deadline & gpu completion (1/2)Jorim Jaggi2021-04-131-11/+12
| | | | | | | | | | | | | | | | - 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
* Integrate HWUI with PerformanceHintManagerBo Liu2021-04-101-11/+12
| | | | | | | | | | | | | | | | | | | | | | PerformanceHintManager.Session is in java, so add JNI and a HintSessionWrapper class in HardwareRenderer. Then pass the two calls as two std::functions into DrawFrameTask. Note Session is created per HardwareRenderer, not global (per RenderThread). Session includes UI thread, render thread, and the thread pool. Desired duration is from the intended start duration to the frame deadline. Add an actual frame start time to compute Add system properties: debug.hwui.use_hint_manager to enable PerformanceHintManager debug.hwui.target_cpu_time_percent to control percentage of frame time to be used for target cpu duration. Test: Manual test that there are no crashes and values make sense. Bug: 158791282 Change-Id: I83f25433c10daa20033803fb7c4ae45eab34f1d3
* Add presentTime to FrameInfoSiarhei Vishniakou2021-02-181-17/+21
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Add GPU completion to FrameMetrics (1/3)Jorim Jaggi2021-02-171-3/+37
| | | | | | | | | | | | | | | - 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
* Merge "Avoid ellipsis character in documentation." am: ac598696b4 am: ↵Treehugger Robot2021-02-041-1/+1
|\ | | | | | | | | | | | | | | | | | | 3aa7c4ed7b am: b0d13011f9 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1573409 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Iad1be5ffe2988ff3b763741c4e0513c9c697522a
| * Avoid ellipsis character in documentation.Donald Chai2021-02-041-1/+1
| | | | | | | | | | | | Renders as "?" on https://developer.android.com/reference/android/view/FrameMetrics, as if someone was unsure? Change-Id: I4de9b99282480f1107bd8c3e387781775de9326c
| * Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-11-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
* | Migrate FrameTracker to use ST Jank informationJorim Jaggi2021-01-071-1/+1
| | | | | | | | | | | | | | Test: FrameTrackerTest Test: Systrace, perform CUJ Bug: 174755489 Change-Id: I906abce66d456add7c562b1d9038352eb589f6f0
* | Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. This is a resubmit of ag/12929664 with some APIs excluded that caused test failures; see bugs 171886397, 171888296, 171864568. APIs excluded: Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/os/Process;->myPpid()I Landroid/os/SharedMemory;->getFd()I Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I Bug: 170729553 Test: Treehugger Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
* | Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-2/+1
| | | | | | | | | | | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* | Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-1/+2
| | | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
* | pass frame deadline to ChoreographerAdy Abraham2020-10-091-6/+9
| | | | | | | | | | | | | | | | | | | | Pass the frame deadline calculated by SF to Choreographer so hwui would be able to improve its stats by knowing if a frame is likely to be late. Bug: 169858174 Test: manual Change-Id: Ib9fd93638b54f08d8dc72fa6b023e2dd7c276dc7
* | Shared timeline plumbingSteven Thomas2020-09-161-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | Add plumbing to get shared timeline data from Surface Flinger to HWUI and back. Bug: 162890382 Bug: 162888881 Bug: 162890407 Test: manual using ALOG messages in SF Change-Id: I85c5eb56d2fa933889518854e7b79b1e65e29af3
* | Infrastructure of Always-on tracingAhan Wu2020-08-281-2/+5
|/ | | | | | | | | | | | | | | | The aot infrastructure for instrumenting CUJs. The usage is like below: AlwaysOnTraceManager.init(view /* one in the view tree */); AlwaysOnTraceManager.begin(); ... AlwaysOnTraceManager.end(); Bug: 158756171 Bug: 163514962 Bug: 162483077 Test: Manually Test: atest FrameworksCoreTests Change-Id: I570a760d4f3b71e86f19172d8f595e558369ff65
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I5be7335b23a92b8ac80d2fd890198273b66ad644
* Add GPU draw stats to gfxinfo and GraphicsStatsServiceStan Iliev2019-08-011-1/+1
| | | | | Test: ran dumpsys with gfxinfo and graphicsstats Change-Id: Id9950de87dc4343c6878baa6a6dd42fbc8aeddef
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | For packages: android.view.textservice android.view.textclassifier.logging android.view.textclassifier android.view.inputmethod android.view.autofill android.view.accessibility android.view This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I4147b038ed7adf0311ee9918b44766f82a057eaf
* Added VSYNC and INTENDED_VSYNC timestamps to FrameMetrics API.Bryan Cassell2017-02-221-1/+27
| | | | | | | | | | BUG: b/31650117 Test: cts-tradefed run singleCommand cts --skip-device-info --skip-preconditions -m CtsViewTestCases -t android.view.cts.FrameMetricsListenerTest Change-Id: I8341809b6dac420859dad8c21f30d4ee8897425d
* Fix @links in reference docs. am: 54de77470d am: ab978c035e am: 28ba4722a9Elliot Waite2017-01-261-1/+1
|\ | | | | | | | | | | am: 9b21265b2c Change-Id: If246ebdb36cf2832d5a6c42cbe752e290b6fb6e8
| * Fix @links in reference docs.Elliot Waite2017-01-251-1/+1
| | | | | | | | Change-Id: I40cea46efd80c448640ff69753698fe8404da40b
* | Fix import statement in view|transition|animation packages.Aurimas Liutikas2016-10-121-1/+0
|/ | | | | | | This change also remove trailing whitespace. Test: code still compiles Change-Id: I7eff4546320d67d2bae58d31bad0625ea0791b8f
* Fix FrameMetricsObserver crashJohn Reck2016-08-021-1/+1
| | | | | | | | | | Bug: 30587465 Someday maybe the technology will exist to allow sharing a simple constant between Java and C++, but today is not that day. Change-Id: I17694746cb8712058133cd5ea10c47b9909f740b
* FrameMetricsListener API council changesAndres Morales2016-04-211-1/+2
| | | | | Bug: 28296251 Change-Id: I8fe0d8b37c0a3220666570f242f9c20fa16b78ab
* updates to FrameStatsObserver APIAndres Morales2016-02-091-0/+281
- Rename to FrameMetrics to avoid collision with existing android.view.FrameStats class - Make FrameMetricsObserver implementation detail, exposing FrameMetricsListener interface as public API and wrapping in FrameStatsObserver to maintain state - Remove dropped frame count call, in favor of passing as parameter to callback method. - Move away from raw timestamp access in favor of Metric IDs which represent higher-level, more stable stages in a frame lifecycle and match the categories exposed in the onscreen bars. - Support many-to-many Window<->FrameMetricsListener relationship Change-Id: I00e741d664d4c868b1b6d0131a23f8316bd8c5c2