What does HackerNews think of FlameGraph?

Stack trace visualizer

Language: Perl

> Stack samples can be captured using Linux perf_events, FreeBSD pmcstat (hwpmc), DTrace, SystemTap, and many other profilers. See the stackcollapse-* converters

https://github.com/brendangregg/FlameGraph

Historically brendangregg's since AIUI he basically invented flamegraphs

https://www.brendangregg.com/flamegraphs.html

So if you can make your tool eat whatever https://github.com/brendangregg/FlameGraph is fed with you're going to support a lot of existing tooling across OSes and languages.

Small note:

> In Rust, it is very easy to generate flamegraphs with `cargo flamegraph`.

... Also in pretty much every other language that can generate perf stacktraces, because this is just a wrapper around Brendan Gregg's FlameGraph visualizer: https://github.com/brendangregg/FlameGraph

When was the last time you needed to read assembly code to debug a kernel-level issue in FOSS software? There's a lot of software you can use to profile the entire kernel and userspace[0], or explore the stack trace[1] of your software. If you're not using those and instead debugging your software by counting SIMD calls in the Ghidra editor, you're wasting an unconscionable amount of time.

People read through assembly to fix compiler issues, not to rationalize what the kernel is doing. You're right that this skill is still required for "perfect" optimization, but it's not really relevant when comparing kernels.

[0] http://www.sysprof.com/

[1] https://github.com/brendangregg/FlameGraph

> [...] how Perf compares to vendor tools like vTune [...] ?

Regarding the hardware events that Perf can capture on x86, it has pretty much all of them. So it should be equivalent to vTune for all practical purposes.

The big difference is in the UI -- or absence thereof. Perf is a low-level tool and its output is mostly text files. There is a curses-based TUI for perf-report (and even gtk version, but it is essentially the same as the TUI, just using GTK2 widgets), but that's about it.

By contrast, vTune comes with a heavy (electron-based?) GUI and is quite helpful in guiding beginners, with many graphs and explanations.

Of course, one can (and is expected to) complement Perf with an assortment of tools that process its output for visualization. For example, the flamegraph [1] and heat map [2] tools described in the article. But also KDAB hotspot [3] for flame graphs or HPerf [4] for a vTune-style perf-report.

[1] https://github.com/brendangregg/FlameGraph

[2] https://github.com/brendangregg/HeatMap

[3] https://github.com/KDAB/hotspot

[4] https://www.poirrier.ca/hperf/

Another option is to generate a text file in the format expected by flamegraph. Especially useful when the data is hierarchical.

https://github.com/brendangregg/FlameGraph

Exemple for Java:

https://github.com/pcdv/deps-flamegraph/blob/master/README.m...