calgrind
valgrind --tool=callgrind ./test
多线程 valgrind --tool=callgrind --separate-threads=yes ./test
mac 安装qcachegrind
brew install qcachegrind
https://wizardforcel.gitbooks.io/lcthw/content/ex41.html
top M 查看内存 P 查看 CPU
pstack 查看进程调用栈情况
strace 显示出进程正在运行的系统调用
perf top -K -p xxx CPU排序,找出最耗费CPU的函数
pstree 查看线程
apt-get install google-perftools
apt-get install libgoogle-perftools-dev