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?? //運(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)題。
- 上一篇: atitti.atiNav 手机导航组件
- 下一篇: hive内部表与外部表区别