linux perf
https://www.ibm.com/developerworks/cn/linux/l-cn-perf1/index.html http://blog.youkuaiyun.com/zhangskd/article/details/37902159 https://www.zhihu.com/question/27037437/answer/35028987 http://blog.youkuaiyun.com/u011630575/article/details/66476165
nginx火焰图: https://www.cnblogs.com/sxhlinux/p/6250619.html
- openresty的systemtap的工具:https://github.com/openresty/nginx-systemtap-toolkit
- 火焰图工具:https://github.com/brendangregg/FlameGraph
大体流程:
- capture stacks
# perf record -F 99 -p 181 -g -- sleep 60
# perf script > out.perf
- fold stacks
$ ./stackcollapse-perf.pl out.perf > out.folded
- 生成火焰图
$ ./flamegraph.pl out.kern_folded > kernel.svg