perfetto-ui: Fix slices disappearing bug The last few slices in a track were sometimes disappearing. The data arrays were set to the length of totalSlices - which correctly calculated that the data length should be the count(big slices) + count(distinct grouping, depth of slices to be summarized). What went wrong was that the final data was ordered by ts, percent which meant that the data was ordered without regard for the depth. (ordering by ts already accounts for the grouping). For example data looked like this: grouping | depth | percent 764 | 1 | 0.6 764 | 2 | 0.2 764 | 1 | 0.1 When creating the final slices - line 1 and 3 would end up being separate slices, but we want them to be one summarized slice. This pushed the number of slices to be > totalSlices which was why the final slices were disappearing. So the solution is to ensure the data is sorted by depth before percent. Bug: 158297138 Change-Id: I6a8f1caee1bf388aba986b8d1c3d904018b7c554
Perfetto is a production-grade open-source stack for performance instrumentation and trace analysis. It offers services and libraries and for recording system-level and app-level traces, native + java heap profiling, a library for analyzing traces using SQL and a web-based UI to visualize and explore multi-GB traces.
See https://docs.perfetto.dev or the /docs/ directory for documentation.