tp: Add gpu_context table for InternedGraphicsContext#5523
Open
tp: Add gpu_context table for InternedGraphicsContext#5523
Conversation
🎨 Perfetto UI Builds
|
22eb082 to
642e99e
Compare
642e99e to
195ff6e
Compare
Add a new gpu_context table that maps GPU graphics context IDs to their associated process ID and API type (OPEN_GL, VULKAN, OPEN_CL, CUDA, HIP). This resolves the TODO in gpu_event_parser.cc to create a proper table for graphics context data. Previously, the context field on GpuRenderStageEvent was used to look up InternedGraphicsContext but only the pid was extracted -- the api field was ignored and no structured table existed for context metadata. Now the full context metadata is materialized into a queryable table. The table is populated lazily: each unique context_id is inserted on first encounter during GpuRenderStageEvent parsing. The view is exposed via a new gpu module under std at std.gpu.context, accessible with INCLUDE PERFETTO MODULE std.gpu.context. Schema: gpu_context(id, context_id, pid, api) Example query: INCLUDE PERFETTO MODULE std.gpu.context; SELECT gc.api, gs.name, gs.dur FROM gpu_slice gs JOIN gpu_context gc ON gs.context_id = gc.context_id WHERE gc.api = 'CUDA' Related: #5097
195ff6e to
ab089d3
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.
Add a new gpu_context table that maps GPU graphics context IDs to their associated process ID and API type (OPEN_GL, VULKAN, OPEN_CL, CUDA, HIP). This resolves the TODO in gpu_event_parser.cc to create a proper table for graphics context data.
Previously, the context field on GpuRenderStageEvent was used to look up InternedGraphicsContext but only the pid was extracted -- the api field was ignored and no structured table existed for context metadata. Now the full context metadata is materialized into a queryable table.
The table is populated lazily: each unique context_id is inserted on first encounter during GpuRenderStageEvent parsing.
The view is exposed via a new gpu stdlib module at gpu.context, accessible with INCLUDE PERFETTO MODULE gpu.context.
Schema:
gpu_context(id, context_id, pid, api)
Example query:
INCLUDE PERFETTO MODULE gpu.context;
SELECT gc.api, gs.name, gs.dur
FROM gpu_slice gs
JOIN gpu_context gc ON gs.context_id = gc.context_id
WHERE gc.api = 'CUDA'
Related: #5097