| METALPERFTRACE(1) | General Commands Manual | METALPERFTRACE(1) |
metalperftrace —
collect and inspect Metal GPU performance data
metalperftrace |
subcommand [options] |
metalperftrace |
collect [--last
duration | --start
date --end
date] [--prefix
prefix] [--json]
output_dir |
metalperftrace |
overview [--json]
[--json-include-timeline]
[--include-state-transitions]
[--predicate expr]
[--aggregate] [--start
offset] [--end
offset] [--domain
domain] [--state-label
label] trace_file |
metalperftrace |
listen [--json]
[--interval sec]
[--output file]
[--process name]
[--pid pid]
[--predicate expr] |
metalperftrace |
setup --enable
feature | --disable
feature [--pid
pid] |
metalperftrace collects and inspects
always-on recorded Metal graphics performance data. The system continuously
records frame timing and related statistics for all Metal layers. This tool
retrieves that data and either stores it into a trace file that can be
opened by tools such as Instruments, or streams it live as human-readable
text or JSON.
The following subcommands are available:
collectoverviewlistensetupmetalperftrace
collect [--last
duration | --start
date --end
date] [--prefix
prefix] [--json]
output_dir
--last
duration30s, 5m,
2h, 1d. Mutually exclusive
with --start.--start
dateyyyy-MM-dd,
yyyy-MM-ddTHH:mm:ss,
yyyy-MM-ddTHH:mm:ssZ,
@unix_timestamp. Dates in the future are not
allowed.--end
date--start. Defaults to the current time when
omitted.--prefix
prefixMetalPerfTrace.--jsontraces key. Enabled by default when stdout is not
a terminal.metalperftrace
overview [--json]
[--json-include-timeline]
[--include-state-transitions]
[--predicate expr]
[--aggregate] [--start
offset] [--end
offset] [--domain
domain] [--state-label
label] trace_file
Print per-process, per-layer performance metrics from a collected trace. By default, prints an aggregation over the entire trace duration with full detail for all metric sections.
--json--json-include-timeline--json.--include-state-transitions--predicate
exprprocessName (string), pid
(integer), layerName (string).--aggregate{domain, label,
stableState} keys across all domains.--start
offset--aggregate). Duration format, e.g.
5s, 2m,
1h.--end
offset--aggregate). Defaults to trace end when
omitted.--domain
domain--aggregate).--state-label
label--domain, group by {domain,
label} only, ignoring stableState differences. Requires
--domain.metalperftrace
listen [--json]
[--interval sec]
[--output file]
[--process name]
[--pid pid]
[--predicate expr]
Stream live Metal performance statistics as data arrives from the system. Always prints full detail for all metric sections.
--json--interval
sec, -i
sec1.0. Default:
1.0.--output
file, -o
file--process
name, -p
name--pid
pid--predicate
exproverview subcommand.metalperftrace
setup --enable
feature | --disable
feature [--pid
pid]
Enable or disable a Metal performance trace feature in one or more
running Metal processes. At least one --pid option
is required. Exactly one of --enable or
--disable must be specified.
per-frame-metricsMETAL_PERFORMANCE_PER_FRAME_SIGNPOSTS=1 at
launch.shader-compiler-metricsMETAL_PERFORMANCE_SHADER_COMPILER_STATS_SIGNPOSTS=1
at launch.hudThe metalperftrace utility exits 0
on success, and >0 if an error occurs.
Collect the last 30 minutes of trace data:
metalperftrace collect --last 30m
/tmp/tracesPrint a text overview from a collected trace:
metalperftrace overview
/tmp/traces/trace.atrcExport a JSON summary:
metalperftrace overview --json
/tmp/traces/trace.atrcExport JSON with full per-frame timeline:
metalperftrace overview
--json-include-timeline /tmp/traces/trace.atrcAggregate metrics by state domain:
metalperftrace overview --aggregate
--domain com.example.App /tmp/traces/trace.atrcAggregate for a specific time window:
metalperftrace overview --aggregate
--start 5m --end 10m /tmp/traces/trace.atrcStream live stats filtered to one process:
metalperftrace listen --process
MyGame --interval 2Stream live stats in JSON mode with file logging:
metalperftrace listen --json --output
/tmp/session.jsonEnable per-frame metrics in a running process:
metalperftrace setup --enable
per-frame-metrics --pid 1234| May 7, 2026 | macOS 26 |