问题描述
我需要为我的应用创建动态调用图.我使用callgrind
工具(valgrind
套件)运行它,并获得了callgrind.out.xxxxx
文件.现在,我想对此数据进行图形化表示. KCacheGrind
对我没有多大帮助,因为它绘制了图形的有限部分(绘制了〜50个函数,而不是概要分析的〜1500个,我不知道如何解决).如何获得将绘制所有功能的图形图像?
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?
推荐答案
好的,我已经找到了方法.您可以使用 gprof2dot 将生成的callgrind.out
文件转换为dot
文件(是的,此工具可以将callgrind
文件解析为出色地).然后您可以使用dot -T<type> dotfile.dot -o graphfile.<type>
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>
这篇关于解释callgrind数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!