mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
use zip format
This commit is contained in:
parent
59a2d5e7e0
commit
179e2a2bba
6 changed files with 12 additions and 6 deletions
4
trunk/3rdparty/gprof/build_gprof2dot.sh
vendored
4
trunk/3rdparty/gprof/build_gprof2dot.sh
vendored
|
@ -10,8 +10,8 @@ fi
|
||||||
sudo echo "ok" > /dev/null 2>&1;
|
sudo echo "ok" > /dev/null 2>&1;
|
||||||
ret=$?; if [[ 0 -ne ${ret} ]]; then echo "you must be sudoer"; exit 1; fi
|
ret=$?; if [[ 0 -ne ${ret} ]]; then echo "you must be sudoer"; exit 1; fi
|
||||||
|
|
||||||
tar xf graphviz-2.18.tar.gz
|
tar xf graphviz-2.36.0.zip
|
||||||
cd graphviz-2.18 && ./configure && make && sudo make install
|
cd graphviz-2.36.0 && ./configure && make && sudo make install
|
||||||
ret=$?; if [[ $ret -ne 0 ]]; then echo "build gprof2dot failed."; exit $ret; fi
|
ret=$?; if [[ $ret -ne 0 ]]; then echo "build gprof2dot failed."; exit $ret; fi
|
||||||
|
|
||||||
echo "we test in Centos6.0, it's ok"
|
echo "we test in Centos6.0, it's ok"
|
||||||
|
|
BIN
trunk/3rdparty/gprof/graphviz-2.18.tar.gz
vendored
BIN
trunk/3rdparty/gprof/graphviz-2.18.tar.gz
vendored
Binary file not shown.
BIN
trunk/3rdparty/gprof/graphviz-2.36.0.zip
vendored
Normal file
BIN
trunk/3rdparty/gprof/graphviz-2.36.0.zip
vendored
Normal file
Binary file not shown.
13
trunk/3rdparty/gprof/readme.txt
vendored
Executable file → Normal file
13
trunk/3rdparty/gprof/readme.txt
vendored
Executable file → Normal file
|
@ -1,6 +1,8 @@
|
||||||
gprof图形化输出工具: gprof2dot.py graphviz-2.18.tar.gz build_gprof2dot.sh
|
gprof图形化输出工具: gprof2dot.py graphviz-2.18.tar.gz build_gprof2dot.sh
|
||||||
|
|
||||||
dot:
|
dot:
|
||||||
|
http://www.graphviz.org/
|
||||||
|
http://www.graphviz.org/Download_source.php
|
||||||
graphviz-2.18.tar.gz 绘图工具
|
graphviz-2.18.tar.gz 绘图工具
|
||||||
build_gprof2dot.sh 编译graphviz,命令为dot。
|
build_gprof2dot.sh 编译graphviz,命令为dot。
|
||||||
要求是sudoer,需要sudo make install。
|
要求是sudoer,需要sudo make install。
|
||||||
|
@ -9,21 +11,24 @@ gprof2dot.py:
|
||||||
将gprof的日志绘图。
|
将gprof的日志绘图。
|
||||||
|
|
||||||
使用方法:
|
使用方法:
|
||||||
1. srs配置时,指定 --with-pg
|
0. 若需要图形化,编译dot:
|
||||||
|
cd 3rdparty/gprof && bash build_gprof2dot.sh
|
||||||
|
1. srs配置时:
|
||||||
|
./configure --with-pg
|
||||||
脚本会加入编译参数"-pg -lc_p",gcc -g -pg -lc_p -c xxx -o xxx.o,即在configure中打开 Performance="-pg -lc_p"
|
脚本会加入编译参数"-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"
|
链接时,加入链接选项"-pg",否则无法工作:gcc -pg -o srs xxxx.o,即在configure中打开 PerformanceLink="-pg"
|
||||||
2. 编译和启动程序:make && ./objs/srs -c conf/srs.conf
|
2. 编译和启动程序:make && ./objs/srs -c conf/srs.conf
|
||||||
退出程序,按CTRL+C,可以看到生成了gmon.out,这个就是性能的统计数据。
|
退出程序,按CTRL+C,可以看到生成了gmon.out,这个就是性能的统计数据。
|
||||||
3. gprof生成报表:
|
3. gprof生成报表:
|
||||||
用gprof生成报表:gprof -b ./objs/srs gmon.out > ~/t.log
|
gprof -b ./objs/srs gmon.out > gprof.srs.log
|
||||||
4. 将报表生成图片:
|
4. 将报表生成图片:
|
||||||
../3rdparty/gprof/gprof2dot.py ~/t.log | dot -Tpng -o ~/out.png
|
./3rdparty/gprof/gprof2dot.py gprof.srs.log | dot -Tpng -o ~/winlin.png
|
||||||
|
|
||||||
缩写语句:
|
缩写语句:
|
||||||
# 生成 ~/winlin.log ~/winlin.png
|
# 生成 ~/winlin.log ~/winlin.png
|
||||||
rm -f gmon.out; ./objs/srs -c conf/srs.conf
|
rm -f gmon.out; ./objs/srs -c conf/srs.conf
|
||||||
# 用户按CTRL+C
|
# 用户按CTRL+C
|
||||||
file="winlin";gprof -b ./objs/srs gmon.out > ~/${file}.log; ../thirdparty/gprof2dot.py ~/${file}.log| dot -Tpng -o ~/${file}.png
|
file="winlin";gprof -b ./objs/srs gmon.out > ~/${file}.log; ./3rdparty/gprof/gprof2dot.py ~/${file}.log | dot -Tpng -o ~/${file}.png
|
||||||
|
|
||||||
备注:
|
备注:
|
||||||
其实gprof生成的日志就可以看,不一定要图形化。
|
其实gprof生成的日志就可以看,不一定要图形化。
|
||||||
|
|
BIN
trunk/3rdparty/gprof/winlin.png
vendored
Normal file
BIN
trunk/3rdparty/gprof/winlin.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 120 KiB |
1
trunk/configure
vendored
1
trunk/configure
vendored
|
@ -104,6 +104,7 @@ default: bandwidth librtmp-sample utest
|
||||||
@echo -e " |${SrsGprofSummaryColor}gprof @see: https://github.com/winlinvip/simple-rtmp-server/wiki/GPROF\$(BLACK)"
|
@echo -e " |${SrsGprofSummaryColor}gprof @see: https://github.com/winlinvip/simple-rtmp-server/wiki/GPROF\$(BLACK)"
|
||||||
@echo -e " |${SrsGprofSummaryColor}gprof: GNU profile tool, @see: http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html\$(BLACK)"
|
@echo -e " |${SrsGprofSummaryColor}gprof: GNU profile tool, @see: http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html\$(BLACK)"
|
||||||
@echo -e " | ${SrsGprofSummaryColor}rm -f gmon.out; ./objs/srs -c conf/srs.conf # start gprof\$(BLACK)"
|
@echo -e " | ${SrsGprofSummaryColor}rm -f gmon.out; ./objs/srs -c conf/srs.conf # start gprof\$(BLACK)"
|
||||||
|
@echo -e " | ${SrsGprofSummaryColor}killall -2 srs # or CTRL+C to stop gprof\$(BLACK)"
|
||||||
@echo -e " | ${SrsGprofSummaryColor}gprof -b ./objs/srs gmon.out > gprof.srs.log && rm -f gmon.out # gprof report to gprof.srs.log\$(BLACK)"
|
@echo -e " | ${SrsGprofSummaryColor}gprof -b ./objs/srs gmon.out > gprof.srs.log && rm -f gmon.out # gprof report to gprof.srs.log\$(BLACK)"
|
||||||
@echo -e " \$(BLACK)+------------------------------------------------------------------------------------\$(BLACK)"
|
@echo -e " \$(BLACK)+------------------------------------------------------------------------------------\$(BLACK)"
|
||||||
@echo -e " |${SrsResearchSummaryColor}research: ./objs/research, api server, players, ts info.\$(BLACK)"
|
@echo -e " |${SrsResearchSummaryColor}research: ./objs/research, api server, players, ts info.\$(BLACK)"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue