Perfetto shows GPU events as bars after the timestamp, should they not be before the timestamp #1629
-
|
GPU events are captured on the device as gpu_counter_event's. That event has a timestamp and a list of counter ids/values What it does not have is an explicit duration, or end time. Instead the duration has to be derived from two sequential gpu_counter_event's. The issue I see in the perfetto UI is that it takes the value at the first event, and draws a bar until the time of the next event. That is conceptually simple, but has the issue that all the counted events the bar represents did not happen in the time period perfetto shows the bar, all of them did happen in the time period since the prior (and not the next) gpu_counter_event. compare this to how AGI displays the same data it also uses rectangles to display counter values, but it picks the value of the end event for the box height (not the start as perfetto does). This results in that all the visualized events are shown in the time span during which the non-fragment GPU code did run. PS: I do work on sokatoa which uses perfetto as its base for displaying the timeline. So for us displaying the counter values at the right time is important. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
There was a very long internal thread about this in Feb about this very issue where the conclusion was some internal team wanted to send a patch to fix this issue in trace processor by changing how these events are parsed However that was conditioned on "when they get the time to do this". I think that never ended up happening. Let me send the patch to fix this given I basically know exactly what needs to be done. |
Beta Was this translation helpful? Give feedback.
-
|
That's a lot for the quick fix. It was merged before I had the time to look at the PR :-). Now the counts are below the non-fragment vertex queue entries :-)
not sure what 'undo the delta encoding in trace processor' references, can you provide a link? I don't think there is a reliable way to know if a specific counter has the number of events which happen since the last event, vs the counter represents a 'full' value say a ratio, or number used memory in bytes. For some counters we could know, say if they have a unit like a ratio (events/second). |
Beta Was this translation helpful? Give feedback.



There was a very long internal thread about this in Feb about this very issue where the conclusion was some internal team wanted to send a patch to fix this issue in trace processor by changing how these events are parsed
However that was conditioned on "when they get the time to do this". I think that never ended up happening. Let me send the patch to fix this given I basically know exactly what needs to be done.