Show HN: Xtrace – Unix-Style macOS Profiling for Instruments (CPU/GPU/Memory)

github.com

2 points by Krisso a day ago

I built this because I wanted a terminal-first profiling workflow on macOS, without constantly switching into the Instruments GUI.

What it does today:

- CPU analysis: summary, timeline, calltree, collapsed stacks, flamegraph, diff

- GPU analysis (trace-gpu.py): active/idle ratios, command-buffer cadence, process ownership

- Memory analysis (trace-memory.py): summary, leaks, growth, heap/regions

- Recording modes: launch, attach by PID/name, wait-for spawn, system-wide

- Root-aware attach flow for protected/root-owned processes

- JSON output for automation/LLM workflows (I use it in autoresearch loops: hypothesis → experiment → keep/discard)

Other notes:

- macOS only (Instruments/xctrace)

- core analysis is Python stdlib (no pip deps)

- optional tools: speedscope + inferno for best visualization

Would love feedback on workflow, rough edges, and what integrations would make this more useful.