http://www.cnblogs.com/rocketfan/archive/2009/11/15/1603465.html

http://blog.csdn.net/stanjiang2010/article/details/5655143

http://blog.csdn.net/stanjiang2010/article/details/5655143

三种方案:

1.程序编绎加 -PG:   g++ -pg -g  -o test test.cc

    ./test   //运行后生成gmon.out

     gprof ./test > prof.log

 2. KProf 是gprof 版本////注意已经按照前面的用gprof生成 gmont.out 了

      kprof -f ./test

 

 3. gprof2dot.py 与 xdot:生成图像清晰,相对于KProf

      gprof ./test | gprof2dot.py | xdot

gprof:系统自带https://sourceware.org/binutils/docs/gprof/https://sourceware.org/binutils/

The GNU Binutils are a collection of binary tools. The main ones are:

  • ld - the GNU linker.
  • as - the GNU assembler.

But they also include:

  • addr2line - Converts addresses into filenames and line numbers.
  • ar - A utility for creating, modifying and extracting from archives.
  • c++filt - Filter to demangle encoded C++ symbols.
  • dlltool - Creates files for building and using DLLs.
  • gold - A new, faster, ELF only linker, still in beta test.
  • gprof - Displays profiling information.
  • nlmconv - Converts object code into an NLM.
  • nm - Lists symbols from object files.
  • objcopy - Copies and translates object files.
  • objdump - Displays information from object files.
  • ranlib - Generates an index to the contents of an archive.
  • readelf - Displays information from any ELF format object file.
  • size - Lists the section sizes of an object or archive file.
  • strings - Lists printable strings from files.
  • strip - Discards symbols.
  • windmc - A Windows compatible message compiler.
  • windres - A compiler for Windows resource files.
 

kprofhttp://kprof.sourceforge.net/

        % tar xvfz kprof-1.4.1.tar.gz% cd kprof-1.4.1% ./configure --prefix=(where KDE is installed, for example /opt/kde3)% make% suenter your root password# make install

KProf is a visual tool for developers, which displays the execution profiling output generated by code profilers. The output of profilers being usually difficult to read (beyond the flat profile information), KProf presents the information in list- or tree-views that make the information very easy to understand.KProf provides access to the following features:Flat profile view displays all function / methods and their profiling information.Hierarchical profile view displays a tree for each function / method with the other functions / methods it calls as subelements.Object profile view, for C++ developers, groups the methods in a tree view by object name.Graph view is a graphical representation of the call-tree, requires GraphViz to work.Method view is a more detailed look at an individual method - cross referenced.Recursive functions carry a special icon to clearly show that they are recursive.Right-clicking a function or method displays a pop-up with the list of callers and called functions. You can directly go to one of these functions by selecting it in the pop-up menu.The flat profile view provides an additional filter edit box to filter the display and show only the functions or methods containing the text that you enter.Function parameters hiding if the function name is unique (i.e. no different signatures)C++ template abbreviation (template parameters can be hidden)Automatic generation of call-graph data for GraphViz and VCG, two popular graph image generators.Diff mode support to compare two profile results.

gprof2dot     (.txt----->.dot)https://github.com/jrfonseca

xdot.py是 一个图形可交互查看器,采用Graphviz的 dot 语言开发      (DOT文件------>图像生成)https://github.com/jrfonseca/xdot.py

转载于:https://www.cnblogs.com/zengkefu/p/5570617.html

gprof + kprof + gprof2dot (性能 与 函数调用图)-相关推荐

  1. gprof、gprof2dot.py、dot使用方法简介

    通过gprof可以有效的对调用结构,运行时间等时间进行统计,在当前工具链中已存在gprof工具. 1)gprof使用步骤如下,以linapck为例: 1 在编译过程中添加-pg选项,命令如下: gcc ...

  2. Python自动绘制UML类图、函数调用图(Call Graph)

    文章目录 1. 引言 2. 绘制UML类图 2.1 安装graphviz 2.2 安装pyreverse 2.3 绘制UML类图 3. 绘制函数调用图 3.1 安装graphviz 3.2 安装pyc ...

  3. cpu功耗排行_最全cpu性能排行榜 cpu性能排行天梯图

    cpu可以说是电脑的心脏,作为电脑的核心存在,cpu性能对电脑性能的影响不言而喻.虽然说因为人民币贬值,cpu价格全面上涨近10%,但是游戏还是得照玩呀,面对配置要求越来越高的新游戏,电脑性能跟不上怎 ...

  4. jmeter性能测试报告之图形化展示

    jmeter性能测试报告之图形化展示 准备工作: 1.java的运行环境正常,及运行java -version.javac -version能正常输出java版本: 2.ant的运行环境正常,使用an ...

  5. 物理机服务器cpu性能排行榜,g务器cpu性能排行_CPU天梯图2019年7月份新版——CPU性能排行天梯图...

    CPU天梯图2019年7月份新版--CPU性能排行天梯图2019(4) CPU天梯图2019年7月份新版--CPU性能排行天梯图2019(4),入门级市场:0 - 600元 奔腾.赛扬依旧是经济型市场 ...

  6. 服务器cpu性能排行2019,2019最新CPU性能排行天梯图!你的排哪边?

    原标题:2019最新CPU性能排行天梯图!你的排哪边? 大家应该都会有这样的习惯吧,在选购显卡及CPU的时候都会习惯性先看一下天梯图来看一下自己想买的显卡或者CPU性能属于何种等级. 还记得前段时间小 ...

  7. 绘制函数调用图(call graph) C++项目类图 调用关系图

    时间:2021年8月25日14:36:47 参考资料如下: 绘制函数调用图(call graph)(1):专栏开篇_许振坪的专栏-CSDN博客_函数调用关系图怎么画 绘制函数调用图(call grap ...

  8. 国内邮件服务器 评测,Windows下的邮件服务器性能评测(组图)

    <Windows下的邮件服务器性能评测(组图)>由会员分享,可在线阅读,更多相关<Windows下的邮件服务器性能评测(组图)(15页珍藏版)>请在人人文库网上搜索. 1.前言 ...

  9. linux下 C++性能测试工具 gprof 和 gprof2dot

    http://www.4ucode.com/Study/Topic/1909519 http://coolaj86.info/articles/super-simple-gprof.html http ...

最新文章

  1. swift 之SnapKit 动画
  2. cube sdio fatfs 初始化sd卡_Stm32CubeMx配置SDIO+FATFS+FREERTOS
  3. 第五篇 第二章社会单位消防安全管理
  4. Openfiler开启iSCSI服务(iSCSI Target)
  5. 一些Python情结
  6. python编程入门详解_python编程入门知识练习
  7. 股上涨和下跌天数比_面对下跌,如何信心十足地逢低买入?
  8. 中文幽默语料库构建与计算项目(幽默等级识别,幽默类型识别,隐喻类型识别,隐喻情绪识别)
  9. anaconda+cuda+cudnn+pytorch安装踩坑大全
  10. 【机器学习】Andrew Ng——02单变量线性回归
  11. python结构体字节对齐_Python及字节对齐的问题
  12. 老李分享:《Linux Shell脚本攻略》 要点(二)
  13. Matlab 官网培训 - 大型项目-风力发电机数据模型构建-Catching the Wind
  14. B站试用期刚过,被HR和大老板一起谈话,说我工作没任何问题,但今晚必须走人!...
  15. Python日常小技巧(持续更新中)
  16. Java实现打印日历
  17. java 方法互斥_Java中的互斥方法执行
  18. 简述观察法的优缺点,简述观察法的主要优点和不足。
  19. 【FCC】检查字符串结尾
  20. 做自媒体,有哪些免费下载视频剪辑素材的网站?

热门文章

  1. 泊松图像融合(泊松融合)
  2. 关于Beta分布、二项分布与Dirichlet分布、多项分布的关系
  3. 2019.01.19-2018年6月NEYC集训counting
  4. [BZOJ4448][SCOI2015]情报传递[dfs序+树状数组]
  5. 通配符及输入输出重定向、管道符和作业控制
  6. What's preconnect.svc in 11g RAC?
  7. 回档|2015.3.05
  8. 基于Jquery+Ajax+Json+高效分页
  9. 由单例模式学到:静态构造函数和静态字段
  10. 初入数据科学领域,你需要有七个这样的思维