chrome_main_thread_hotspots
Identify the longest Chrome main-thread tasks causing jank by wall duration, CPU overlap, and thread time. Filter by process, page load phase, or time window to pinpoint scroll or load stalls.
Instructions
Top Chrome main-thread tasks by wall duration: id, ts, name, task_type, thread_name, process_name, upid, pid, nullable machine_id, dur_ms, overlap_dur_ms, full_task_cpu_pct/full_task_thread_dur_ms, overlap_cpu_pct/overlap_thread_dur_ms; legacy cpu_pct/thread_dur_ms are full-task. Uses chrome.tasks, thread.is_main_thread = 1, and Chrome's Cr*Main fallback. Pass a returned id to slice_descendants_breakdown for child-slice breakdowns.
Use when: investigating responsiveness, scroll/load stalls, CPU vs wall time, or one renderer.
Don't use for: non-Chrome traces (will error). For background (non-main) thread tasks, drop to execute_sql against chrome.tasks directly.
Parameters (all optional):
process_name/pid/machine_id/upid: scope to one process/type. Preferupid; addmachine_idto disambiguate multi-machinepids. All filters AND.page_load_id/navigation_id/phase: scope to a page-load window. IDs matchchrome_page_loads.idand.navigation_idrespectively and are mutually exclusive.phase:navigation_to_fcp,navigation_to_load,dcl_to_fcp,fcp_to_load. If an id is set withoutphase, defaults tonavigation_to_fcp; phase-only uses the latest page load.start_ts_ns/end_ts_ns: raw trace timestamp bounds in nanoseconds (end_ts_nsexclusive); aliasesstart_ts/end_tsare accepted; intersect page-load windows.overlap_dur_msis clipped to that window.min_dur_ms: minimum full-task duration, or clipped overlap duration when a window is set. Defaults to 16 ms. Pass 0 for all positive-overlap tasks.limit: max rows (default 100, capped at 5000). Must be > 0 if set.max_string_len: optional cap for returned string cells. Unset preserves full strings for precision. Must be > 0 if set.
Output: metadata-first JSON preserving columns / rows; truncated=true means an extra-row probe found more rows; string_truncated=true means cell text was shortened.
Empty result: no detected main-thread tasks exceeded min_dur_ms at the selected process/window threshold, or the trace uses non-standard main-thread names outside the Cr*Main fallback.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end_ts_ns | No | Optional raw trace timestamp upper bound in nanoseconds, exclusive. This uses the same unit as the returned `ts` column. ANDs with any page-load window. | |
| limit | No | Optional max rows to return. Defaults to 100 and is capped at 5000 to match `execute_sql`. Lower values keep responses short; higher values surface long tails of mid-duration tasks. Accepts both numbers and numeric strings. | |
| machine_id | No | Optional machine id filter for multi-machine traces when the trace schema has `process.machine_id`. ANDs with pid/process filters and disambiguates same pid values on different machines. Accepts numbers and numeric strings. | |
| max_string_len | No | Optional per-string-cell character cap applied to returned rows only. Unset preserves full strings for precision; accepts both numbers and numeric strings. Must be > 0 when set. | |
| min_dur_ms | No | Optional minimum task duration in milliseconds. Defaults to 16 ms (one 60 Hz frame budget). Pass 0 to see ALL main-thread tasks; raise to e.g. 33 (30 Hz) or 100 to focus on the worst stutters. Must be a finite non-negative number. Accepts both numbers and numeric strings. | |
| navigation_id | No | Optional Chrome navigation id used to scope tasks to one navigation phase. Matches `chrome_page_loads.navigation_id`. Mutually exclusive with `page_load_id`. If set without `phase`, defaults to `navigation_to_fcp`. | |
| page_load_id | No | Optional page-load id used to scope tasks to one navigation phase. Matches `chrome_page_loads.id`. Mutually exclusive with `navigation_id`. If set without `phase`, defaults to `navigation_to_fcp`. | |
| phase | No | Optional page-load phase window. If set without `page_load_id` or `navigation_id`, uses the latest page load in the trace. Values: navigation_to_fcp, navigation_to_load, dcl_to_fcp, fcp_to_load. | |
| pid | No | Optional pid filter — the OS-level process ID (visible in Task Manager). Get pid from `list_processes`. ANDs with the other filters when set. Note: pids can be recycled within a long trace; prefer `upid` when precision matters. Accepts both numbers and numeric strings. | |
| process_name | No | Optional process-name filter (e.g. "Renderer", "Browser", "GPU Process"). Useful to scope to one process type without picking a specific instance. | |
| start_ts_ns | No | Optional raw trace timestamp lower bound in nanoseconds. This uses the same unit as the returned `ts` column. ANDs with any page-load window. | |
| upid | No | Optional upid filter — the trace-internal Unique Process ID assigned by trace_processor (also from `list_processes`). Always uniquely identifies one process within a trace, even if the OS recycled its pid. Use this to disambiguate same-named or pid-recycled processes; ANDs with the other filters when set. Accepts both numbers and numeric strings. |