brendangregg / FlameGraph

Stack trace visualizer
http://www.brendangregg.com/flamegraphs.html
17.23k stars 1.96k forks source link

Question: supported kernel versions and perf kvm w/ flamegraphs #210

Open ustiugov opened 5 years ago

ustiugov commented 5 years ago

Hi, I am trying to profile a VM (host+guest) with perf kvm by generating call graphs, I run into a couple of problems with perf kvm and flamegraphs.

With v4.18 kernel, it seems that the output of perf report is incompatible with ./flamegraph/stackcollapse-perf.pl.

With v4.15 (vanilla Ubuntu 18) kernel, perf kvm doesn't generate any call-graphs records that belong to the guest.

Unfortunately, I cannot find any information online about which kernels' perf output was tested with flamegraphs. I would appreciate any advice and thank you in advance!

Hi-Angel commented 4 years ago

I don't know if if it helps, but I think I've used it successfully with kernels 5.2, 5.1, 5.0… With 5.3 though I stumble upon this.

ustiugov commented 4 years ago

@Hi-Angel hi, I would appreciate if you could elaborate on how you used perf? From the host or guest? Which arguments did you provide?

Hi-Angel commented 4 years ago

I didn't profile a VM but a plain application, so in a sense it's a host. I hope it's not that important though, because the format of perf script should be the same. And anyway, your question is about a supported kernel version by flamegraph.

The command I used is:

perf script | stackcollapse-perf.pl | flamegraph.pl > out.svg
ustiugov commented 4 years ago

@Hi-Angel I see this problem only when profiling in the virtualized scenario. Anyways, thank you

Hi-Angel commented 4 years ago

@Hi-Angel I see this problem only when profiling in the virtualized scenario. Anyways, thank you

If this works for you with plain apps, then answer would be that your kernel is supported. As for a problem with specific usecase of profiling a VM, well, this sounds like a bug of flamegraph not handling something in perf output, and should be reported as such.

Either way, even if flamegraph wouldn't support your kernel version, it looks to me like a bug on its own, because this could've been checked.