A Claude Code skill for profiling native (C/C++/Rust) programs using samply and converting the results into AI-friendly markdown.
- samply —
cargo install samplyorbrew install samply - atos — ships with Xcode Command Line Tools (macOS only)
Ask Claude Code to profile a native binary:
Profile
./build-arm/miniruby -e '1_000_000.times { Object.new.singleton_class }'
Claude Code will:
- Record a profile with
samply record - Symbolicate hex addresses to function names with
symbolicate.rb - Convert to markdown with
ff2md.rb - Analyze the results and identify bottlenecks
Resolves unsymbolized hex addresses in a samply profile to function names using atos.
ruby scripts/symbolicate.rb profile.json # overwrites in place
ruby scripts/symbolicate.rb profile.json output.json # writes to separate file
- Groups addresses by library for efficient batch resolution
- Supports gzipped profile input
- Skips system libraries that lack debug symbols
Converts a Firefox-format profile JSON into a markdown report.
ruby scripts/ff2md.rb profile.json > report.md
The report includes:
- Top functions by self time and total time
- Category breakdown (user/kernel)
- GVL state timeline (for Ruby profiles via Vernier)
- Full call tree with percentages
- Symbolication via
atosis macOS-only. On Linux, samply typically symbolicates automatically if debug info is available. - System libraries (dyld, libsystem_*) usually remain unsymbolized since they lack debug symbols.