flamegraph-rs / flamegraph

Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run on WSL has only 1 sample in the flamegraph

albertsgarde opened this issue · comments

I can succesfully run cargo flamegraph in WSL, but the resulting flamegraph looks like the image below and hovering over the functions shows that each only has 1 sample.
This is inconsistent with the output to the terminal which is

albert@LAPTOP-P9O7TTBR:~/evolution$ cargo flamegraph --bin benchmark
    Finished release [optimized + debuginfo] target(s) in 0.27s
Ticks per second: 1065772.6
[ perf record: Woken up 316 times to write data ]
[ perf record: Captured and wrote 79.191 MB perf.data (4992 samples) ]
writing flamegraph to "flamegraph.svg"

(the Ticks per second is just output from the program)
flamegraph

flamegraph just orchestrates a performance recording tool -- I'm guessing it would be perf on WSL? -- and pass the output to the inferno crate. In this case, it looks like flamegraph itself did everything it was asked to do, but one of these components did something surprising?

I guess so. Problem is I have no idea where to even get started debugging this. Any links or search terms I could use? I've tried running perf by itself, but I've not been able to get anything useful from the output

You could file an issue against inferno and see if the maintainer has any useful tips? Can also run cargo flamegraph with -v to see the exact command that it runs to instrument your workload.

Thanks. I'll try that.