Skip to content

tp: Add GpuCorrelation TrackEvent extension for host-GPU linking#5425

Merged
dreveman merged 1 commit intomainfrom
dev/reveman/gpu-flow-te
Apr 14, 2026
Merged

tp: Add GpuCorrelation TrackEvent extension for host-GPU linking#5425
dreveman merged 1 commit intomainfrom
dev/reveman/gpu-flow-te

Conversation

@dreveman
Copy link
Copy Markdown
Collaborator

@dreveman dreveman commented Apr 8, 2026

Add a GpuCorrelation TrackEvent extension (field 3000) that allows host-side track events to declare correlations with GPU render stage events:

  • render_stage_submission_event_ids: correlates this slice with the GPU render stage events it submitted (e.g. cudaLaunchKernel).
  • render_stage_wait_event_ids: indicates this slice waited on the specified GPU render stage events to complete (e.g. cudaMemcpy).

The extension is defined in gpu_track_event.proto using the perfetto_gpu allocation (3000-3099) in track_event_extensions.json. The trace processor loads the extension descriptor and creates flow arrows between the correlated slices via GpuTracker.

@dreveman dreveman requested a review from a team as a code owner April 8, 2026 20:01
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

@dreveman
Copy link
Copy Markdown
Collaborator Author

dreveman commented Apr 8, 2026

@LalitMaganti I switched to using an extension for the second part of the GPU correlation that requires track event integration. I can think of at least one more immediate use-case of this extension; tagging track events as representing GPU API calls. E.g. a cudaLaunchKernel track event can be tagged with Api::CUDA in a similar way as how we tag render stages.

@dreveman dreveman requested a review from LalitMaganti April 9, 2026 16:14
@LalitMaganti LalitMaganti requested a review from primiano April 9, 2026 23:19
@LalitMaganti
Copy link
Copy Markdown
Member

I'm going to defer this to Primiano since he's been thinking a lot about TrackEvent extensions and about whether this makes sense.

Copy link
Copy Markdown
Member

@primiano primiano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to defer this to Primiano since he's been thinking a lot about TrackEvent extensions and about whether this makes sense.

I didn't look at the c++ code that does the parsing in TP, but I assume the question for me is about the proto / track event extension.
I am positive about it. in hindsight this is the way we should deal with all these track event extensions, and leave the inline ones only for core types that everybody should be able to see in the SDK

@LalitMaganti can you PTAL to the trace processor part?

Comment thread src/trace_processor/importers/proto/track_event_event_importer.h Outdated
Add a GpuCorrelation TrackEvent extension (field 3000) that allows
host-side track events to declare correlations with GPU render
stage events:

- render_stage_submission_event_ids: correlates this slice with
  the GPU render stage events it submitted (e.g. cudaLaunchKernel).
- render_stage_wait_event_ids: indicates this slice waited on the
  specified GPU render stage events to complete (e.g. cudaMemcpy).

The extension is defined in gpu_track_event.proto using the
perfetto_gpu allocation (3000-3099) in track_event_extensions.json.
The trace processor loads the extension descriptor and creates flow
arrows between the correlated slices via GpuTracker.
@dreveman dreveman merged commit e903a2e into main Apr 14, 2026
23 checks passed
@dreveman dreveman deleted the dev/reveman/gpu-flow-te branch April 14, 2026 15:49
beckysiegel pushed a commit to chromium/chromium that referenced this pull request Apr 28, 2026
Upstream Perfetto has a dependency on a new descriptor file,
gpu_track_event.descriptor (introduced in
google/perfetto#5425 and rolled into Chromium
in
https://chromium-review.git.corp.google.com/c/chromium/src/+/7762804).
This CL adds the descriptor file's path to the `run_perfetto_diff_tests`
command.

PERFETTO_TESTS=Will pass once
google/perfetto#5627 is rolled into Chromium

Bug: 507066166
Change-Id: I245472f85174430f659f39a55ddc6d14d32c8736
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7799735
Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
Auto-Submit: Petr Cermak <petrcermak@chromium.org>
Commit-Queue: Petr Cermak <petrcermak@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1621845}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants