Read a trace table
trace_queryPages through rows or time windows of a GPU trace table, filtering, ordering, grouping and aggregating them to inspect per-process frame pacing, durations and counts.
Instructions
Returns one page of rows of one table of a recording as {column: value}, optionally one process's. With window_ms the page holds time windows instead ({start_ms, count}, plus duration_ms when the table has a duration column). Rows come from the .trace when kept, else from the tables file; where, columns, order_by with descending, and group_by with aggregates filter and summarize the tables file (never SQL) and need it.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"trace": "<trace>",
"schema": "<schema>"
},
"name": "trace_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | No | keep only this process's rows | |
| limit | No | default 50, at most 500 | |
| trace | Yes | a run name from perf_runs with trace_kept or tables_kept true, or a .trace path | |
| where | No | tables file only, joined by AND: {column, op, value}, op one of = != < <= > >=; a time or size column holds its number as text: compare with a number | |
| fields | No | result paths to keep, dotted: common.frame_pacing | |
| offset | No | default 0 | |
| schema | Yes | a table name that trace_tables lists, such as metal-gpu-intervals | |
| columns | No | tables file only: keep these columns | |
| group_by | No | tables file only: group rows by these columns (each group gets its count) | |
| order_by | No | tables file only: a column, or with group_by an aggregate name such as count or sum_duration | |
| window_ms | No | 1 to 3600000: time windows of this many ms instead of rows (needs a start or time column) | |
| aggregates | No | tables file only: {fn, column}, fn count, sum, avg, min or max; named fn_column | |
| descending | No | with order_by, largest first |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | ||
| total | Yes | ||
| offset | Yes | ||
| next_offset | Yes |