How to get complete stack dump from profiler in every sample for use in flame graph?

走远了吗. 提交于 2019-12-06 03:18:58

Try Linux perf_events (aka the "perf" command), which is part of the mainline Linux kernel, and usually installed via the linux-tools-common (or similar) package. I often use it to create flame graphs on Linux.

I wrote up some instructions for creating flame graphs with perf on: http://www.brendangregg.com/perf.html#FlameGraphs

pstack was suggested by Mike Dunlavey which unfortunately segfaults after I apply the ARM patch and run it on an ARM device. Until I have time to take a look at it, I found the following stopgap solution:

http://www.commandlinefu.com/commands/view/4039/print-stack-trace-of-a-core-file-without-needing-to-enter-gdb-interactively

It uses gdb with the following command: gdb --q --n --ex bt --batch --pid PID

A bit slow but works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!