███████╗██████╗ █████╗ █████╗ ██╔════╝██╔══██╗██╔══██╗██╔══██╗ ███████╗██████╔╝███████║███████║ ╚════██║██╔═══╝ ██╔══██║██╔══██║ ███████║██║ ██║ ██║██║ ██║ ╚══════╝╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝
Stack Profile for Agentic Analysis
SPAA is a file format and toolset designed to convert raw profiler output into a structured, queryable format that AI agents can analyze using simple command-line tools.
Install with Cargo
cargo install spaa| Raw Traces | SPAA |
|---|---|
| Huge files (100MB+ for less than 1 minute of profiling) | Pre-aggregated stacks reduce size 10-100x |
| Binary or tool-specific formats | NDJSON - each line is self-contained JSON |
| Requires specialized parsers | Queryable with grep, jq, head, tail |
| Redundant data (same stack thousands of times) | Each unique stack appears once with weights |
| Implicit semantics | Explicit metrics, frame order, and event types |
SPAA files are designed so agents can incrementally access exactly what they need — without loading the entire file into context.
Understand the profiler, metrics, and file structure from just the first line (header).
Filter for specific record types — stacks, frames, threads, or samples.
Extract exactly what you need with powerful JSON queries and transformations.
Convert from DTrace, Chrome DevTools, perf, and more. Unified format for all your profiling data.
Track allocations, deallocations, and memory leaks with dedicated metrics like live_bytes and alloc_count.
Deterministic stack IDs enable diffing across profile runs for regression detection.
Preserves full fidelity of profiler data. NDJSON format enables single-pass streaming parsers.
Give your AI coding agent the ability to analyze performance profiles with a single command.
npx skills add andrewimm/spaa{
"type": "header",
"format": "spaa",
"version": "1.0",
"source_tool": "dtrace", // Tool that generated the original profile
"frame_order": "leaf_to_root", // How frames[] are ordered in stack records
"events": [{
"name": "profile-997", // Referenced by stack.context.event
"kind": "timer",
"sampling": {
"mode": "frequency",
"primary_metric": "samples", // Authoritative weight for this event
"frequency_hz": 997
}
}]
}{
"type": "stack",
"id": "0xabc123", // Content-addressable ID for cross-file diffing
"frames": [101, 77, 42], // References frame.id records (leaf first)
"context": {
"event": "profile-997", // References header.events[].name
"tid": 1234 // References thread.tid (if present)
},
"weights": [{
"metric": "samples", // Must match event's primary_metric
"value": 847
}]
}{
"type": "frame",
"id": 101, // Referenced by stack.frames[]
"func": "mycrate::parse::parse_file",
"dso": 12, // References dso.id record
"ip": "0x401234", // Instruction pointer address
"srcline": "src/parse.rs:214", // Source location (file:line)
"kind": "user" // user | kernel | native | jit | interpreted
}Install SPAA and start converting your profiling data into an AI-friendly format today.