perf_record
Records a Wine or macOS program, or a fetched test workload, with Metal System Trace for a set duration and returns GPU ms per frame, frame intervals, FPS, and memory summary.
Instructions
Records program (an .exe under Wine, or a macOS binary with wine="native"), or a test program fetched with
workload_fetch (workload, api, dim), for seconds with Metal System Trace and returns its summary: GPU ms per
frame, frame intervals, FPS, Metal and resident memory (memory=false skips the Metal memory table, the slowest
to read). When it ends it stops every program of that Wine prefix (wineserver -k), or every process named like
the program with native. counters=true also records Metal GPU Counters (gpu_counters in the summary: the units the
GPU waited on, its utilization, occupancy and memory bandwidth); it adds about 40 s of read-back per recorded second.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api | No | with workload: mtl (native Metal), mtl-x64 (Metal built for x86_64, run under Rosetta like Wine), vk (Vulkan through MoltenVK: set METAL_TRACE_MOLTENVK), d3d11 or d3d12 (under wine) | |
| dim | No | with workload drawstress: side of the cube grid, dim^3 draws per frame | |
| env | No | NAME=VALUE pairs separated by spaces, set in the program's environment | |
| args | No | program arguments as in a shell, quotes included | |
| size | No | with a workload that has size_variables (drawstress): the window size, WIDTHxHEIGHT such as 1920x1080 | |
| wine | No | Wine directory holding bin/wine, or native | |
| label | Yes | name for the run: letters, digits, '.', '_', '-' | |
| memory | No | default true; false skips the Metal memory table, the slowest to read (about 40 % faster summary): no metal_mib_peak | |
| prefix | No | Wine prefix, default WINEPREFIX or ~/.wine; ignored with native | |
| example | No | with a workload that lists examples in workload_list: the one to run | |
| program | No | path of the .exe, or of the macOS binary with wine=native | |
| seconds | No | recording length, default 20; use 30 under Wine, whose start-up takes part of it; the export afterwards takes several minutes under Wine | |
| workdir | No | directory the program starts in, default the program's own | |
| counters | No | default false; true also records Metal GPU Counters (gpu_counters in the summary); not under Windows; adds about 40 s of read-back per recorded second | |
| workload | No | a test program from workload_list, fetched with workload_fetch, instead of program | |
| background | No | macOS only, default false; true runs the program under taskpolicy -b, which throttles it hard and unevenly (drawstress: 18 to 280 times slower): repeat the run | |
| memory_free_pct | No | macOS only, 20 to 60: holds the whole Mac at this percentage of RAM free while recording (memory_pressure), to see how the program behaves short of memory; lower can freeze the Mac |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||