openresty-systemtap-toolkit
openresty-systemtap-toolkit copied to clipboard
How to get the flame graph of a process running in a container
I have a openresty process running in a docker container. My work steps:
- Run
sample-bt-off-cpu -t 5 -p 4690 -u/-k
on the host - Run
./stackcollapse.pl offcpu1.bt |./flamegraph.pl > sample-bt-off-cpu.svg
Results: - A perfect kernel space flame graph
- A unusual user space flame graph like this
MY QUESTION is, can this toolkit work with container or what i missed?
@pkking AFAIK, containers are always problematic when running systemtap tools. It needs a lot of work to get it right, if not impossible. One common mistake is not giving your container enough permissions. Well, I cannot be more helpful here.