bash 是否有可能获得 gprof 结果的图形表示?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2439060/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 19:02:44  来源:igfitidea点击:

Is it possible to get a graphical representation of gprof results?

bashgprof

提问by Open the way

I am interested in getting the profiling of some number crunching program. I compiled it with -g and -pg options and linked it and got it gmon.out. After reading the info (plain text) it looks a bit ugly. I wonder if there are some open source tools for getting a graphical representation of the 10 functions where the program spends the most of the time as well as a flux diagram.

我有兴趣获得一些数字处理程序的分析。我用 -g 和 -pg 选项编译它并链接它并得到它 gmon.out。阅读信息(纯文本)后,它看起来有点难看。我想知道是否有一些开源工具可以获得程序花费最多时间的 10 个函数的图形表示以及通量图。

Thanks

谢谢

回答by msw

Gprof2Dotby jrfonsecais a tool that converts the output of many profilers, amongst which gprof, into a dot graph.

jrfonsecaGprof2Dot是一种工具,可将许多分析器(其中包括 gprof)的输出转换为点图。

回答by Norman Ramsey

Not quite an answer to your question, but maybe a solution to your problem: I switched from gprofto valgrind's callgrindtool, primarily because of the incredible graphical tool kcachegrind, which you can use to visualize the results. It's interactive, so you can zoom in on interesting parts of the call graph.

不能完全回答您的问题,但可能是您问题的解决方案:我从gproftovalgrindcallgrind工具切换,主要是因为令人难以置信的图形工具kcachegrind,您可以使用它来可视化结果。它是交互式的,因此您可以放大调用图的有趣部分。

Gprof2dot works with callgrind as well as gprof.

Gprof2dot 与 callgrind 以及 gprof 一起使用。