valgrind callgrind性能分析

1.請自行安裝valgrind工具
2.使用工具運行你的應用程序
   valgrind --tool=callgrind ./sgzj-socialserver
3.運行結束後,程序當前目錄生成了一個文件callgrind.out.58237
4. python gprof2dot.py -f callgrind -n20 -s callgrind. out.58237 > valgrind.dot5.dot -Tpng valgrind.dot -o valgrind.png圖片結果如下:


以上就是我們如何使用callgrind來對自己程序進行性能分析。

PS:如果需要幫助,請聯繫微信wangchong-fly