zoukankan      html  css  js  c++  java
  • gprof + kprof + gprof2dot (性能 与 函数调用图)-

    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.
     
    kprof
    
    http://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
    % su
    enter 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

    xdot.py 0.5 发布,图形互动查看器

    image

  • 相关阅读:
    Nginx启动/停止服务和各种命令
    文件权限导致Weblogic Embedded LDAP Server启动失败解决办法
    jmeter(八)非图形界面、输出html报告
    jmeter(七)服务器监控
    python中如何把一段文字中的空格替换成换行符
    jmeter(五)jpgc插件的使用
    jmeter(四)提取响应结果
    Jmeter (三)变量、参数化、函数
    jmeter(二)录制脚本
    Jmeter(一)发送http请求
  • 原文地址:https://www.cnblogs.com/zengkefu/p/5570617.html
Copyright © 2011-2022 走看看