Fixed
Status Update
Comments
ra...@google.com <ra...@google.com> #3
Moving this to Benchmark 1.4 because we need to investigate if there are other reasons for us to be using the sub-expression slice.parent_stack_id = 0
.
lo...@gmail.com <lo...@gmail.com> #4
I also have this issue on Android 14. i see that there's another slice that has Choreographer#doFrame as its child: "`android.view.Choreographer$FrameDisplayEventReceiver@b5d5d6e Handler (android.view.Choreographer$FrameHandler) `"
I attached screenshot from perfetto
I attached screenshot from perfetto
ra...@google.com <ra...@google.com>
ra...@google.com <ra...@google.com> #5
Should be addressed by aosp/3498998
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
Author: Rahul Ravikumar <
Link:
No longer assume Choreographer#doFrame
is the top of the stack frame on the main thread for FrameTimingQuery.
Expand for full commit details
No longer assume `Choreographer#doFrame` is the top of the stack frame on the main thread for FrameTimingQuery.
* This is no longer necessary given we explicitly filter out `resynced`-ed frames.
Test: Existing FrameTimingQueryTests pass.
Fixes: 340206285
Relnote: No longer assume `Choreographer#doFrame` is the top of the stack frame on the main thread for FrameTimingQuery.
Change-Id: Iee0e0bec02e2af6f675b48384d14a59569b3dc57
Files:
- M
benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/FrameTimingQuery.kt
Hash: ae475a6c5e1fcaade64047f487e425643fcef368
Date: Tue Feb 18 15:33:26 2025
na...@google.com <na...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.benchmark:benchmark-macro:1.4.0-alpha09
Description
Component used: Version used: Latest (1.3.0-alpha04) Devices/Android versions reproduced on: all devices
TL;DR
Macrobenchmark tests fails with
IllegalArgumentException: At least one result is necessary
when usingFrameTimingMetric
together with tooling that adds trace sections to the root of the main thread section stacks. See attached screenshot for an example of what that might look like.Details
FrameTimingQuery
(Unfortunately, this assumption is broken when 3rd party code inserts additional sections to the top of the main thread section stack.
For example, the papa library adds a top trace section to every running main thread section ( source ), leveraging the logged name provided through
Looper.getMainLooper().setMessageLogging()
(see screenshot for what that looks like).Side note 1: I'm aware that
Looper.getMainLooper().setMessageLogging()
wasn't exactly designed for this purpose, but having toString() details for all messages that run on the main thread is incredibly useful to help understand perfetto traces. Ideally there would be a dedicated API to help understand what runs on main.Side note2: if anyone using papa runs into this issue, you can disable the additional tracing with a boolean resource override for
R.bool.papa_trace_main_thread
. Unfortunately that will make your perfetto traces a lot less easy to investigate.