// the find
brendangregg/FlameGraph
Stack trace visualizer
FlameGraph is Brendan Gregg's stack trace visualizer — the tool that turned CPU profiling from a wall of numbers into something you can actually read. It takes folded stack output from perf, DTrace, SystemTap, and a dozen other profilers and renders an interactive SVG where width equals time spent. If you do performance work on Linux or BSD, you've probably already used this.
The pipeline design (capture → fold → render) is the right call: the intermediate folded format means you can grep for specific functions before rendering, which is genuinely useful when you're chasing one hot path. The breadth of stackcollapse converters is impressive — perf, DTrace, VTune, Go pprof, Java jstack, GDB, Chrome tracing, and more, all handled. The SVG output is self-contained and interactive without any JavaScript framework dependency — just vanilla JS embedded in the SVG. Differential flame graphs (difffolded.pl) let you compare two profiles visually, which is the right way to measure whether a fix actually helped.
It's Perl, written in a single-file style that hasn't aged gracefully — flamegraph.pl is 1000+ lines with global variables and no tests beyond test.sh doing diff checks. The last meaningful commit was 2024, but the codebase feels frozen circa 2018. There's no native support for async/await or green-thread stacks, so Node.js, Go goroutines, and async Rust profiles often produce misleading flat shapes unless you do extra work. The color palettes are random by default, meaning the same function gets a different color on every render unless you use --cp — a footgun for anyone trying to compare graphs visually without that flag.