How can I capture combined kernel and userspace stacks with perf

1.2k views Asked by At

I'm trying to capture combined user and kernel stacks with perf, so I can see which user space code produces are particular kernel call chain. Basically I want to create a flamegraph looking like this:flamegraph

Unfortunately all my kernel stacks end at entry_SYSCALL_64_fastpath and there is no connection to the userspace stacks.

I'm using perf record -g --call-graph dwarf -F 99 --pid 12345 to capture. I have debug symbols for the kernel, libc and my program. This is kernel 4.8.14 on a Fedora 25 system.

1

There are 1 answers

0
ankhmesut On

Try bcc utilities that use BPF technology. Take a look at profile util.

https://github.com/iovisor/bcc/blob/master/docs/tutorial.md