flamegraph  by flamegraph-rs

Rust CLI tool for generating flamegraphs

created 6 years ago
5,393 stars

Top 9.5% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a Rust-native flamegraph generator, simplifying performance analysis for Rust projects and arbitrary binaries without requiring Perl or external pipes. It targets developers and system administrators needing to identify performance bottlenecks.

How It Works

The tool leverages the inferno Rust library for generating flamegraphs from sampled stack traces. It supports various profiling backends including perf on Linux, dtrace on macOS, and a native blondie library on Windows. This allows for cross-platform profiling with a single, consistent Rust-based tool.

Quick Start & Requirements

  • Install via cargo install flamegraph.
  • Linux: Requires linux-perf.
  • macOS: Requires dtrace (run with sudo).
  • Windows: Native support via blondie or dtrace if installed.
  • For Rust projects, use cargo flamegraph. For arbitrary binaries, use flamegraph -- /path/to/binary.
  • Official documentation: https://github.com/flamegraph-rs/flamegraph

Highlighted Details

  • Cross-platform support (Linux, macOS, Windows) with native Rust backends.
  • Integrates seamlessly with cargo for profiling Rust applications.
  • Supports profiling running processes via PID.
  • Offers options to control sampling frequency, disable inlining, and customize output.

Maintenance & Community

The project is actively maintained. Community support channels are not explicitly mentioned in the README.

Licensing & Compatibility

  • MIT License.
  • Permissive license suitable for commercial use and integration into closed-source projects.

Limitations & Caveats

Profiling release builds may sometimes yield less detailed information due to optimizations, though debug = true in Cargo.toml can mitigate this. Ubuntu aarch support for perf is noted as not working, recommending Debian or a PR.

Health Check
Last commit

2 weeks ago

Responsiveness

1 day

Pull Requests (30d)
3
Issues (30d)
1
Star History
240 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.