gprof + kprof + gprof2dot (性能 与 函数调用图)-
生活随笔
收集整理的這篇文章主要介紹了
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.
?
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是 一個圖形可交互查看器,采用Graphviz的 dot 語言開發 (DOT文件------>圖像生成)https://github.com/jrfonseca/xdot.py
轉載于:https://www.cnblogs.com/zengkefu/p/5570617.html
總結
以上是生活随笔為你收集整理的gprof + kprof + gprof2dot (性能 与 函数调用图)-的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: atitti.atiNav 手机导航组件
- 下一篇: hive内部表与外部表区别