I export GPU counters with xcrun xctrace export --xpath '/trace-toc/run[@number="1"]/data/table[@schema="gpu-counter-value"]' (Metal System Trace + Metal GPU Counters, compute workload) and need to confirm two columns.
On an M5 Max (macOS 27.0.1, Xcode 26.5, counter profile "Performance Limiters", 88 counters) the rows come in three groups with different periods: 74 counters every 20.2 µs, 6 texture counters every 30.9 µs, 8 bandwidth/MMU/LLC counters every 50.0 µs. Each group has its own sample-index sequence; the indices of the groups drift apart by thousands within seconds. On an M1 Pro (macOS 26.7.1, Xcode 26.4.1, 31 counters) every period appears twice, with ring-buffer-index 0 and 1, the second copy timestamped ~35 µs later.
- Is timestamp the sampling time of the row, and does value describe the interval since the previous sample of that counter or an instantaneous reading?
- Is sample-index a per-group sequence number, or a key meant to join all counters of one sampling period? How should counters from groups with different periods be combined for one time window?
- On M1 Pro, are ring-buffer-index 0 and 1 two readings of the same period (use one) or two independent samples?
Thanks in advance!
Best,
Lin