Interpreting callgrind data

丶灬走出姿态 提交于 2019-12-03 05:45:53

问题


I need a dynamic call graph for my app. I run it with callgrind tool (valgrind suite) and got callgrind.out.xxxxx file. Now, I want to make a graphical representation of this data. KCacheGrind doesn't help me much because it draws a limited part of the graph (draws ~50 functions instead of ~1500 profiled and I don't know how to fix that). How can I get a graph image where all of the functions will be drawn?


回答1:


Ok, I've found the way. The generated callgrind.out file you can convert to dot file using gprof2dot (yes, this tool can parse callgrind files as well). And then you can get the graph image using dot -T<type> dotfile.dot -o graphfile.<type>




回答2:


Using the following command to generate graph.png using gprof2dot

$ ./gprof2dot.py --format=callgrind --output=out.dot /path/to/callgrind.out
$ dot -Tpng out.dot -o graph.png


来源:https://stackoverflow.com/questions/9279144/interpreting-callgrind-data

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