StackPulse records CPU stack samples from Linux processes and writes them to a compact file. After capture, it resolves native, Python, JIT, and kernel frames into names and source locations for your profiler.
StackPulse is a library, not a command-line tool, and it requires Linux 6.0 or newer.
Install
[]
= "0.8"
Record a profile
Attach to a running process or launch one under the recorder. While the target
runs, call poll to drain samples into a spool file. Open that file with
Snapshot, then pass its stacks to Symbolizer. The resulting frames are
ready for your aggregator, UI, or exporter.
For example, to record for ten seconds and read back one stack:
use ;
use ;
Read the hosted documentation or build it
locally with make doc.
Support
| Capability | Support |
|---|---|
| Operating system | Linux 6.0 or newer |
| Architectures | x86-64 and AArch64 |
| Native stacks | DWARF and frame-pointer unwinding through Framehop |
| Native symbols | Bundled wholesym backend or a caller-supplied symbolizer |
| Dynamic runtimes | Python perf maps and Python runtime frames |
| Kernel stacks | /proc/kallsyms and System.map fallback |
| Profile files | Writes SPULSE3; reads SPULSE1, SPULSE2, and SPULSE3 |
| Rust version | 1.88 or newer |
Development
If the coverage helper is missing, make coverage prints the install command.
You can pass extra cargo flags through CARGO_FLAGS:
Cargo features
| Feature | Default | Provides |
|---|---|---|
builtin-wholesym |
Yes | Native symbolization through wholesym and Tokio |
debuginfod |
No | Remote debug-file lookup when DEBUGINFOD_URLS is set |
bench-support |
No | Hidden synthetic fixtures used by the benchmark suite |
Consumers that supply SymbolizerBuilder::native can disable default features
to omit wholesym and Tokio.
Two environment variables tune the default backend: STACKPULSE_DEBUG_DIRS
overrides local debug-file search roots, and
STACKPULSE_DEBUGINFOD_CACHE_DIR overrides the debuginfod cache directory.
Permissions
User-space sampling often works with the default perf permissions. Kernel frames,
high sample rates, and restrictive perf_event_paranoid settings may require
CAP_PERFMON or a sysctl change.
License
Licensed under the MIT license.