日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

gprof + kprof + gprof2dot (性能 与 函数调用图)-

發(fā)布時(shí)間:2025/7/14 19 豆豆
生活随笔 收集整理的這篇文章主要介紹了 gprof + kprof + gprof2dot (性能 与 函数调用图)- 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

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?? //運(yùn)行后生成gmon.out

? ?? gprof ./test > prof.log

?

?2. KProf 是gprof 版本////注意已經(jīng)按照前面的用gprof生成 gmont.out 了

????? kprof -f ./test

?

?3. gprof2dot.py 與 xdot:生成圖像清晰,相對(duì)于KProf

????? gprof ./test | gprof2dot.py | xdot



?

?

gprof:系統(tǒng)自帶
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
% 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是 一個(gè)圖形可交互查看器,采用Graphviz的 dot 語(yǔ)言開(kāi)發(fā) (DOT文件------>圖像生成)https://github.com/jrfonseca/xdot.py

轉(zhuǎn)載于:https://www.cnblogs.com/zengkefu/p/5570617.html

總結(jié)

以上是生活随笔為你收集整理的gprof + kprof + gprof2dot (性能 与 函数调用图)-的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。