Adds generic GPU TrackEvent support across Perfetto - #6923
Open
dreveman wants to merge 12 commits into
Open
Conversation
🎨 Perfetto UI Builds
|
Collaborator
Author
|
@LalitMaganti You might want to look at the individual commits as the full set of commits does a lot. This PR provides a complete picture but we can land each commit as a separate PR if you prefer. |
Member
|
Still out on vacation for another week and a bit so will take a look when I'm back. |
dreveman
force-pushed
the
dev/dreveman/generic-gpu-tracks
branch
from
July 31, 2026 17:48
fe2e88c to
1514129
Compare
Collaborator
Author
No worries. I iterated on this approach some and I think the current version is now something I'm pretty happy with and provide all the features I was missing from perfetto when it comes to GPU workloads. |
dreveman
force-pushed
the
dev/dreveman/generic-gpu-tracks
branch
from
July 31, 2026 18:12
1514129 to
53aa55e
Compare
Allow a GPU TrackEvent root to inherit process ownership from a parent process TrackDescriptor while retaining its producer-authored GPU hierarchy.
Allow GPU TrackDescriptors to bind hardware or process logical queues. Project matching render stages through the descriptor's native sibling-merge factory while preserving canonical GPU slices and flows.
Treat authored GPU TrackEvent trees as authoritative for their global or process scope. Keep the existing inferred hierarchy only when no authored tree is present.
Share the common interning logic between GPU tracks with known and unspecified GPU IDs. Keep the blueprint and dimension differences at the two call sites.
Use the authored parent descriptor UUID to isolate process-associated GPU roots. This removes the need for process-specific GPU merge blueprints and factory branches.
Expose canonical-to-projected render stage slices through one internal PerfettoSQL relation. Reuse it across the global, per-process, and compute GPU views while keeping temporary filtering state query-scoped.
Filter ambiguous authored GPU placement anchors in SQL. This removes temporary candidate maps, null sentinels, and the associated cleanup logic.
Accumulate every canonical, hardware, and logical render stage slice for an event ID instead of overwriting each representation. This preserves dependency flows when producers reuse event IDs.
dreveman
force-pushed
the
dev/dreveman/generic-gpu-tracks
branch
from
August 4, 2026 17:40
53aa55e to
c38540e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds generic GPU timelines built from standard
TrackDescriptorandTrackEventpackets. Producers can control GPU hierarchy, naming, ordering,annotations, counters, and state tracks without adding API-specific
hierarchy fields.
GPU hierarchy uses ordinary
parent_uuidrelationships. Process-scopedconcepts such as CUDA streams are associated with a process by parenting the
GPU root to a process
TrackDescriptor.Render-stage integration
GpuTrackDescriptorcan bind an exact authored track to either:oneof render_stage_queue { uint64 hw_queue_iid = 2; uint64 logical_queue_id = 3; }Matching
GpuRenderStageEvents are projected onto that authored track whileremaining available as canonical
gpu_slicerows. Authored annotations andprojected render-stage events use normal TrackEvent sibling merging:
sibling_merge_keyprovides an explicit merge identity;SIBLING_MERGE_BEHAVIOR_NONEkeeps the sources separate.This lets producers add annotations directly to hardware or logical queue
tracks. For example, a producer can emit iteration ranges, scheduling
phases, queue-saturation intervals, or instant markers on the bound
descriptor. Annotations are displayed on the same visual track as the
matching GPU work, without duplicating render-stage events in the producer.
Flow relationships are mirrored onto projected representations without
creating cross-hierarchy or Cartesian duplicate flows.
Hardware queue IDs are scoped to the trusted packet sequence. Logical queue
IDs are scoped to the process resolved from the render event's graphics
context.
UI behavior
A global GPU descriptor introducing a concrete
gpu_idacts as theplacement anchor for that GPU. Existing frequency, memory, counters, and
other GPU-specific tracks become direct children of the anchor. This avoids
synthetic structures such as
Counters -> GPU N.For example, a producer can create:
Process-owned hierarchies can similarly represent logical concepts:
Only successfully bound hardware or logical queues move into authored
locations. Unbound sources remain in the existing fallback hierarchy, so
authored and inferred tracks can coexist.
Traces without generic GPU descriptors retain the current UI hierarchy,
naming, and ordering.
Other changes
TrackEventPluginremains generic.
documentation.
perfetto-protos-gputo1.0.3.