ui: Support filtering Day Explorer flamegraph by selected tracks - #7031
ui: Support filtering Day Explorer flamegraph by selected tracks#7031sanath099 wants to merge 1 commit into
Conversation
Pass track_id and root status to Day Explorer tracks, and use them in computeDayExplorerFlameGraph to construct a recursive query filtering by selected tracks and their descendants. Bug: 482033855
🎨 Perfetto UI Builds
|
| renderer, | ||
| tags: { | ||
| kinds: [DAY_EXPLORER_TRACK_KIND], | ||
| trackId: trackId.toString(), |
There was a problem hiding this comment.
Does this need to be a string? Does Perfetto not accept this being a number?
| tags: { | ||
| kinds: [DAY_EXPLORER_TRACK_KIND], | ||
| trackId: trackId.toString(), | ||
| isLabelRoot: isRoot && name.startsWith('[Label]'), |
There was a problem hiding this comment.
This is pretty tightly coupled with the google3 side. I think it would make more sense to encode this into the hierarchy. For example, it could be that every hierarchy root is a single root that avoids overlapping count. E.g.
- Regular (root 1)
- Screen on
- Screen off
- [Label] Media playback (root 2)
- etc
| trackInfo?.tags?.kinds?.includes(DAY_EXPLORER_TRACK_KIND) && | ||
| trackInfo.tags.trackId !== undefined | ||
| ) { | ||
| if (trackInfo.tags.isPhysicalRoot === true) { |
There was a problem hiding this comment.
nit: why the additional nested if?
if (
trackInfo?.tags?.kinds?.includes(DAY_EXPLORER_TRACK_KIND) &&
trackInfo.tags.trackId !== undefined &&
trackInfo.tags.isPhysicalRoot === true) {
| // to only include energy from the selected tracks and their recursive descendants. | ||
| // If a physical track is selected, we exclude label roots to avoid double-counting. | ||
| const selectedTrackIds: bigint[] = []; | ||
| let hasPhysicalSelected = false; |
There was a problem hiding this comment.
This is only looking for roots, so this can still overcount. For example:
[ ] - Screen on
[x] - Compute
[x] - Networking
[ ] - Screen off
[ ] - Compute
[ ] - Networking
[ ] - [Label] Media
[x] - Compute
[ ] - Networking
And this is probably worse even, since you lose the context of being under the label. Though, it's arguably a bad idea for someone to select like this :)
The original motivation for not filtering by track was to ensure all area selections had context. Additional filtering could be done on the flame chart.
I wonder if a better solution is to try to find the root for every track in the area selection. It would still allow overcounting, but only if you explicitly select tracks from regular and label tracks. And, if you do, you would at least have the appropriate context. But it would be better than today where it always shows the label tracks.
Pass track_id and root status to Day Explorer tracks, and use them in computeDayExplorerFlameGraph to construct a recursive query filtering by selected tracks and their descendants.
Bug: 482033855
Welcome to Perfetto!
Make sure your PR has a bug/issue attached or has at least
a clear description of the problem you are trying to fix.
For more details please see
https://perfetto.dev/docs/contributing/getting-started