add gprof files and dot files

pull/133/head
winlin 11 years ago
parent 6e0bebdacf
commit 42ad264182

@ -0,0 +1,11 @@
ccache是samba组织提供的加速编译过程的工具
使用虚拟机编译可以考虑用这个工具,让编译过程飞快。
链接:
http://ccache.samba.org/
http://samba.org/ftp/ccache/ccache-3.1.9.tar.xz
http://ccache.samba.org/manual.html
安装方法:
bash build_ccache.sh
注意要求以sudoer执行要修改文件。

@ -0,0 +1,17 @@
#!/bin/bash
# check exists.
if [[ -d graphviz-2.18 ]]; then
echo "graphviz is ok";
exit 0;
fi
# check sudoer.
sudo echo "ok" > /dev/null 2>&1;
ret=$?; if [[ 0 -ne ${ret} ]]; then echo "you must be sudoer"; exit 1; fi
tar xf graphviz-2.18.tar.gz
cd graphviz-2.18 && ./configure && make && sudo make install
ret=$?; if [[ $ret -ne 0 ]]; then echo "build gprof2dot failed."; exit $ret; fi
echo "we test in Centos6.0, it's ok"

File diff suppressed because it is too large Load Diff

Binary file not shown.

@ -0,0 +1,30 @@
gprof图形化输出工具: gprof2dot.py graphviz-2.18.tar.gz build_gprof2dot.sh
dot:
graphviz-2.18.tar.gz 绘图工具
build_gprof2dot.sh 编译graphviz命令为dot。
要求是sudoer需要sudo make install。
gprof2dot.py:
将gprof的日志绘图。
使用方法:
1. srs配置时指定 --with-pg
脚本会加入编译参数"-pg -lc_p"gcc -g -pg -lc_p -c xxx -o xxx.o即在configure中打开 Performance="-pg -lc_p"
链接时,加入链接选项"-pg"否则无法工作gcc -pg -o srs xxxx.o即在configure中打开 PerformanceLink="-pg"
2. 编译和启动程序make && ./objs/srs -c conf/srs.conf
退出程序按CTRL+C可以看到生成了gmon.out这个就是性能的统计数据。
3. gprof生成报表
用gprof生成报表gprof -b ./objs/srs gmon.out > ~/t.log
4. 将报表生成图片:
../3rdparty/gprof/gprof2dot.py ~/t.log | dot -Tpng -o ~/out.png
缩写语句:
# 生成 ~/winlin.log ~/winlin.png
rm -f gmon.out; ./objs/srs -c conf/srs.conf
# 用户按CTRL+C
file="winlin";gprof -b ./objs/srs gmon.out > ~/${file}.log; ../thirdparty/gprof2dot.py ~/${file}.log| dot -Tpng -o ~/${file}.png
备注:
其实gprof生成的日志就可以看不一定要图形化。
也就是dot和gprof2dot都不用执行。
Loading…
Cancel
Save