Self-instrumentation library for rsprof.
This crate provides CPU and heap profiling through self-instrumentation:
- CPU profiling: Timer-based sampling using SIGPROF
- Heap profiling: Custom allocator that tracks allocations
Usage
Add to your Cargo.toml:
[]
= { = "0.1", = ["profiling"] }
For CPU profiling only:
For heap profiling, use the global allocator:
static ALLOC: ProfilingAllocator = ProfilingAllocator;
Build with frame pointers for accurate stack traces:
RUSTFLAGS="-C force-frame-pointers=yes"