flamegraph-rs / flamegraph

Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3
Apache License 2.0
4.75k stars 145 forks source link

[Feature Request] Support other kinds of flame graphs #235

Open QuarticCat opened 2 years ago

QuarticCat commented 2 years ago

For example, memory flame graph. https://www.brendangregg.com/FlameGraphs/memoryflamegraphs.html

djc commented 2 years ago

This utility just provides some glue between running perf for you (on Linux, and other tools on other platforms) and the inferno crate for building the SVG. I don't know to which extent these dependencies would need changes in order to support this, but unfortunately I won't have time to work on this myself.

ajgrah2000 commented 2 years ago

Using the existing command line options of this utility, it looks to support some of those out of the box to an extent (for ones that use 'perf').

Memory (brk() syscall): cargo-flamegraph flamegraph --cmd "record -e syscalls:sys_enter_brk -a -g" -b

Memory (malloc calls): perf probe --exec=/lib/aarch64-linux-gnu/libc.so.6 --add malloc cargo-flamegraph flamegraph --cmd "record -e probe_libc:malloc -a -g" -b

Off-CPU (Block Device I/O): cargo-flamegraph flamegraph --cmd "record -e block:block_rq_insert -a -g" -b