Status Update
Comments
cc...@google.com <cc...@google.com> #2
I think at this level of depth, you're best off writing queries within ui.perfetto.dev
to navigate (type ':' in the search bar to start querying in the main view), since we don't have a way to navigate you to those sections, or give you more information about them.
E.g. in ui.perfetto.dev, write the query:
SELECT * FROM slice
INNER JOIN thread_track on slice.track_id = thread_track.id
INNER JOIN thread USING(utid)
INNER JOIN process USING(upid)
WHERE (process.name like "<PROCESS_NAME>" and slice.name like "<SLICE_NAME>") ORDER BY dur DESC
LIMIT 10
Note that if you select all of the info from the slice table ("SELECT * from slice" at the beginning), you can click any of these slices in the query result at the bottom to jump right to them.
You can then turn this into a metric, e.g. mapping the results from that query to measurements.
I think maybe on macrobench side, things to improve are:
-
document or more easily support this sort of query (public version of traceProcessor.querySlices for example, which queries everything and filters to targetPackage if desired)
-
give metrics (or some parallel system) a way to link you to interesting parts of the trace (which may become more possible with Studio support for ui.perfetto.dev linking)
ml...@google.com <ml...@google.com> #3
I thought something a bit different, not sure I have it specified in my mind anyway (need to think about it)
Something more like this: I have a parent section, for example Compose:recompose
, which might have multiple children that should show one after another (serial execution).
I'd like to get the longest children sections to basically understand what takes the longest within a given parent.
This gives us a framework to get information what executes the longest in traces and where we might spend the most time optimizing.
Description
Would it be possible to retrieve
N
longest trace sections given some criteria?Let's say I have benchmarks on CI that track regular metrics like startup or frames. Alternatively, I'm exploring some app and don't have much information about it.
To better understand where should I focus, I would like to understand the most impactful trace sections within a section to understand what might contribute the most to janky UI.
Technically, I could dive into the perfetto trace and create a query that would order N slices by
dur
, but could we do something like this from metrics? Something like "give me 10 longest sections withinCompose:recompose
section` when composition tracing is enabled.I'm not sure metric outputs would be ready for something like this and/or if this is reasonable/feasible.