# 使用 Homebrew, apk, Nix, pacman, dnf, MacPorts 安装 cargo-flamegraph

查看 cargo-flamegraph 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:cargo-flamegraph
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install cargo-flamegraph
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install flamegraph
```

  证据: MacPorts ports tree: devel/flamegraph/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add cargo-flamegraph
```

  证据: Alpine Linux edge package indexes: cargo-flamegraph from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#cargo-flamegraph
```

  证据: nixpkgs package indexes: pkgs/by-name/ca/cargo-flamegraph/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S cargo-flamegraph
```

  证据: Arch Linux sync databases: cargo-flamegraph from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- dnf (92%):

```sh
sudo dnf install flamegraph
```

  证据: Fedora Rawhide package metadata: flamegraph from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

## 软件包事实

- **软件包键:** brew:cargo-flamegraph
- **软件包管理器:** Homebrew
- **版本:** 0.6.13
- **来源摘要:** Easy flamegraphs for Rust projects and everything else
- **主页:** <https://github.com/flamegraph-rs/flamegraph>
- **仓库:** <https://github.com/flamegraph-rs/flamegraph>
- **最后更新:** 2026-06-03T12:47:55Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- cargo-flamegraph (别名)
- flamegraph (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.6.13
## 项目历史与用法

cargo-flamegraph is the Cargo-facing entry point for flamegraph-rs/flamegraph, a Rust implementation of a flame graph workflow that can profile Cargo projects as well as arbitrary binaries.

Its appeal is pragmatic: it turns the usual sampler-plus-postprocessor performance workflow into `cargo flamegraph`, producing an SVG flame graph without requiring users to wire Perl scripts and shell pipelines together by hand.

### 项目历史

The flamegraph-rs repository was created in March 2019 and published the `flamegraph` crate at version 0.1.0 the same day. The README presents the project as a Rust-powered flamegraph generator with additional Cargo support, built on Jon Gjengset's Inferno Rust flamegraph library.

The project ships both `flamegraph` and `cargo-flamegraph` binaries. That split let it serve Rust developers through Cargo's subcommand convention while remaining useful for profiling non-Rust executables.

### 采用历史

Adoption followed the Rust performance-tooling path: the tool became a quick install for developers who wanted Linux `perf`, macOS tracing, or Windows collection wrapped in one Cargo-friendly command.

By 2026 the crate had hundreds of thousands of crates.io downloads and the GitHub repository had several thousand stars, which is notable for a narrow profiling utility.

### 使用方式

For Rust projects, users commonly run `cargo flamegraph`, which defaults to profiling a release build. The README also documents profiling specific binaries, examples, tests, benchmarks, existing processes, and arbitrary executables via `flamegraph -- /path/to/binary`.

The tool relies on platform profilers: Linux uses `perf`, macOS uses `xctrace`, and Windows support is available through the Blondie backend or DTrace when present.

### 为什么软件包爱好者会关心

cargo-flamegraph is a good example of the Rust ecosystem turning a well-known systems technique into a package-manager-native workflow. Its package-nerd importance is less the flame graph idea itself and more the way it hides the fiddly collector/postprocessor chain behind Cargo subcommands.

It also connects several Rust performance projects: Cargo as the invocation layer, Inferno as the renderer, platform sampling tools as data sources, and newer alternatives such as Samply for interactive profiling.

### 时间线

- 2019-03-07: GitHub repository created and `flamegraph` 0.1.0 published to crates.io.
- 2019: Project launches with both `flamegraph` and `cargo-flamegraph` binaries for general and Cargo-specific profiling.
- 2020s: README documents Linux `perf`, macOS tracing, and Windows backends, broadening the tool beyond its original Unix-like profiling niche.
- 2026: Repository remains active and the crate has more than 800,000 crates.io downloads.

### Related projects

- Inferno is the Rust flamegraph rendering library used underneath flamegraph-rs.
- Linux `perf`, Apple `xctrace`, Windows DTrace, and Blondie are the platform collection backends documented by the project.
- Samply is called out by the README as a related Rust profiler with a Firefox Profiler UI.

### 来源

- <https://api.github.com/repos/flamegraph-rs/flamegraph>
- <https://crates.io/crates/flamegraph>
- <https://github.com/flamegraph-rs/flamegraph#readme>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: Cargo.toml
## 其他软件包管理器记录

- Nix - cargo-flamegraph: normalized package name match | nixpkgs package indexes: pkgs/by-name/ca/cargo-flamegraph/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - cargo-flamegraph - 0.6.13-r0: normalized package name match | Alpine Linux edge package indexes: cargo-flamegraph from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Easy flamegraphs for Rust projects and everything else, without Perl or pipes | https://github.com/flamegraph-rs/flamegraph
- apk - cargo-flamegraph-bash-completion - 0.6.13-r0: normalized package name match | Alpine Linux edge package indexes: cargo-flamegraph-bash-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Bash completions for cargo-flamegraph | https://github.com/flamegraph-rs/flamegraph
- apk - cargo-flamegraph-doc - 0.6.13-r0: normalized package name match | Alpine Linux edge package indexes: cargo-flamegraph-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Easy flamegraphs for Rust projects and everything else, without Perl or pipes (documentation) | https://github.com/flamegraph-rs/flamegraph
- apk - cargo-flamegraph-fish-completion - 0.6.13-r0: normalized package name match | Alpine Linux edge package indexes: cargo-flamegraph-fish-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Fish completions for cargo-flamegraph | https://github.com/flamegraph-rs/flamegraph
- apk - cargo-flamegraph-zsh-completion - 0.6.13-r0: normalized package name match | Alpine Linux edge package indexes: cargo-flamegraph-zsh-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Zsh completions for cargo-flamegraph | https://github.com/flamegraph-rs/flamegraph
- pacman - cargo-flamegraph - 0.6.13-1: normalized package name match | Arch Linux sync databases: cargo-flamegraph from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Easy flamegraphs for Rust projects and everything else | https://github.com/flamegraph-rs/flamegraph
- MacPorts - flamegraph: installed executable or alias match | MacPorts ports tree: devel/flamegraph/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Nix - flamegraph: installed executable or alias match | nixpkgs package indexes: pkgs/by-name/fl/flamegraph/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- dnf - flamegraph - 1.0-24.20241020git41fee1f.fc45: installed executable or alias match | Fedora Rawhide package metadata: flamegraph from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Stack trace visualizer | http://www.brendangregg.com/flamegraphs.html
- dnf - flamegraph-demos - 1.0-24.20241020git41fee1f.fc45: installed executable or alias match | Fedora Rawhide package metadata: flamegraph-demos from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Demos of graphs produced by flamegraph | http://www.brendangregg.com/flamegraphs.html
- dnf - flamegraph-stackcollapse - 1.0-24.20241020git41fee1f.fc45: installed executable or alias match | Fedora Rawhide package metadata: flamegraph-stackcollapse from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Stack collapsers and support scripts | http://www.brendangregg.com/flamegraphs.html
- dnf - flamegraph-stackcollapse-perf - 1.0-24.20241020git41fee1f.fc45: installed executable or alias match | Fedora Rawhide package metadata: flamegraph-stackcollapse-perf from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Stack collapser for perf output | http://www.brendangregg.com/flamegraphs.html
- dnf - flamegraph-stackcollapse-php - 1.0-24.20241020git41fee1f.fc45: installed executable or alias match | Fedora Rawhide package metadata: flamegraph-stackcollapse-php from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Stack collapser for PHP | http://www.brendangregg.com/flamegraphs.html


## Combined YAML source

View the package source record on GitHub. [combined/cargo-flamegraph.yml](https://github.com/mxcl/pkgdb/blob/main/combined/cargo-flamegraph.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
