锘??xml version="1.0" encoding="utf-8" standalone="yes"?>C++鍗氬-markqian86http://www.9087120.com/markqian86/practice makes perfect锛岄槄璇汇佸垎鏋愩佺粌涔犮佹荤粨銆?/description>zh-cnTue, 26 Mar 2019 14:48:08 GMTTue, 26 Mar 2019 14:48:08 GMT60__attribute__ 鎬荤粨http://www.9087120.com/markqian86/archive/2019/01/26/216222.html闀挎垷鍗佷笁鍗?/dc:creator>闀挎垷鍗佷笁鍗?/author>Sat, 26 Jan 2019 07:28:00 GMThttp://www.9087120.com/markqian86/archive/2019/01/26/216222.htmlhttp://www.9087120.com/markqian86/comments/216222.htmlhttp://www.9087120.com/markqian86/archive/2019/01/26/216222.html#Feedback0http://www.9087120.com/markqian86/comments/commentRss/216222.htmlhttp://www.9087120.com/markqian86/services/trackbacks/216222.html?#27076;璇诲叏?#26499;

]]>
瀹夎distcc?#22414;?#31479;寮忕紪璇戠幆澧?/title><link>http://www.9087120.com/markqian86/archive/2018/09/08/215912.html</link><dc:creator>闀挎垷鍗佷笁鍗?/dc:creator><author>闀挎垷鍗佷笁鍗?/author><pubDate>Sat, 08 Sep 2018 12:56:00 GMT</pubDate><guid>http://www.9087120.com/markqian86/archive/2018/09/08/215912.html</guid><wfw:comment>http://www.9087120.com/markqian86/comments/215912.html</wfw:comment><comments>http://www.9087120.com/markqian86/archive/2018/09/08/215912.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.9087120.com/markqian86/comments/commentRss/215912.html</wfw:commentRss><trackback:ping>http://www.9087120.com/markqian86/services/trackbacks/215912.html</trackback:ping><description><![CDATA[<span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">1.涓嬭浇骞?#28729;夎?#21362;ython-dev</span><br style="outline: 0px; box-sizing: border-box; word-break: break-all; color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;" /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">    sudo apt-get install python-dev</span><br style="outline: 0px; box-sizing: border-box; word-break: break-all; color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;" /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">2.涓嬭浇骞惰鍘媎istcc:</span><br style="outline: 0px; box-sizing: border-box; word-break: break-all; color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;" /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">    tar xvf distcc-3.2rc1.tar.bz2</span><br style="outline: 0px; box-sizing: border-box; word-break: break-all; color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;" /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">3.閰嶇疆</span><br style="outline: 0px; box-sizing: border-box; word-break: break-all; color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;" /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">    cd distcc-3.2rc1/</span><br style="outline: 0px; box-sizing: border-box; word-break: break-all; color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;" /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">    ./configure --prefix=/home/you/distcc-install --disable-Werror</span><br style="outline: 0px; box-sizing: border-box; word-break: break-all; color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;" /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">4.瀹夎</span><br style="outline: 0px; box-sizing: border-box; word-break: break-all; color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;" /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">    make install</span><br style="outline: 0px; box-sizing: border-box; word-break: break-all; color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;" /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">5.杩愯</span><br style="outline: 0px; box-sizing: border-box; word-break: break-all; color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;" /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">    鏈嶅姟绔?#26473;愯 </span><br style="outline: 0px; box-sizing: border-box; word-break: break-all; color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;" /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">        export PATH=$PATH:鏈嶅姟绔痙istcc绋嬪簭璺緞:鏈嶅姟鍣紪璇戝伐鍏?#29882;緞</span><br style="outline: 0px; box-sizing: border-box; word-break: break-all; color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;" /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">        distcc --deamon --allow 192.168.0.0/16 </span><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;"> --job 8 --user nobody</span><br /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">    瀹埛绔?#26473;愯 :</span><br style="outline: 0px; box-sizing: border-box; word-break: break-all; color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;" /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">        export PATH=$PATH:瀹埛绔痙istcc绋嬪簭璺緞:瀹埛绔紪璇戝伐鍏?#29882;緞</span><br style="outline: 0px; box-sizing: border-box; word-break: break-all; color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;" /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">        export DISTCC_HOSTS="server_ip1 server_ip2 ..."</span><br style="outline: 0px; box-sizing: border-box; word-break: break-all; color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;" /><span style="color: #333333; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif, SimHei, SimSun; background-color: #ffffff;">        make -j8 CC=distcc<br />6銆乧make<br />cd build/<br /></span><pre><em>CC="distcc cc" CXX="distcc g++" cmake ../cmake/<br /><br /><br /><br /><br /><br />Other:<br /></em>?#31476;涓?#28598;瀷?#27537;C/C++椤圭洰?#27537;?#32042;璇戦潪甯歌楁椂銆俤istcc?#25328;ccache杩?#28051;?#28051;伐鍏疯兘澶熼潪甯告湁鏁?#37734;?#37720;嬬缉?#32042;璇戞椂?#26879;銆?#28729;?#28000;?#39582;?#28051;?#37828;?#37913;?#32468;嬬殑?#32042;璇?#37731;?#38171;岃?#37828;?#38320;嶅悎 GNU GCC浣?#37922;?#38171;?#28729;?#28000;殑璧勬枡鏄庣璇?#37828;?#39582;?#28051;?#37711;虫敞鍏?#28000;栫紪璇?#37731;?#38171;?#37510;俤istcc浠嬬粛涓?#29831;?#38171;屾湁浜?#28729;?#37825;寸紪璇慘DE椤圭洰鍙姳璐??#22414;?#25363;銆?#37721;?#29785;佸?#36346;?#22794;锛佹澶?#38171;?#28729;?#28000;兘?#28522;甯?#37828;?#37922;?#38171;?#28103;?#29831;佸?#29362;垎?#25363;?#27688;?#20824;涓?#37813;?#38171;?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />杩?#28051;?#28051;?#26916;圭洰?#27537;涓?#26916;?#38171;?br style="word-wrap: break-word;" />distcc            http://distcc.samba.org/<br style="word-wrap: break-word;" />ccache            http://ccache.samba.org/<br style="word-wrap: break-word;" />杩?#28051;?#28051;蒋浠剁殑瀹夎娌?#28000;涔堝璇寸殑锛岄兘鏄爣鍑嗙殑"./configure;make;make install"銆?#37734;Ubuntu涓?#28729;夎?#21614;?#23544;畝鍗?#38171;歴udo apt-get install distcc ccache銆?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />distcc?#20240;浣?#37720;熺悊锛?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />GCC ?#32042;璇C/C++鏋勫缓?#31476;涓猠xecualble?#22414;涓轰笁涓?#38339;舵锛?1)C/C++棰?#28598;勭悊(gcc -E)锛?#38171;?锛夌紪璇?gcc -c)锛?3)閾炬帴(ld)銆?#37711;?#28051;?#32471;?#27996;岄?#33333;鏄?#37825;堢巼鐡堕锛屽挨鍏?#37734;?#37816;?#28729;?#8220;-O2”绛変紭鍖栭?#26916;规椂銆俤istcc鏄竴涓紪璇?#37731;?#26937;卞姩鍣?#37510;?#28729;?#37734;?gcc -c"闃舵?#22443;妸棰?#28598;勭悊杈?#37713;哄垎鍙?#37714;版寚瀹氱殑鏈嶅姟鍣?#38339;?#37714;?#38171;堝悇鏈嶅姟鍣?#37929;戝惉TCP绔?#37721;?632锛?#39582;舵?#22549;?#21977;粨鏋?#37510;侴NU Make?#25328;SCons?#27537;"-j"骞惰?#23680;紪璇?#37721;互鍒?#37922;distcc鏉?#37716;?#38315;熺紪璇?#37510;?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />distcc鐢硶锛?br style="word-wrap: break-word;" />(1)鏈嶅姟鍣?#32468;互?#27352;閫?#37922;埛鎵?#29723;?#8220;distccd --daemon --allow 10.0.0.0/16”銆?#26473;?#28003;?#23536;distccd?#24116;鍙楁潵?#22172;10.0缃?#23048;电殑鎵?#28225;TCP杩炴帴銆?br style="word-wrap: break-word;" />?#25950;?#21104;锛歞istcc?#26499;妗?#28051;?#29831;?--allow 0.0.0.0"鏄帴鍙楁墍?#28225;杩炴帴锛?#38171;?#26473;?#23480;?#32513;?#26473;囨椂锛?#28729;?#38340;?#37825;?#37835;?#37828;?#37815;?#32513;?#37813;?#28225;杩炴帴锛?br style="word-wrap: break-word;" />(2)濡?#37835;滃伐绋嬩娇鐢automake鏈?#37714;?#37510;?br style="word-wrap: break-word;" />璁剧疆DISTCC_HOSTS?#24134;澧?#37721;?#38322;?#37510;?br style="word-wrap: break-word;" />鍦configure闃舵鎵?#29723;?CC=distcc ./configure"銆傜?#36346;悗鎵?#29723;?make -j XX"銆俋X鏄?#39582;?#37721;?#28000;诲姟?#26271;?#27952;涓婇?#24873;?br style="word-wrap: break-word;" />(3)濡?#37835;滃伐绋?#37922;盙NU make绠悊銆?br style="word-wrap: break-word;" />璁剧疆DISTCC_HOSTS?#24134;澧?#37721;?#38322;?#37510;?br style="word-wrap: break-word;" />淇?#37824;Makefile浣?#23536;?#37734;?#37720;?#37833;C/C++?#32042;璇?#37731;?#37722;嶇?#26495;?#23941;姞涓?distcc "锛屼?#23338;璁剧疆CC="distcc arm-linux-gcc"銆傜?#36346;悗鎵?#29723;?make -j XX"銆俋X鏄?#39582;?#37721;?#28000;诲姟?#26271;?#27952;涓婇?#24873;?br style="word-wrap: break-word;" />(4)濡?#37835;滃伐绋?#37922;盨Cons绠悊銆?br style="word-wrap: break-word;" />淇?#37824;筍Construct浣?#23536;?#37734;?#37720;?#37833;C/C++?#32042;璇?#37731;?#37722;嶇?#26495;?#23941;姞涓?distcc "銆傚鍑虹幆澧?#37721;?#38322;廐OME?#25328;DISTCC_HOSTS鍒?#37835;勫缓?#24134;澧?#38171;堟敞?#21104;SCons涓嶄細?#22172;?#23017;鎶?#32495;荤粺?#24134;澧?#37721;?#38322;忓鍑?#37714;builder瀛?#26473;?#32459;?#38171;?#38171;?br style="word-wrap: break-word;" /> Environment(ENV={'HOME': os.environ['HOME'],'DISTCC_HOSTS': ‘localhost 10.0.0.2’},...)<br style="word-wrap: break-word;" />鐒跺悗鎵?#29723;?scons -j XX"銆俋X鏄?#39582;?#37721;?#28000;诲姟?#26271;?#27952;涓婇?#24873;?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />distcc鏁呴殰澶勭悊锛?br style="word-wrap: break-word;" />杩愯?#23442;istccmon-gnome銆傚鏋?#37734;紪璇?#37832;熼棿鏌?#28051;distcc鏈嶅姟鍣竴鐩?#28051;嶆椿璺?#38171;?#37721;兘?#27537;鍘熷洜姣旇緝澶?#37510;?br style="word-wrap: break-word;" />distcc鏈嶅姟鍣殑闂?#26864;?#37721;?#38003;芥湁<br style="word-wrap: break-word;" />(1) IP鍦板潃涓?#37721;?#26440;?#37510;?br style="word-wrap: break-word;" />(2) distccd杩?#32459;?#23052;湁鍚姩銆?br style="word-wrap: break-word;" />(3) distcc瀹埛绔疘P涓?#37734;?-allow鎸?#28729;氱殑冨洿?#21812;銆?br style="word-wrap: break-word;" />(4) distccd鐩戝惉?#27537;3632绔?#37721;?#29722;?#38339;茬澧?#28766;忚斀銆?br style="word-wrap: break-word;" />distccd?#27537;鏃?#36423;?#29825;板綍鍦?var/log/messages銆傚?#21616;?#20345;椂鏌?#37930;嬩竴涓?#37510;?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />瀹埛绔殑闂?#26864;?#37721;?#38003;芥湁锛?br style="word-wrap: break-word;" />(1) ?#31476;浜涚幆澧?#37721;?#38322;?#23052;湁璁剧疆<br style="word-wrap: break-word;" />distcc渚?#29863;栫殑?#24134;澧?#37721;?#38322;忔湁HOME?#25328;DISTCC_HOSTS銆?br style="word-wrap: break-word;" />distcc 鏃?#36423;?#37734;?#29785;?#37712;?#38338;?#26864;?#37827;跺挨鍏舵湁鐢?#37510;傞?#27199;?#27537;閿?#29831;?#28103;伅杈?#37713;?#37734;console銆?#26473;?#37721;互璁剧疆DISTCC_VERBOSE?#25328;DISTCC_LOG?#24134;澧?#37721;?#38322;忎互璁板綍璇?#32513;嗙殑璋?#29831;?#28103;伅鍒颁竴鏃?#36423;楁枃浠?#38171;?#26473;?#28725;圭悊瑙distcc?#20240;浣?#26473;?#32459;?#28052;熼潪甯告湁鐢?#38171;?#37510;?#37721;傝僤istcc?#25328;distccd鑱?#37832;?#29999;?#37716;?#37510;?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />ccache?#20240;浣?#37720;熺悊锛?br style="word-wrap: break-word;" />ccache涔?#37828;竴涓紪璇?#37731;?#26937;卞姩鍣?#37510;傜?#31476;瓒熺紪璇戞椂ccache缂撳瓨浜咷CC?#27537;“-E”杈?#37713;?#37510;佺紪璇戦?#26916;逛互鍙?o?#26499;浠?#37714;?HOME/.ccache銆傜浜屾?#32042;璇?#37827;跺敖閲?#37714;?#37922;?#32514;撳瓨锛屽?#21616;?#20345;椂鏇存柊缂撳瓨銆?#37813;?#20114;鍗?#28003;?make clean; make"涔熻兘浠?#28051;?#38014;?#23536;?#28610;?#28598;?#37510;俢cache鏄?#32513;?#26473;?#28000;?#32513;嗙紪鍐欑殑锛岀淇?#27996;?#28051;庣?#23384;帴浣?#37922;GCC鑾?#23536;?#28729;?#37711;?#37929;稿?#23680;殑杈?#37713;?#37510;?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />ccache鐢硶锛?br style="word-wrap: break-word;" />寰?#32480;鍗?#38171;屽氨?#20762;涓婇潰distcc鐢硶鎻?#37714;扮殑?#20549;鏍?#38171;?#32513;?#37813;?#28225;C/C++?#32042;璇?#37731;?#37722;嶇?#26495;?#23941;姞涓?ccache "鍗?#37721;?#37510;?br style="word-wrap: break-word;" />ccache杩?#37721;互鎶distcc浣?#28051;哄悗鍙扮殑?#32042;璇?#37731;?#37510;傜紪璇?#37731;?#29825;剧疆涓?ccache distcc "锛?#37720;熺紪璇?#37731;?#37719;?#37721;?#37510;?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />浠?#37812;戠?#24531;?#21977;殑涓?#28051;?#26916;圭洰鏉湅锛?#37719;?#37913;?#28003;?#37922;ccache鎴杁istcc锛?#38340;localhost澶?#37721;?#37922;?鍙癲istcc鏈嶅姟鍣?#38171;?#37825;?#37835;?#23011;旇緝鏄捐憲銆?#28003;?#37828;?#38001;斿悎浣?#37922;distcc?#25328;ccache?#27537;鏁?#37835;滃氨?#25328;浠?#28003;?#37922;distcc宸?#28051;嶅銆?#28051;?#27996;哄?#37722;?#27996;?#37721;?#28003;?#37922;distcc锛?#28598;氬姞鍑?#37721;癲istcc鏈嶅姟鍣?#37510;?span style="color: #666666; font-family: 瀹嬩綋, Arial; font-size: 16px; white-space: normal; background-color: #ffffff;"></span><div style="word-wrap: break-word; color: #666666; font-family: 瀹嬩綋, Arial; font-size: 16px; white-space: normal; background-color: #ffffff;"><span class="Apple-style-span" style="word-wrap: break-word; font-family: verdana, sans-serif; font-size: 14px; line-height: 21px;"><br style="word-wrap: break-word;" /></span></div><div style="word-wrap: break-word; color: #666666; font-family: 瀹嬩綋, Arial; font-size: 16px; white-space: normal; background-color: #ffffff;"><span class="Apple-style-span" style="word-wrap: break-word; font-family: verdana, sans-serif; font-size: 14px; line-height: 21px;"><br style="word-wrap: break-word;" /></span></div><div style="word-wrap: break-word; color: #666666; font-family: 瀹嬩綋, Arial; font-size: 16px; white-space: normal; background-color: #ffffff;"><span class="Apple-style-span" style="word-wrap: break-word; font-family: verdana, sans-serif; font-size: 14px; line-height: 21px;">鐢distcc锛宑cache鏄?#28051;?#39582;村墠锛岄?#22317;洰?#31912;鏉熺殑绌洪殭锛岃嚜宸?#37815;挎潵鐜殑銆傚?#25780;椂鏄?#37734;arm涓婂?#27697;殑?#31476;涓?#23536;?#28598;殑?#20240;绋?#38171;屽?#25780;椂?#27537;PC锛?#37721;紪UI閮垎?#27688;?#28214;瑕?涓?#28751;忔椂锛?#26473;?#28052;?#37828;?#28051;?#28000;涔堝悗鏉?#37812;?#37922;垎?#31479;寮忕紪璇戠殑鍘熷?#29358;傞偅涓?#26916;圭洰鏄c++鍔燼dobe?#27537;flash锛?#28000;iphone?#20187;?#31476;娆?#23536;堢偒?#27537;鎵?#37832;?#38171;?#37711;?#28051;璘I鍏?#38318;?#37922;flash?#20187;锛?#37825;?#37835;?#23536;堢偒锛岄熷害?#27688;姣旇緝宸?#27996;?#37510;傚悗鏉?#38171;屾垜涔?#29831;?#26473;?#37734;arm9261锛?00MHz锛?#28051;?#37922;gnash鎾?#37824;flash锛?#37825;?#37835;滅瀹?#23011;旇緝?#31476;鑸?#37510;傝褰掓浼?#38171;?#26473;?#37828;?#37833;?#29831;?#28051;嬪垎?#31479;寮忕紪璇?#38171;?#37711;?#28729;?#28729;冪殑鍘熺?#21975;緢绠鍗?#38171;屾妸c?#26499;浠?#37734;?#37832;?#37832;?#26864;勭紪璇?#38171;?#37906;跺悗鍙?#37714;?#37711;?#28000;?#28051;?#37832;?#26473;?#29723;岀紪璇?#38171;岀紪璇戠殑鍚庣殑o?#26499;浠跺?#23940;?#29362;?#28852;湰鏈?#38171;?#37832;鍚?#37734;?#37832;?#37832;?#26473;?#29723;岄?#28844;帴銆?#23052;湁鐪嬭繃浠?#37934;?#38171;岀?#28356;?#23338;浜?#23011;?#28051;紪璇戠殑c?#26499;浠跺?#29808;簲浜?#37922;熶竴涓紪璇?#28000;诲姟锛?#28051;?#37721;?#37714;?#37711;?#28000;?#37832;?#37731;?#37812;?#37832;?#37832;?#38171;?#37832;缁?#28729;屾?#24878;紪璇?#37510;?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />鎴?#28000;殑?#24134;澧?#37828;ADS1.2+cygwin锛?#37922;tcc锛宼cpp杩?#29723;岀紪璇?#37510;俤istcc锛宑cache鏈?#37833;?#37828;?#37734;cygwin涓?#37929;存帴瑁呯殑?#27537;锛?#28003;嗗悗鏉?#37734;?#28003;?#37922;椂鍙戠?#39041;細?#37714;颁竴浜?#38338;?#26864;?#37510;?#37813;?#20114;浠庢簮鐮佺紪璇?#27996;?#37510;俤istcc浜?#37922;熺殑涓棿?#26499;浠?#37828;?i?#27537;鏍?#23534;?#38171;宼cc鏃犳硶璇?#37714;?#29831;枃浠?#32491;诲瀷锛岄渶瑕佷慨鏀?#23143;?#37934;?#37510;傚氨?#31476;鍙?#29831;?#38171;?#32515;?#28051;?#37721;互?#24755;鍒扮殑銆俰f(dcc_getenv_bool("DISTCC_KEEP_FILETYPE", 1)).鐒跺悗锛?/configure; make; make install銆俢cache闂?#26864;?#37828;竴鏍风殑锛?#37827;犳硶璇?#37714;?i?#26499;浠?#38171;?#28103;?#37824;筩cache.c锛屾妸涓棿?#26499;浠i/ii鏀?#28051;篶/cpp锛屼竴鏍风殑?#26591;寮忓?#22798;銆?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />鐒跺悗瑕佸瀹夎?#21615;殑涓?#29783;?#26473;?#29723;岄?#23943;疆锛屾?#25117;?#25780;椂?#27537;閰嶇疆濡?#28051;?#38171;?0.19.5.0缃?#23048;电殑涓?#37832;洪兘鍙互?#20187;鍗忓?#23680;紪璇戠殑涓?#37832;?#38171;屽綋?#21159;ads?#27537;licence鍙湁20涓暒銆傛澶勭洰褰?#29825;剧疆鑷?#37711;?#38322;嶈锛宼cc鏃犳硶璇?#37714;cygwin?#24134;澧?#38171;宼cc -c /cygdriver/c/a.c,  tcc鏃犳硶璇?#37721;栨枃浠?#38171;岄敊璇?#37934;佷负C3052E銆?#37714;?#37922;?#27996;cygwin鏃?#37721;互win32?#27537;璺緞锛?#37721;?#37721;互璇?#37714;玴osix璺緞銆?br style="word-wrap: break-word;" />export DISTCC_LOG='/var/log/distcc.log'<br style="word-wrap: break-word;" />export DISTCC_HOSTS='localhost 10.19.5.0/24'<br style="word-wrap: break-word;" />export DISTCC_VERBOSE=1<br style="word-wrap: break-word;" />export DISTCC_SAVE_TEMPS=1<br style="word-wrap: break-word;" />export TMPDIR=' e:/test '<br style="word-wrap: break-word;" />export CCACHE_DIR=e:/test<br style="word-wrap: break-word;" />export CCACHE_PREFIX=distcc<br style="word-wrap: break-word;" />export CCACHE_LOGFILE=e:/test/ccache.log<br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />distccd鍦?#23052;湁璁剧疆DISTCCD_PATH?#26882;锛?#28003;?#37922;?#32495;荤粺?#27537;PATH浣?#28051;?#37820;滅储锛屽拰makefile閲屾寚瀹氱殑涓嶄竴鑷?#37510;?#29825;剧疆浜DISTCCD_PATH锛?#23536;堣鍚?#37711;跺锛屽?#25780;椂鏄?#28051;?#28000;涔?#37510;傜?#36346;悗distccd --daemon --allow0.0.0.0/0锛?#28000;?#28003;昳p?#20824;鍙互?#24116;鍏?#38171;?#23011;旇緝绠鍗?#37510;?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />淇?#37824;makefile锛?#37734;CC锛孉RMCC锛孉RMCPP锛孴CPP鍘?#37833;殑璁剧疆?#22688;锛屾?#35826;姞ccache銆傞渶瑕?#29831;?#37828;庣殑鏄?#38171;宒istcc浠?#28051;虹紪璇?#37731;?#37715;嶇锛岀紪璇?#37731;殑鎸?#28729;氶渶瑕乨istcc <compiler style="word-wrap: break-word;">銆俤istcc鏀?#37816;佺殑?#32042;璇?#37731;?#36423;?#26916;?#37721;互棰勭紪璇?#38171;?#28052;熷氨鏄?#29999;?#37922;殑gcc -E杩?#37837;风殑閫?#26916;?#37510;?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />鏈鍚庣殑?#31092;璇?#23536;?#32480;鍗?#38171;岃嚜宸卞?#27283;akefile锛?#37721;仛".c.o:" 锛?#37906;跺悗鎶?o?#26499;浠堕?#28844;帴鍒板伐绋嬩腑?#27688;鍙互浜?#37510;?#37734;?#37813;?#37832;?#28051;?#26473;?#37828;?#37721;互寰堝?#30028;殑run璧?#37833;殑銆傚綋鐒堕獙璇佺殑?#20240;浣?#28051;?#37828;偅涔?#32480;鍗?#27996;?#38171;岀?#23337;簡涓?#37721;嶆?#22249;紪?#27537;浠?#37934;?#37510;備竴鍙?#28051;?#37832;虹紪璇戠殑?#25328;?#22414;?#31479;寮忕紪璇戠殑锛屾病?#28225;浠涔?#28598;?#28598;殑宸?#37714;?#38171;屾?#22249;紪绋嶆湁涓嶅悓锛?#28003;嗗?#29115;兘?#31476;鑷?#37510;?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />椤圭洰?#31912;鏉熷悗?#22172;宸?#37916;殑涓?#29783;?#38171;岃?#30028;劧娌湁鐢?#27996;?#28729;?#38340;呮潵鎻?#26946;?#37825;堢巼锛?#28003;?#26473;?#37828;?#28699;?#37714;?#27996;嗕竴浜?#28051;?#29783;?#37510;?/compiler></span></div><em><br /><br /><br /></em></pre><img src ="http://www.9087120.com/markqian86/aggbug/215912.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.9087120.com/markqian86/" target="_blank">闀挎垷鍗佷笁鍗?/a> 2018-09-08 20:56 <a href="http://www.9087120.com/markqian86/archive/2018/09/08/215912.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣璇?#29825;?/a></div>]]></description></item><item><title>Gperftools涓璽cmalloc?#27537;绠浠嬪拰浣?#37922;??#21812;瀛?#23049;勯湶http://www.9087120.com/markqian86/archive/2018/08/24/215870.html闀挎垷鍗佷笁鍗?/dc:creator>闀挎垷鍗佷笁鍗?/author>Fri, 24 Aug 2018 03:22:00 GMThttp://www.9087120.com/markqian86/archive/2018/08/24/215870.htmlhttp://www.9087120.com/markqian86/comments/215870.htmlhttp://www.9087120.com/markqian86/archive/2018/08/24/215870.html#Feedback0http://www.9087120.com/markqian86/comments/commentRss/215870.htmlhttp://www.9087120.com/markqian86/services/trackbacks/215870.htmlTcMalloc锛圱hread-CachingMalloc锛?#37828;google-perftools?#20240;鍏?#28051;殑?#31476;涓唴瀛?#32480;?#37918;嗗簱锛?#28051;庢爣鍑嗙殑glibc?#31793;涓malloc鐩?#23011;?#38171;孴cMalloc鍦唴瀛樺垎閰嶇殑鏁堢巼鍜岄熷害涓?#29781;?#26946;?#23536;?#28598;?#38171;?#37721;互鎻?#37719;?#26946;?#39582;?#37721;戞儏鍐?#28051;嬬殑鎬兘锛岄檷浣?#32495;荤粺?#27537;璐熻浇銆?/pre>
Google-perftools椤圭洰?#27537;缃戝潃涓?#38171;?a href="http://code.google.com/p/google-perftools/" style="text-decoration-line: none; color: #1d58d1;">http://code.google.com/p/google-perftools/锛?#29831;?#26916;圭洰鍖呮嫭TcMalloc銆乭eap-checker銆乭eap-profiler?#25328;cpu-profiler鍏?涓?#32513;?#28000;?#37510;?#37734;?#37721;?#28003;?#37922;TcMalloc?#20751;鍐?#28051;?#37721;互涓嶇紪璇?#37711;?#28000;栦笁涓?#32513;?#28000;?#37510;?/pre>
?#25950;锛?#28003;?#37922;?#32510;跨?#23338;唴瀛樻?#29365;殑?#26591;?#30838;锛?#37734;?#28751;忓?#30789;薄鏄?#37734;唴瀛樻睜涓?#26473;?#29723;屽垎閰?#38171;?#28003;?#37922;垎閰嶈緝澶氱殑?#21812;瀛?#32460;洪棿鏉紭鍖栧垎閰嶆椂?#26879;銆?/pre>
瀹?#37916;?#37720;熺悊璇?#37721;傝?#32515;戝潃http://goog-perftools.sourceforge.net/doc/tcmalloc.html銆?/pre>

绠浠?/h1>
TcMalloc鏄竴涓?#37922;盙oogle寮鍙戠殑锛?#23011;glibc?#27537;malloc?#27967;蹇殑?#21812;瀛?#32480;?#37918;嗗簱銆?#38315;氬?#21578;儏鍐?#28051;媝tmalloc2?#20824;鍦?00ns鎵?#29723;屼竴涓猰alloc?#25328;free瀵?#38171;岃孴cMalloc?#20824;鍦?0ns?#21812;鎵?#29723;屼竴涓猰alloc?#25328;free瀵?#37510;?/pre>
TcMalloc鍙互鍑忓?#25117;?#27697;?#36328;绋嬪簭涔嬮棿?#27537;閿佷簤鐢?#38338;?#26864;?#38171;?#37734;?#28751;忓?#30789;薄涓婅兘杈?#37714;?#38342;朵簤鐢?#37510;?/pre>
TcMalloc涓?#23011;?#28051;?#32510;跨鍗?#37913;垎閰嶄竴涓?#32510;跨鏈?#37734;扮殑Cache锛屽皯閲忕殑鍦板潃?#22414;閰嶅氨鐩存帴浠嶤ache涓垎閰?#38171;?#39582;?#28051;?#28729;?#37832;熷?#27692;瀮鍦?#37733;炴敹锛屽?#21977;?#36328;鏈?#37734;癈ache涓殑绌?#38338;插唴瀛樿繑鍥?#32513;?#37711;?#28766;鎺?#37714;跺爢銆?/pre>
TcMalloc璁?#28051;哄皬浜?#38171;?lt;=锛?2K涓哄?#24531;?#30789;薄锛?#28598;?#28725;硅薄鐩存帴浠?#37711;?#28766;鎺?#37714;跺爢涓婁互椤?#38171;?K锛?#28051;?#37719;?#28003;?#26473;?#29723;屽垎閰?#38171;?#28052;熷氨鏄?#29831;?#28598;?#28725;硅薄鎬?#37828;?#26916;?#28725;?#27067;愮殑銆?/pre>
TcMalloc涓竴涓?#26916;?#37721;互瀛?#37711;竴浜?#37929;稿悓澶?#28751;忕殑灏忓?#30789;薄锛屽?#24531;?#30789;薄浠?#37832;?#37734;板唴瀛?#38334;?#29723;?#28051;垎閰?#38171;?#28598;?#28725;硅薄浠?#28051;?#36423;冨唴瀛樺爢涓垎閰?#37510;?/pre>

瀹夎

Linux涓媡cmalloc?#27537;瀹夎?#21616;繃绋嬪涓?#38171;?/pre>
1锛?nbsp; 浠嶨oogle婧?#28000;?#37934;佺?#25117;潃涓?#28051;嬭?#33445;簮浠?#37934;佸寘锛?#37916;?#37734;?#37832;鏂?#37911;?#37832;?#28051;?.0锛?/pre>
2锛?nbsp; 瑙?#37720;嬬缉婧?#28000;?#37934;佸寘
# unzip gperftools-2.0.zip          鎴?/pre>
# tar zxvf gperftools-2.0.tar.gz
3锛?nbsp; ?#32042;璇戝姩鎬佸簱
# cd gperftools-2.0
# ./ configure  --disable-cpu-profiler --disable-heap-profiler--disable-heap-checker 
--disable-debugalloc--enable-minimal
鍔?#37711;?#28051;婇潰?#27537;鍙傛暟鏄?#28051;?#27996;?#37721;?#37922;?#37812;恡cmalloc_minimal?#23017;鎬佸簱锛屽鏋滈渶瑕佹墍?#28225;缁?#28000;?#38171;屽懡浠?#28641;?#28051;?#38171;?/pre>
# ./configure
# ./configure -h           鐢?#27996;庢煡鐪嬬紪璇戦?#26916;?#37510;?/pre>
?#32042;璇戝拰瀹夎锛?/pre>
# make&& make install
浣?#37922;?#37832;灏忓?#22798;?#21614;椂鎶妕cmalloc_minimal?#27537;?#23017;鎬佸?#25780;?#30127;礉鍒?#32495;荤粺?#27952;褰?#28051;?#38171;?/pre>
# cplib/tcmalloc_minimal.so.0.0.0 /usr/local/lib
鍒涘缓?#33931;杩炴帴鎸囧悜tcmalloc锛?/pre>
# ls –s /usr/local/lib/libtcmalloc_minimal.so.0.0.0/usr/local/lib/libtcmalloc.so
鍚姩绋嬪簭涔嬪墠锛岄鍏堝姞?#27975;tcmalloc?#23017;鎬佸簱?#27537;?#24134;澧?#37721;?#38322;?#29825;剧疆锛?/pre>
# exportLD_PRELOAD=”/usr/local/lib/libtcmalloc.so
浣?#37922;losf妫鏌?#32459;嬪簭鏄?#37722;?#23480;?#32513;忓姞?#27975;tcmalloc?#31793;锛?/pre>
# lsof -n | greptcmalloc
鍦Linux涓嬩娇鐢殑tcmalloc瀹夎瀹屾垚锛?#37734;Windows涓嬩娇鐢VS锛?003?#20114;涓?#37911;?#37832;?#38171;?#37813;?#23534;?#20240;绋?#26916;圭洰gperftools.sln杩?#29723;岀紪璇?#37510;?/pre>

浣?#37922;?/h1>
灏唋ibtcmalloc.so/libtcmalloc.a閾炬帴鍒?#32459;嬪簭涓?#38171;屾?#26668;?#29825;剧疆LD_PRELOAD=libtcmalloc.so銆?#26473;?#37837;峰氨鍙互浣?#37922;tcmalloc?#31793;涓殑鍑芥?#29256;?#25358;崲鎺夋搷浣?#32495;荤粺?#27537;malloc銆乫ree銆乺ealloc銆乻trdup?#21812;瀛?#32480;悊鍑芥暟銆?#37721;互璁剧疆?#24134;澧?#37721;?#38322;?#29825;剧疆濡?#28051;?#38171;?/pre>
         TCMALLOC_DEBUG=<level>       璋?#29831;曠骇鍒?#38171;?#37721;栧?#28051;?-2
         MALLOCSTATS=<level>                    璁剧疆鏄剧?#21700;唴瀛?#28003;?#37922;?#37912;?#37804;佺骇鍒?#38171;?#37721;栧?#28051;?-2
         HEAPPROFILE=<pre>                     鎸?#28729;氬唴瀛?#23049;勯湶妫鏌殑鏁版嵁瀵?#37713;烘枃浠?/pre>
         HEAPCHECK=<type>                        鍫?#22955;鏌?#32491;诲瀷锛宼ype=normal/strict/draconian
TcMalloc?#31793;杩?#37721;互杩?#29723;屽唴瀛?#23049;勯?#33580;殑妫鏌?#38171;?#28003;?#37922;?#26473;?#28051;?#37716;?#38003;芥湁涓?#32457;嶆柟?#30838;锛?/pre>
1锛夊皢tcmalloc?#31793;閾炬帴鍒?#32459;嬪簭涓?#38171;屾敞鎰忓簲璇?#28751;唗cmalloc?#31793;鏈鍚?#38334;炬帴鍒?#32459;嬪簭涓?#38171;?/pre>
2锛?#29825;剧疆LD_PRELOAD=”libtcmalloc.so”/HEAPCHECK=normal锛?#26473;?#37837;峰氨涓嶉渶閲嶆?#25198;紪璇戠?#23338;簭
鎵?#23534;妫鏌?#37716;熻兘锛屾湁涓?#32457;嶆柟寮?#37721;互寮鍚?#23049;勯湶妫鏌?#37716;熻兘锛?/pre>
1锛?nbsp; 浣?#37922;幆澧?#37721;?#38322;?#38171;屽鏁?#28051;?#32459;嬪簭杩?#29723;屾鏌?#38171;?HEAPCHECK=normal /bin/ls
2锛?nbsp; 鍦?#23143;?#28000;?#37934;佷腑鎻?#37711;?#22955;鏌?#37904;?#38171;?#26473;?#37837;?#37721;互鎺?#37714;?#37721;?#22955;鏌?#32459;嬪?#24533;殑鏌?#27996;?#38318;垎锛?#28000;?#37934;佸涓?#38171;?/pre>
HeapProfileLeakCheckerchecker("foo");        // 寮濮嬫鏌?/pre>
Foo();                                                                         // ?#28214;瑕佹鏌殑閮垎
assert(checker.NoLeaks());                                 // ?#31912;鏉熸鏌?/pre>
璋?#37922;checker?#32531;绔嬩竴涓唴瀛?#36423;?#37907;?#38171;?#37734;?#29835;?#37922;checker.NoLeaks?#32531;绔?#37721;竴涓?#36423;?#37907;?#38171;?#37906;跺悗杩?#29723;?#23011;旇緝锛屽鏋滃唴瀛樻湁澧?#38336;挎?#26668;?#28000;绘剰鍙?#37718;?#38171;NoLeaks鍑芥暟杩?#37733;false锛?#39582;惰緭鍑轰竴涓?#28103;伅鍛?#29831;?#28003;犲浣?#28003;?#37922;pprof?#20240;鍏?#37833;垎鏋?#37711;?#28003;撶殑?#21812;瀛?#23049;勯湶銆?/pre>
    鎵?#29723;屽唴瀛樻鏌?
         #LD_PRELOAD=libtcmalloc.so HEAPCHECK=strict HEAPPROFILE=memtm ./a.out
鎵?#29723;?#28729;屾垚鍚庝細杈?#37713;烘鏌殑?#31912;鏋?#38171;屽鏋滄湁娉勯湶锛宲prof?#32048;杈?#37713;?#23049;勯湶澶氬皯涓?#28699;楄妭锛屾湁澶氬?#25118;?#22414;閰?#38171;?#28052;熶細杈?#37713;?#29831;?#32513;嗙殑鍒?#29723;?#37816;?#37713;?#37734;?#28000;涔?#37734;版柟?#22414;閰嶅拰?#22414;閰嶅?#27692;?#25118;銆?/pre>
         姣旇緝涓?#28051;?#36423;?#37907;?#38171;?/pre>
         #pprof --base=profile.0001.heap 绋嬪?#24531;悕 profile.0002.heap
    宸茬煡?#21812;瀛?#23049;勬?#24532;椂锛?#37711;?#38338;唴瀛?#23049;勯湶妫鏌殑浠?#37934;?#38171;?/pre>
void *mark =HeapLeakChecker::GetDisableChecksStart();
<leaky code>           //涓嶅仛娉勬?#24532;鏌殑閮垎
HeapLeakChecker::DisableChecksToHereFrom(mark);
         ?#25950;锛氬湪鏌?#27996;沴ibc涓?#32459;嬪簭鍙兘瑕佸叧闂?#22955;鏌?#37813;?#38003;芥甯稿伐浣?#37510;?/pre>
         ?#25950;锛?#28051;?#38003;芥鏌暟缁?#37714;?#38340;殑?#21812;瀛?#23049;勯湶锛?#23011;?#28641;?#38171;char *str = new char[100]; delete str;銆?br />

=================================瀹夎缂哄?#25117;簱============================

libunwind?#31793;涓哄熀浜?4浣岰PU?#25328;鎿?#28003;?#32495;荤粺?#27537;绋嬪簭鎻愪緵浜嗗熀鏈殑鍫?#37837;?#26440;楄浆寮瑙?#37716;熻兘锛?#37711;?#28051;?#37718;呮嫭鐢?#27996;?#26440;?#37713;哄爢鏍?#29882;熻釜?#27537;API銆佺敤浜庝互?#32042;绋嬫柟寮?#26440;楄浆寮瑙?#37739;?#37837;堢殑API?#20114;鍙?#37824;?#37816;C++寮?#29999;稿?#21229;悊鏈?#37714;剁殑API銆?/p>

64浣嶆搷浣?#32495;荤粺?#31476;瀹?#29781;佸厛瑁libunwind杩?#28051;簱銆?/p>

wget http://download.savannah.gnu.org/releases/libunwind/libunwind-1.1.tar.gz

tar zxvf libunwind-1.1.tar.gz
cd libunwind-1.1
CFLAGS=-fPIC ./configure
make CFLAGS=-fPIC
make CFLAGS=-fPIC install


]]>WINDOWS璁?#38338;SAMBA鎻愮娌湁鏉?#38340;?/title><link>http://www.9087120.com/markqian86/archive/2018/08/16/215850.html</link><dc:creator>闀挎垷鍗佷笁鍗?/dc:creator><author>闀挎垷鍗佷笁鍗?/author><pubDate>Thu, 16 Aug 2018 09:09:00 GMT</pubDate><guid>http://www.9087120.com/markqian86/archive/2018/08/16/215850.html</guid><wfw:comment>http://www.9087120.com/markqian86/comments/215850.html</wfw:comment><comments>http://www.9087120.com/markqian86/archive/2018/08/16/215850.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.9087120.com/markqian86/comments/commentRss/215850.html</wfw:commentRss><trackback:ping>http://www.9087120.com/markqian86/services/trackbacks/215850.html</trackback:ping><description><![CDATA[<p style="margin-top: 10px; margin-bottom: 10px;">LINUX samba閰嶇疆鍏?#27996;枃浠剁洰褰?/p><p style="margin-top: 10px; margin-bottom: 10px;"> </p><div id="blog_content"><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">1.浣?#37922;rpm -qa|grep samba 鏌湅鏄?#37722;?#28729;夎samba</p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"> </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">samba-winbind-clients-3.5.4-68.el6.x86_64</p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">samba-3.5.4-68.el6.x86_64</p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">samba-client-3.5.4-68.el6.x86_64</p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">samba-common-3.5.4-68.el6.x86_64</p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">宸?#28729;夎</p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">2.鏇存敼/etc/samba/smb.conf閰嶇疆</p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"> </p><div style="word-break: break-word; background-color: #ffffff;"><div><div>C浠?#37934;?a title="鏀惰棌杩?#23048;?#28000;?#37934;? style="background-image: none;"></a></div></div><ol style="padding-left: 40px;"><li style="line-height: 1.6; list-style-type: decimal;">[global] </li><li style="line-height: 1.6; list-style-type: decimal;">    dos charset = cp936 </li><li style="line-height: 1.6; list-style-type: decimal;">    display charset = UTF-8 </li><li style="line-height: 1.6; list-style-type: decimal;">    workgroup = MYGROUP </li><li style="line-height: 1.6; list-style-type: decimal;">    server string = Samba Server Version %v </li><li style="line-height: 1.6; list-style-type: decimal;">    log file = /var/log/samba/log.%m </li><li style="line-height: 1.6; list-style-type: decimal;">    max log size = 50 </li><li style="line-height: 1.6; list-style-type: decimal;">    cups options = raw </li><li style="line-height: 1.6; list-style-type: decimal;"> </li><li style="line-height: 1.6; list-style-type: decimal;">[homes] </li><li style="line-height: 1.6; list-style-type: decimal;">    comment = Home Directories </li><li style="line-height: 1.6; list-style-type: decimal;">    read only = No </li><li style="line-height: 1.6; list-style-type: decimal;">    browseable = No </li><li style="line-height: 1.6; list-style-type: decimal;"> </li><li style="line-height: 1.6; list-style-type: decimal;">[printers] </li><li style="line-height: 1.6; list-style-type: decimal;">    comment = All Printers </li><li style="line-height: 1.6; list-style-type: decimal;">    path = /var/spool/samba </li><li style="line-height: 1.6; list-style-type: decimal;">    printable = Yes </li><li style="line-height: 1.6; list-style-type: decimal;">    browseable = No </li><li style="line-height: 1.6; list-style-type: decimal;"> </li><li style="line-height: 1.6; list-style-type: decimal;">[tools] </li><li style="line-height: 1.6; list-style-type: decimal;">    comment = tools </li><li style="line-height: 1.6; list-style-type: decimal;">    path = /tools </li><li style="line-height: 1.6; list-style-type: decimal;">    read only = No </li><li style="line-height: 1.6; list-style-type: decimal;">    guest ok = Yes </li><li style="line-height: 1.6; list-style-type: decimal;"> </li><li style="line-height: 1.6; list-style-type: decimal;">[home] </li><li style="line-height: 1.6; list-style-type: decimal;">    comment = User Directory </li><li style="line-height: 1.6; list-style-type: decimal;">    path = /home/%U </li><li style="line-height: 1.6; list-style-type: decimal;">    read only = No </li></ol></div><pre name="code" style="white-space: pre-wrap; word-wrap: break-word; margin-top: 0px; margin-bottom: 0px; margin-left: 22px; background-color: #ffffff;">[global] dos charset = cp936 display charset = UTF-8 workgroup = MYGROUP server string = Samba Server Version %v log file = /var/log/samba/log.%m max log size = 50 cups options = raw [homes] comment = Home Directories read only = No browseable = No [printers] comment = All Printers path = /var/spool/samba printable = Yes browseable = No [tools] comment = tools path = /tools read only = No guest ok = Yes [home] comment = User Directory path = /home/%U read only = No</pre><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">娣诲姞smb璁?#38338;?#37922;埛smbpasswd -a root</p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"> </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">3.閲嶅惎service smb restart</p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">4.濡?#37835;windows涓嬬?#35826;綍samba鏈嶅姟鍣?#37722;?#37827;犳硶璁?#38338;linux涓?#37711;?#27996;洰褰?#38171;屾?#24878;娌湁鏉?#38340;愩?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">鍒欐鏌?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"> </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">a銆佺淇漧inux涓?#38339;茬澧?#37711;?#38338;?#37812;栬?#37828;?#23534;鏀?#37711;?#27996;洰褰?#37833;?#38340;?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"> </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">b銆佺淇漵amba鏈嶅姟鍣?#38320;嶇疆?#26499;浠秙mb.conf璁剧疆娌湁闂?#26864;?#38171;?#37721;?#32515;?#28051;?#37836;槄璧勬枡?#28229;閰嶇疆鍔炴硶  </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">c銆佺淇漵etlinux鍏?#38338;?#38171;?#37721;互鐢setenforce 0鍛?#28000;?#37813;?#29723;?#37510;?榛樿?#27537;锛孲ELinux绂佹缃戠粶涓婂?#31565;amba鏈嶅姟鍣?#28051;婄殑鍏?#27996;洰褰?#26473;?#29723;屽?#27408;搷浣?#38171;?#37719;?#28003;?#28003;?#37734;smb.conf涓?#37711;?#29825;?#27996;?#26473;?#26916;规搷浣?#37510;?      /usr/bin/setenforce 淇?#37824;筍ELinux?#27537;瀹炴?#24816;?#24879;?#23678;寮? </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">setenforce 1 璁剧疆SELinux 鎴?#28051;enforcing妯?#23534;?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">setenforce 0 璁剧疆SELinux 鎴?#28051;permissive妯?#23534;? </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">濡?#37835;?#29781;佸?#35826;?#26336;?#20346;敤SELinux ?#28214;瑕佸湪/etc/sysconfig/selinux涓?#29825;剧疆鍙傛暟selinux=0 锛屾?#26668;?#37734;?etc/grub.conf涓?#23075;诲姞杩?#28051;?#37721;傛暟</p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">  /usr/bin/setstatus -v  </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"> </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"> </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"> </p><div></div></div><img src ="http://www.9087120.com/markqian86/aggbug/215850.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.9087120.com/markqian86/" target="_blank">闀挎垷鍗佷笁鍗?/a> 2018-08-16 17:09 <a href="http://www.9087120.com/markqian86/archive/2018/08/16/215850.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣璇?#29825;?/a></div>]]></description></item><item><title>google寮婧愮殑C++鎬兘?#22414;鏋愬伐鍏?- gperftoolshttp://www.9087120.com/markqian86/archive/2018/07/13/215779.html闀挎垷鍗佷笁鍗?/dc:creator>闀挎垷鍗佷笁鍗?/author>Fri, 13 Jul 2018 05:47:00 GMThttp://www.9087120.com/markqian86/archive/2018/07/13/215779.htmlhttp://www.9087120.com/markqian86/comments/215779.htmlhttp://www.9087120.com/markqian86/archive/2018/07/13/215779.html#Feedback0http://www.9087120.com/markqian86/comments/commentRss/215779.htmlhttp://www.9087120.com/markqian86/services/trackbacks/215779.html

gperftools鏄疓oogle鎻愪?#28058;殑?#31476;濂楀伐鍏?#38171;?#37711;?#28051;殑?#31476;涓?#37716;熻兘鏄疌PU profiler锛?#37922;?#27996;庡垎鏋?#32459;嬪簭鎬兘锛屾壘鍒?#32459;嬪?#24533;殑鎬兘鐡堕銆?nbsp;
Graphviz鏄竴涓?#37922;AT&T瀹為獙瀹?#37722;姩?#27537;寮婧愬伐鍏?#37718;?#38171;?#37922;?#27996;庣粯鍒禗OT璇言鑴?#37832;?#37819;?#26473;扮殑鍥?#35120;?#38171;gperftools渚濋?#29363;?#20240;鍏?#37922;?#37812;?#37733;?#35120;垎鏋愮粨鏋?#37510;?nbsp;
瀹夎?#21613;懡浠?#38171;歽um install graphviz 
?#32042;璇google-perftools 
?#27932;涓?#37812;?#28000;?#37721;渶瑕乼cmalloc鍔熻兘锛屽洜姝?#28051;嶇紪璇google-perftools涓殑鍏?#28000;栧伐鍏?#37510;?nbsp;
wget 
http://gperftools.googlecode.com/files/google-perftools-1.9.1.tar.gz 
tar -xvzf google-perftools-1.9.1.tar.gz 
cd google-perftools-1.9.1 
./configure –disable-cpu-profiler –disable-heap-profiler –disable-heap-checker –enable-minimal–disable-dependency-tracking 
make 
makeinstall 
/sbin/ldconfig 
鐢硶 
1.?#27952;?#29219;绋嬪簭涓?#23534;?#37711;?#28598;存枃浠?/p>

绀轰緥锛?/h2>
#include <google/profiler.h> #include <iostream> using namespace std; void func1() {    int i = 0;    while (i < 100000) {        ++i;    }   } void func2() {    int i = 0;    while (i < 200000) {        ++i;    }   } void func3() {    for (int i = 0; i < 1000; ++i) {        func1();        func2();    }   } int main(){    ProfilerStart("my.prof"); // 鎸?#28729;?#37813;鐢?#37812;愮殑profile?#26499;浠跺悕    func3();    ProfilerStop(); // ?#31912;鏉profiling    return 0; }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27

鐒跺?#24227;紪璇戦?#28844;帴杩愯锛?#28003;?#37922;pprof鐢?#37812;愬垎鏋愮粨鏋?nbsp;
g++-o demo demo.cpp -lprofiler 
杩愯?#23442;emo锛?#37922;?#37812;恗y.prof?#26499;浠?#38171;?#37906;跺悗鐢pprof鍛?#28000;?#28725;?#29831;枃浠惰鏋?#38171;?#37922;?#37812;愮粨鏋渢xt鎴杙df绛?#37510;?nbsp;
pprof–text ./demo my.prof > output.txt 
pprof–pdf ./demo my.prof > output.pdf

pdf鏍?#23534;忕殑姣旇緝鐩?#29785;?/span> 
杩?#38322;屽啓鍥?#37911;囨弿杩? title=
鍥?#35120;?#26891;庢牸?#27537;?#31912;鏋?#37922;?#38010;傜?#29808;拰?#28225;鍚戣?#22317;?#21228;垚锛?nbsp;
姣?#28051;?#38010;傜偣浠?#29723;竴涓?#37713;芥暟锛岃?#20636;偣鏁版嵁鏍?#23534;?#38171;?nbsp;
Class Name 
Method Name 
local (percentage) 
of cumulative (percentage) 
local?#26882;?#26879;鏄?#37713;芥暟鐩存帴鎵?#29723;岀殑鎸?#28000;?#37813;娑堣楃殑CPU?#26882;?#26879;锛堝?#21614;嫭鍐呰仈鍑芥暟锛?#37510;?#37804;兘?#22414;鏋?#38315;?#26473;?#37814;芥?#38155;柟?#30838;瀹屾垚锛岄?#27199;鏄?绉?00涓?#37837;?#37832;?#38171;屼竴涓?#37837;?#37832;?#37828;?0姣?#32457;?#38171;?#37719;虫椂?#26879;鍗?#28003;?#37828;?0姣?#32457;?#38171;沜umulative?#26882;?#26879;鏄痩ocal?#26882;?#26879;涓?#37711;?#28000;?#37713;芥暟璋?#37922;殑鎬诲拰锛?#28641;?#37835;渃umulative?#26882;?#26879;涓巐ocal?#26882;?#26879;鐩稿悓锛?#37714;?#28051;嶆墦鍗癱umulative?#26882;?#26879;椤?#37510;?nbsp;
?#28225;鍚戣竟锛?#29835;?#37922;?#38000;呮?#22247;?#25123;璋?#37922;?#38000;?#38171;屾湁鍚戣竟涓婄殑?#26882;?#26879;琛?#32448;?#29722;?#29835;?#37922;?#38000;?#37813;娑堣楃殑CPU?#26882;?#26879;

濡?#37835;?#37922;?#37812;pdf?#26882;鎶?#38335;?#38171;ps2pdf command not found锛岄偅涔?#29781;佸?#22798;Ghostscript銆?nbsp;
涓嬭浇鍦板潃锛?nbsp;
http://www.linuxfromscratch.org/blfs/view/cvs/pst/gs.html 
鐧惧害鍦板潃锛?nbsp;
http://pan.baidu.com/s/1hsP2N56#list/path=%2F 
瀹夎?#21615;殑?#26882;?#26879;浼氬緢闀?#38171;岃鑰?#36423;?#32475;夊緟銆?/p>

?#26499;鏈?#26891;庢牸杈?#37713;虹粨鏋?/span> 
Total: 116 samples 
83 71.6% 71.6% 83 71.6% func2 
33 28.4% 100.0% 33 28.4% func1 
0 0.0% 100.0% 116 100.0% __libc_start_main 
0 0.0% 100.0% 116 100.0% _start 
0 0.0% 100.0% 116 100.0% func3 
0 0.0% 100.0% 116 100.0% main 
?#31476;鍏?鍒?#38171;屽垎鍒?#28000;?#29723;殑?#21104;鎬?#37828;?#38171;?nbsp;
?#22414;鏋?#37837;?#37832;暟閲?#38171;?#28051;嶅寘鍚?#37711;?#28000;?#37713;芥暟璋?#37922;?#38171;?nbsp;
?#22414;鏋?#37837;?#37832;?#37927;惧垎姣?#38171;?#28051;嶅寘鍚?#37711;?#28000;?#37713;芥暟璋?#37922;?#38171;?nbsp;
?#27952;?#22688;涓烘?#27537;?#22414;鏋?#37837;?#37832;?#37927;惧垎姣?#38171;?#28051;嶅寘鍚?#37711;?#28000;?#37713;芥暟璋?#37922;?#38171;?nbsp;
?#22414;鏋?#37837;?#37832;暟閲?#38171;堝寘鍚?#37711;?#28000;?#37713;芥暟璋?#37922;?#38171;?nbsp;
?#22414;鏋?#37837;?#37832;?#37927;惧垎姣?#38171;堝寘鍚?#37711;?#28000;?#37713;芥暟璋?#37922;?#38171;?nbsp;
鍑芥暟鍚?/p>

?#25950;?#21104;锛?/h2>

gperftools?#28214;瑕佺?#23338;簭姝?#29999;?#38315;鍑?#37813;嶈兘鍚prof?#26499;浠?#37813;?#37719;版?#29256;嵁锛屾墍?#20114;褰?#32459;嬪簭鏃犳硶閫鍑烘椂锛?#23536;楄?#20344;?#25126;佷俊鍙?#32513;?#26473;?#32459;?#38171;?#37734;帴鍒?#28103;?#37721;?#37722;?#38171;岃皟鐢ProfilerStop();鍑芥暟锛屾墠鑳芥墦鍗?#37713;?#37825;版嵁銆傚涓?#37813;绀?#38171;?/p>

void signal_handler(int signo) {     signal(signo, signal_handler);     INFO_LOG("recv signal[%d]", signo);     switch(signo)     {               case SIGTERM:              //绋嬪簭?#22172;宸?#38315;鍑?#38171;屾垨shell閲岃皟鐢kill缂虹渷璇?#26473;?#32459;?#37510;?#29831;?#28103;?#37721;?#37721;互琚?#38339;诲锛屾?#26668;澶勭悊              //鍙互鍦?#26473;?#38322;屽仛?#31476;浜?#32459;嬪簭閫鍑哄?#23943;殑鏈鍚?#28598;勭?#21975;伐浣?/span>              ProfilerStop();              INFO_LOG("Process recieve SIGTERM");              break;           }     exit(0); } //涓?#37713;芥暟 signal(SIGTERM, &signal_handler);
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

鐢valgrind?#27537;callgrind?#20240;鍏?#28052;?#37721;互杩?#29723;屽垎鏋?#32459;嬪簭鎬兘銆?nbsp;
?#22414;浜竴涓?#37825;?#32459;?#38171;?a href="http://www.tuicool.com/articles/nUZJBb2" rel="nofollow" target="_blank" style="outline: 0px; cursor: pointer; box-sizing: border-box; text-decoration-line: none; word-break: break-all; color: #6795b5;">http://www.tuicool.com/articles/nUZJBb2



]]>linux鐧诲綍鍚?#37713;?#37916;?bash-4.1$锛岃鍐?#37716;炴硶?#20114;鍙婇?#37812;?#26473;?#37837;风殑鍘熷洜http://www.9087120.com/markqian86/archive/2018/07/06/215764.html闀挎垷鍗佷笁鍗?/dc:creator>闀挎垷鍗佷笁鍗?/author>Fri, 06 Jul 2018 12:00:00 GMThttp://www.9087120.com/markqian86/archive/2018/07/06/215764.htmlhttp://www.9087120.com/markqian86/comments/215764.htmlhttp://www.9087120.com/markqian86/archive/2018/07/06/215764.html#Feedback0http://www.9087120.com/markqian86/comments/commentRss/215764.htmlhttp://www.9087120.com/markqian86/services/trackbacks/215764.html

linux鐧诲綍鍚庢湁鏃跺欎?#27692;嚭鐜?bash-4.1$

閫?#37812;?#26473;?#37837;风殑鍘熷洜锛?/span> 
涓?#26473;?#28051;?#37922;埛?#28225;鍏崇幆澧?#37721;?#38322;?#23052;?#27996;?#38171;屾湁鍏崇殑?#26499;浠惰鍒?#38340;?#37510;?#28052;熷氨鏄?#37922;埛?#27537;瀹剁洰褰?#28051;嬮潰 .bash_profile .bashrc 琚?#37714;?#38340;?#37510;?/p>

瑙?#37712;?#37716;炴硶锛?/span>

##棣?#37711;?#37714;囨崲鍒版?#21620;殰鐢埛 su - test ##澶?#37714;跺?#29808;簲?#27537;?#26499;浠?#38171;?#28051;嶈?#20346;敤root鐩存帴澶?#37714;?#38171;屽惁鍒?#28598;?#37714;惰繃鍘荤殑涓?#29783;?#28766;?#28051;?#38171;屾暟缁勯兘鏄痳oot?#27537;锛?-bash-4.1$ cp /etc/skel/.bash*  ~  ##(/etc/skel 鏂?#37922;?#37812;疯佸?#21057;殑鏍?#28699;?#38171;屾墍?#20114;浠?#26473;?#38322;?#28598;?#37714;? -bash-4.1$ ls -la total 24 drwx------  2 test test 4096 Nov  5 14:51 . drwxr-xr-x. 6 root    root    4096 Nov  5 14:44 .. -rw-------  1 test test   21 Nov  5 14:45 .bash_history -rw-r--r--  1 test test   18 Nov  5 14:51 .bash_logout -rw-r--r--  1 test test  176 Nov  5 14:51 .bash_profile -rw-r--r--  1 test test  124 Nov  5 14:51 .bashrc -bash-4.1$ logout [root@xxxx ~]# su - test [test@xxxx ~]$ 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

鎼?#28729;?#27996;?/p>



]]>c++杩?#37922;backtrace杩借釜鍑芥暟璋?#37922;殑鍫?#37837;?/title><link>http://www.9087120.com/markqian86/archive/2018/06/29/215755.html</link><dc:creator>闀挎垷鍗佷笁鍗?/dc:creator><author>闀挎垷鍗佷笁鍗?/author><pubDate>Fri, 29 Jun 2018 09:03:00 GMT</pubDate><guid>http://www.9087120.com/markqian86/archive/2018/06/29/215755.html</guid><wfw:comment>http://www.9087120.com/markqian86/comments/215755.html</wfw:comment><comments>http://www.9087120.com/markqian86/archive/2018/06/29/215755.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.9087120.com/markqian86/comments/commentRss/215755.html</wfw:commentRss><trackback:ping>http://www.9087120.com/markqian86/services/trackbacks/215755.html</trackback:ping><description><![CDATA[<p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, "Lucida Grande", Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;"><span style="font-size: medium;">?#31476;鑸?#28725;熺湅鍑芥暟杩愯鏃跺爢鏍堢殑?#26591;?#30838;鏄?#28003;?#37922;GDB涔?#32491;荤殑澶?#38318;?#29835;?#29831;?#37731;?浣?#37828;??#28225;浜?#37827;跺?#28051;?#27996;嗗垎鏋?#32459;嬪?#24533;殑BUG,(涓昏閽堝闀挎椂?#26879;杩愯绋嬪?#24533;殑?#22414;鏋?,鍦?#32459;嬪簭鍑?#38335;欐椂鎵?#37719;?#37713;?#37713;芥暟?#27537;璋?#37922;?#37739;?#37837;?#37828;潪甯告湁鐢殑銆?/span><br /><br /><span style="font-size: medium;">鍦?#28598;存枃浠?execinfo.h"涓声鏄?#27996;嗕笁涓?#37713;芥暟鐢?#27996;?#38014;?#37721;?#35120;撳?#23943;?#36328;?#23340;殑鍑芥暟璋?#37922;?#37739;?#37837;?/span><br /><br /><span style="font-size: medium;">Function: int backtrace(void **buffer,int size)<br /><br /></span><span style="font-size: medium;">璇?#37713;芥暟鐢?#28051;?#38014;?#37721;?#35120;撳?#23943;?#36328;?#23340;殑璋?#37922;?#37739;?#37837;?鑾?#37721;栫殑淇伅灏嗕細琚?#28699;?#37824;?#37734;buffer涓?瀹?#37828;竴涓?#37816;?#38333;?#37714;?#29723;?#37510;?#37721;傛暟 size 鐢?#37833;?#37816;?#28729;buffer涓?#37721;互淇?#28699;?#28598;氬皯涓void* 鍏冪?#29358;?#37713;芥暟杩?#37733;炲?#37828;?#28729;?#38340;呰幏鍙栫殑鎸?#38333;?#28051;暟,鏈澶?#28051;嶈?#21616;繃size澶?#28751;?/span>锛?span style="font-size: medium;">鍦buffer涓殑鎸?#38333;?#28729;?#38340;?#37828;?#28000;庡爢鏍?#28051;?#38014;?#37721;栫殑杩?#37733;?#37734;板潃,姣忎竴涓?#37739;?#37837;堟鏋舵湁?#31476;涓?#26473;?#37733;?#37734;板潃锛?/span><span style="font-size: medium;">?#25950;?#21104;鏌?#27996;涚紪璇?#37731;殑?#32045;鍖栭?#26916;?#28725;硅幏鍙栨纭殑璋?#37922;?#37739;?#37837;堟湁骞?#37813;?鍙?#28598;?#37712;呰仈鍑芥?#29256;病?#28225;鍫?#37837;堟鏋?鍒?#38340;?#22935;?#37835;舵寚閽?#28052;熶細浣挎?#29363;硶姝?#32429;?#29785;?#37835;愬爢鏍堝唴瀹?#37510;?/span><br /><br /><span style="font-size: medium;">Function: char ** backtrace_symbols (void *const *buffer, int size)<br /><br />backtrace_symbols</span><span style="font-size: medium;">灏?#28000;巄acktrace鍑芥暟鑾?#37721;栫殑淇伅杞?#37718;?#28051;轰竴涓?#28699;楃涓叉暟缁? 鍙傛暟buffer?#31794;璇?#37828;?#28000;巄acktrace鍑芥暟鑾?#37721;栫殑?#26271;缁勬寚閽?size鏄?#29831;暟缁?#28051;殑鍏冪礌涓暟(backtrace?#27537;杩?#37733;炲?銆?/span><span style="font-size: medium;">鍑芥暟杩?#37733;炲?#37828;竴涓?#37816;囧?#25117;?#26947;涓叉暟缁勭殑鎸?#38333;?瀹冪殑澶?#28751;忓悓buffer鐩稿悓.姣?#28051;?#28699;楃涓?#37718;?#37722;?#27996;嗕竴涓?#37929;稿浜巄uffer涓?#28725;瑰簲鍏冪?#29365;殑鍙?#37813;?#37719;?#28103;伅.瀹?#37718;呮嫭鍑芥暟鍚?#38171;?#37713;芥暟?#27537;鍋忕鍦板潃,?#25328;瀹?#38340;呯殑杩?#37733;?#37734;板潃銆?/span><br /><span style="font-size: medium;">鐜?#37734;?鍙湁浣?#37922;ELF浜?#26473;?#37714;舵牸寮忕殑绋嬪?#24531;拰?#23268;琛?#37813;嶈兘鑾?#37721;?#37713;芥暟鍚嶇?#26495;拰鍋忕鍦板潃.鍦?#37711;?#28000;?#32495;荤粺,鍙湁16杩?#37714;剁殑杩?#37733;?#37734;板潃?#20824;琚?#38014;?#37721;?鍙?#28598;?浣?#37721;兘?#28214;瑕佷紶閫?#37929;稿簲?#27537;?#29219;蹇?#32513;?#38334;炬帴鍣??#20114;鑳芥敮鎸佸?#33445;暟鍚嶅?#29115;兘(姣?#28641;?鍦?#28003;?#37922;GNU ld?#27537;绯荤粺涓?浣犻渶瑕佷紶閫?/span><span style="font-size: medium;">(-rdynamic))銆?br />璇?#37713;芥暟?#27537;杩?#37733;炲?#37828;?#38315;?#26473;malloc鍑芥暟鐢?#29831;风殑绌洪棿,?#27932;姝?#29835;?#37922;?#26473;?#36423;?#26916;?#28003;?#37922;free鍑芥?#29256;潵閲?#37824;炬寚閽?/span><span style="font-size: medium;">.<br />?#25950;?#21104;:濡?#37835;?#28051;嶈兘涓哄?#26947;涓?#38014;?#37721;栬澶熺殑绌洪棿鍑芥暟?#27537;杩?#37733;炲?#28751;嗕細涓?/span><span style="font-size: medium;">NULL<br /><br />Function:void backtrace_symbols_fd (void *const *buffer, int size, int fd)<br /><br />backtrace_symbols_fd涓巄acktrace_symbols 鍑芥暟鍏锋湁鐩稿?#23680;殑鍔熻兘,涓嶅?#23680;殑鏄?#28729;?#28051;嶄細缁欒皟鐢?#38000;呰繑鍥?#28699;楃涓叉暟缁?鑰?#37828;?#28751;嗙粨鏋滃啓鍏枃浠舵弿杩扮涓篺d?#27537;?#26499;浠?#28051;?姣?#28051;?#37713;芥暟瀵瑰簲?#31476;琛?瀹?#28051;嶉渶瑕?#29835;?#37922;malloc鍑芥暟,?#27932;姝?#38315;?#37922;?#27996;庢湁鍙兘璋?#37922;?#29831;?#37713;芥暟浼氬璐殑?#20751;鍐?#37510;?/span></p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, "Lucida Grande", Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;"> </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, "Lucida Grande", Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;"><span style="font-size: medium;">涓嬮潰鏄竴涓?#28003;?#37922;backtrace鎹曡幏寮?#29999;?#39582;?#37813;?#37719;?#37713;芥暟璋?#37922;?#37739;?#37837;堢殑渚嬪瓙锛?/span></p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, "Lucida Grande", Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;"> </p><div style="margin: 5px 0px; max-width: 900px; font-size: 12px;"><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="澶?#37714;?#28000;?#37934;? style="color: #1d58d1; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="澶?#37714;?#28000;?#37934;? style="max-width: 900px; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 22px; word-wrap: break-word; white-space: pre-wrap; font-family: "Courier New" !important;">#include <signal.h><span style="line-height: 1.5 !important;"> #include </span><stdio.h><span style="line-height: 1.5 !important;"> #include </span><stdlib.h><span style="line-height: 1.5 !important;"> #include </span><execinfo.h><span style="line-height: 1.5 !important;"> #include </span><sys/types.h><span style="line-height: 1.5 !important;"> #include </span><sys/stat.h><span style="line-height: 1.5 !important;"> #include </span><fcntl.h><span style="line-height: 1.5 !important;"> #include </span><<span style="color: #0000ff; line-height: 1.5 !important;">string</span>.h><span style="line-height: 1.5 !important;"> #include </span><unistd.h> <span style="color: #0000ff; line-height: 1.5 !important;">#define</span> PRINT_DEBUG <span style="color: #0000ff; line-height: 1.5 !important;">static</span> <span style="color: #0000ff; line-height: 1.5 !important;">void</span> print_reason(<span style="color: #0000ff; line-height: 1.5 !important;">int</span><span style="line-height: 1.5 !important;"> sig) { </span><span style="color: #0000ff; line-height: 1.5 !important;">void</span> *array[<span style="color: #800080; line-height: 1.5 !important;">10</span><span style="line-height: 1.5 !important;">]; size_t size; size </span>= backtrace(array, <span style="color: #800080; line-height: 1.5 !important;">10</span><span style="line-height: 1.5 !important;">); #ifdef PRINT_DEBUG </span><span style="color: #0000ff; line-height: 1.5 !important;">char</span> **<span style="line-height: 1.5 !important;">strings; </span><span style="color: #0000ff; line-height: 1.5 !important;">int</span><span style="line-height: 1.5 !important;"> i; strings </span>=<span style="line-height: 1.5 !important;"> backtrace_symbols(array, size); printf(</span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">Obtained %d stack frames.\n</span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">, size); </span><span style="color: #0000ff; line-height: 1.5 !important;">for</span> (i = <span style="color: #800080; line-height: 1.5 !important;">0</span>; i < size; i++<span style="line-height: 1.5 !important;">) printf(</span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">%s\n</span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">, strings[i]); free(strings); </span><span style="color: #0000ff; line-height: 1.5 !important;">char</span> cmd[<span style="color: #800080; line-height: 1.5 !important;">64</span>] = <span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">addr2line -C -f -e </span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">; </span><span style="color: #0000ff; line-height: 1.5 !important;">char</span>* prog = cmd +<span style="line-height: 1.5 !important;"> strlen(cmd); readlink(</span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">/proc/self/exe</span><span style="color: #800000; line-height: 1.5 !important;">"</span>, prog, <span style="color: #0000ff; line-height: 1.5 !important;">sizeof</span>(cmd) - strlen(cmd) - <span style="color: #800080; line-height: 1.5 !important;">1</span>);<span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> 鑾?#37721;?#26473;?#32459;嬬殑瀹?#37825;?#29882;緞</span> <span style="line-height: 1.5 !important;"> FILE</span>* fp = popen(cmd, <span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">w</span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">); </span><span style="color: #0000ff; line-height: 1.5 !important;">if</span> (fp !=<span style="line-height: 1.5 !important;"> NULL) { </span><span style="color: #0000ff; line-height: 1.5 !important;">for</span> (i = <span style="color: #800080; line-height: 1.5 !important;">0</span>; i < size; ++<span style="line-height: 1.5 !important;">i) { fprintf(fp, </span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">%p\n</span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">, array[i]); } pclose(fp); } </span><span style="color: #0000ff; line-height: 1.5 !important;">#else</span> <span style="color: #0000ff; line-height: 1.5 !important;">int</span> fd = open(<span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">err.log</span><span style="color: #800000; line-height: 1.5 !important;">"</span>, O_CREAT |<span style="line-height: 1.5 !important;"> O_WRONLY); backtrace_symbols_fd(array, size, fd); close(fd); </span><span style="color: #0000ff; line-height: 1.5 !important;">#endif</span><span style="line-height: 1.5 !important;"> exit(</span><span style="color: #800080; line-height: 1.5 !important;">0</span><span style="line-height: 1.5 !important;">); } </span><span style="color: #0000ff; line-height: 1.5 !important;">void</span><span style="line-height: 1.5 !important;"> die() { </span><span style="color: #0000ff; line-height: 1.5 !important;">char</span> *<span style="line-height: 1.5 !important;">test1; </span><span style="color: #0000ff; line-height: 1.5 !important;">char</span> *<span style="line-height: 1.5 !important;">test2; </span><span style="color: #0000ff; line-height: 1.5 !important;">char</span> *<span style="line-height: 1.5 !important;">test3; </span><span style="color: #0000ff; line-height: 1.5 !important;">char</span> *test4 =<span style="line-height: 1.5 !important;"> NULL; strcpy(test4, </span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">ab</span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">); } </span><span style="color: #0000ff; line-height: 1.5 !important;">void</span><span style="line-height: 1.5 !important;"> test1() { die(); } </span><span style="color: #0000ff; line-height: 1.5 !important;">int</span> main(<span style="color: #0000ff; line-height: 1.5 !important;">int</span> argc, <span style="color: #0000ff; line-height: 1.5 !important;">char</span> **<span style="line-height: 1.5 !important;">argv) { </span><span style="color: #0000ff; line-height: 1.5 !important;">struct</span><span style="line-height: 1.5 !important;"> sigaction myAction; myAction.sa_handler </span>=<span style="line-height: 1.5 !important;"> print_reason; sigemptyset(</span>&<span style="line-height: 1.5 !important;">myAction.sa_mask); myAction.sa_flags </span>= SA_RESTART |<span style="line-height: 1.5 !important;"> SA_SIGINFO; sigaction(SIGSEGV, </span>&myAction, NULL); <span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> 鏃?#37825;堝唴瀛?#23534;?#37922;?/span> sigaction(SIGABRT, &myAction, NULL); <span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> 寮?#29999;?#32513;堟</span> <span style="line-height: 1.5 !important;"> test1(); }</span></pre><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="澶?#37714;?#28000;?#37934;? style="color: #1d58d1; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="澶?#37714;?#28000;?#37934;? style="max-width: 900px; border: none !important;" /></a></span></div></div><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, "Lucida Grande", Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;"> </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, "Lucida Grande", Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;"> </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, "Lucida Grande", Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">鎴?#37832;?#37832;烘祴璇?#37813;?#37719;?#37713;虹殑淇伅濡?#28051;?#38171;?/p><div style="margin: 5px 0px; max-width: 900px; font-size: 12px;"><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="澶?#37714;?#28000;?#37934;? style="color: #1d58d1; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="澶?#37714;?#28000;?#37934;? style="max-width: 900px; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 22px; word-wrap: break-word; white-space: pre-wrap; font-family: "Courier New" !important;">Obtained <span style="color: #800080; line-height: 1.5 !important;">7</span><span style="line-height: 1.5 !important;"> stack frames. </span>/root/workspace/test/Debug/test(__gxx_personality_v0+<span style="color: #800080; line-height: 1.5 !important;">0x12d</span>) [<span style="color: #800080; line-height: 1.5 !important;">0x80486c1</span><span style="line-height: 1.5 !important;">] [</span><span style="color: #800080; line-height: 1.5 !important;">0x71b440</span><span style="line-height: 1.5 !important;">] </span>/root/workspace/test/Debug/test(__gxx_personality_v0+<span style="color: #800080; line-height: 1.5 !important;">0x2ac</span>) [<span style="color: #800080; line-height: 1.5 !important;">0x8048840</span><span style="line-height: 1.5 !important;">] </span>/root/workspace/test/Debug/test(__gxx_personality_v0+<span style="color: #800080; line-height: 1.5 !important;">0x2c0</span>) [<span style="color: #800080; line-height: 1.5 !important;">0x8048854</span><span style="line-height: 1.5 !important;">] </span>/root/workspace/test/Debug/test(__gxx_personality_v0+<span style="color: #800080; line-height: 1.5 !important;">0x339</span>) [<span style="color: #800080; line-height: 1.5 !important;">0x80488cd</span><span style="line-height: 1.5 !important;">] </span>/lib/libc.so.<span style="color: #800080; line-height: 1.5 !important;">6</span>(__libc_start_main+<span style="color: #800080; line-height: 1.5 !important;">0xdc</span>) [<span style="color: #800080; line-height: 1.5 !important;">0xbf3e9c</span><span style="line-height: 1.5 !important;">] </span>/root/workspace/test/Debug/test(__gxx_personality_v0+<span style="color: #800080; line-height: 1.5 !important;">0x5d</span>) [<span style="color: #800080; line-height: 1.5 !important;">0x80485f1</span><span style="line-height: 1.5 !important;">] print_reason </span>/root/workspace/test/Debug/../main.cpp:<span style="color: #800080; line-height: 1.5 !important;">15</span> ?? ??:<span style="color: #800080; line-height: 1.5 !important;">0</span><span style="line-height: 1.5 !important;"> die() </span>/root/workspace/test/Debug/../main.cpp:<span style="color: #800080; line-height: 1.5 !important;">51</span><span style="line-height: 1.5 !important;"> test1() </span>/root/workspace/test/Debug/../main.cpp:<span style="color: #800080; line-height: 1.5 !important;">56</span><span style="line-height: 1.5 !important;"> main </span>/root/workspace/test/Debug/../main.cpp:<span style="color: #800080; line-height: 1.5 !important;">65</span> ?? ??:<span style="color: #800080; line-height: 1.5 !important;">0</span><span style="line-height: 1.5 !important;"> _start </span>??:<span style="color: #800080; line-height: 1.5 !important;">0</span></pre></div><img src ="http://www.9087120.com/markqian86/aggbug/215755.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.9087120.com/markqian86/" target="_blank">闀挎垷鍗佷笁鍗?/a> 2018-06-29 17:03 <a href="http://www.9087120.com/markqian86/archive/2018/06/29/215755.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣璇?#29825;?/a></div>]]></description></item><item><title>linux screen 鍛?#28000;?#29831;?#29785;?/title><link>http://www.9087120.com/markqian86/archive/2018/06/28/215751.html</link><dc:creator>闀挎垷鍗佷笁鍗?/dc:creator><author>闀挎垷鍗佷笁鍗?/author><pubDate>Thu, 28 Jun 2018 12:12:00 GMT</pubDate><guid>http://www.9087120.com/markqian86/archive/2018/06/28/215751.html</guid><wfw:comment>http://www.9087120.com/markqian86/comments/215751.html</wfw:comment><comments>http://www.9087120.com/markqian86/archive/2018/06/28/215751.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.9087120.com/markqian86/comments/commentRss/215751.html</wfw:commentRss><trackback:ping>http://www.9087120.com/markqian86/services/trackbacks/215751.html</trackback:ping><description><![CDATA[<p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8; font-size: 16px;"><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 1.8; color: #800000;">?#31476;銆?#38003;屾</span></strong></span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">绯荤粺绠?#37918;嗗缁忓父?#28214;瑕丼SH 鎴栬卼elent 杩?#32459;嬬?#35826;綍鍒癓inux 鏈嶅姟鍣?#38171;?#32513;忓父杩愯?#23676;竴浜涢渶瑕佸緢闀挎椂?#26879;鎵嶈兘瀹屾?#24878;殑浠诲姟锛?#23011;?#28641;?#32495;荤粺澶?#28000;?#37510;乫tp 浼?#26440;?#32475;?#32475;?#37510;?#38315;氬?#21578;儏鍐?#28051;?#37812;?#28000;兘鏄?#28051;?#23011;忎竴涓?#26473;?#37837;风殑浠诲姟寮?#31476;涓?#26473;?#32459;嬬粓绔獥鍙?#38171;屽洜涓?#28729;?#28000;?#37813;?#29723;岀殑?#26882;?#26879;澶?#38336;?#27996;?#37510;傚繀椤荤?#22794;緟瀹?#28000;?#37813;?#29723;?#28729;?#23011;?#38171;?#37734;?#23005;?#37832;熼棿涓嶈兘鍏虫?#22796;獥鍙?#37812;栬呮柇寮杩炴帴锛屽惁鍒?#26473;?#28051;?#28000;诲姟?#27688;?#32048;琚?#37833;鎺?#38171;屼竴鍒?#37719;婇旇屽簾浜?#37510;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8; font-size: 16px;"><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 1.8; color: #800000;">浜?#37510;佺畝浠?/span></strong></span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">GNU Screen</strong><span style="margin: 0px; padding: 0px; line-height: 1.8;">鏄竴娆?#37922;?/span>GNU璁?#37714;?span style="margin: 0px; padding: 0px; line-height: 1.8;">寮鍙戠殑鐢?#27996;?/span>鍛?#28000;?#29723;?#32513;?#32468;?span style="margin: 0px; padding: 0px; line-height: 1.8;">鍒囨崲?#27537;</span>?#22172;鐢辫蒋浠?span style="margin: 0px; padding: 0px; line-height: 1.8;">銆?#37922;埛鍙互閫?#26473;?#29831;蒋浠跺悓鏃惰?#28852;帴澶?#28051;?#37832;?#37734;版垨杩?#32459;嬬殑鍛?#28000;?#29723;?/span>?#32048;璇?span style="margin: 0px; padding: 0px; line-height: 1.8;">锛?#39582;?#37734;?#37711;堕棿?#22172;鐢?#37714;囨崲銆?/span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">GNU Screen鍙互鐪嬩綔鏄獥鍙?#32480;?#37918;嗗櫒?#27537;鍛?#28000;?#29723;岀?#23684;潰鐗?#37832;?#37510;?#28729;?#37819;愪緵浜嗙粺?#31476;?#27537;绠?#37918;嗗涓細璇濈殑鐣岄潰?#25328;鐩稿簲?#27537;鍔熻兘銆?/p><ul style="margin: 0px 0px 0px 30px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><li style="margin: 0px; padding: 0px; list-style: disc;"><strong style="margin: 0px; padding: 0px;">?#32048;璇?#37805;?#28598;?/strong></li></ul><dl style="margin: 0px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><dd style="margin: 0px; padding: 0px;">鍙?#29781;丼creen鏈韩娌湁缁堟锛?#37734;?#37711;跺唴閮?#26473;愯?#23680;殑?#32048;璇濋兘鍙互鎭?#28598;?#37510;?#26473;欎竴鐐?#28725;?#27996;?#26473;?#32459;嬬?#35826;?#26336;殑鐢埛鐗?#37714;湁鐢?#8212;—鍗?#28003;跨?#25120;粶杩炴帴涓?#37826;?#38171;?#37922;埛涔?#28051;嶄?#27692;鍘诲宸?#32513;?#37813;?#23534;?#27537;鍛?#28000;?#29723;屼細璇濈殑鎺?#37714;?#37510;?#37721;?#29781;佸?#23942;鐧诲綍鍒?#28051;?#37832;?#28051;?#37813;?#29723;?strong style="margin: 0px; padding: 0px;">screen -r</strong>?#27688;鍙互鎭?#28598;嶄細璇濈殑杩愯銆傚?#23678;牱鍦?#37830;傛椂绂诲紑?#27537;鏃跺?#38171;?#28052;?#37721;互鎵?#29723;屽垎绂诲懡浠?strong style="margin: 0px; padding: 0px;">detach</strong>锛?#37734;?#28103;?#29831;?#38322;岄潰?#27537;绋嬪簭姝?#29999;?#26473;愯?#23680;殑?#20751;鍐?#28051;?#29825;Screen鎸?#29863;?#38171;?#37714;囨崲鍒?#37722;?#37721;?#38171;?#37510;?#26473;欎竴鐐瑰拰鍥?#35120;?#37923;岄潰涓嬬殑VNC寰?#37929;?#28028;?#37510;?/dd></dl><ul style="margin: 0px 0px 0px 30px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><li style="margin: 0px; padding: 0px; list-style: disc;"><strong style="margin: 0px; padding: 0px;">澶氱獥鍙?/strong></li></ul><dl style="margin: 0px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><dd style="margin: 0px; padding: 0px;">鍦Screen?#24134;澧?#28051;?#38171;屾墍?#28225;?#27537;?#32048;璇濋兘鐙?#32468;嬬殑杩愯锛?#39582;舵嫢?#28225;鍚勮嚜?#27537;?#32042;鍙?#37510;?#26440;?#37711;?#37510;?#26440;?#37713;哄拰?#29541;鍙?#32514;撳瓨銆?#37922;埛鍙互閫?#26473;囧揩鎹?#38335;?#37734;?#28051;嶅?#23680;殑?#29541;鍙?#28051;?#37714;囨崲锛?#39582;?#37721;互?#22172;鐢辩殑閲?#28729;氬?#25117;悇涓獥鍙殑杈?#37711;拰杈?#37713;?#37510;係creen瀹?#37916;?#27996;嗗熀鏈殑?#26499;鏈?#37823;?#28003;?#38171;屽澶?#37714;剁?#27199;创绛?#38171;?#26473;樻?#24874;緵浜?#32491;?#28028;兼?#27692;姩鏉殑鍔熻兘锛?#37721;互鏌?#37930;嬬獥鍙?#37912;跺喌?#27537;鍘?#37721;?#29825;板綍銆傜獥鍙?#26473;?#37721;互琚垎鍖哄拰鍛?#37722;?#38171;?#26473;?#37721;互鐩戣?#21975;悗鍙扮獥鍙殑娲诲姩銆?/dd></dl><ul style="margin: 0px 0px 0px 30px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><li style="margin: 0px; padding: 0px; list-style: disc;"><strong style="margin: 0px; padding: 0px;">?#32048;璇?#37711;?#27996;?/strong></li></ul><dl style="margin: 0px; padding: 0px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><dd style="margin: 0px; padding: 0px;">Screen鍙互璁竴涓?#37812;?#28598;?#28051;?#37922;埛浠?#28051;嶅悓缁?#32468;?#28598;?#23046;?#37927;诲?#26330;竴涓細璇?#38171;?#39582;?#37711;?#27996;細璇濈殑鎵?#28225;鐗?#37804;?#38171;?#23011;?#28641;?#37721;互?#28229;鍒?#28729;?#37711;?#37929;稿?#23680;殑杈?#37713;?#38171;?#37510;?#28729;?#37722;屾椂鎻愪緵浜嗙獥鍙?#29825;?#38338;?#37833;?#38340;愮殑鏈?#37714;?#38171;?#37721;互瀵圭獥鍙?#26473;?#29723;屽?#21977;?#20343;繚鎶?#37510;?/dd></dl><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">GNU's Screen 瀹樻柟绔欑偣锛?a href="http://www.gnu.org/software/screen/" target="_blank" style="margin: 0px; padding: 0px; text-decoration-line: none; border-bottom: 1px dotted #333333; color: #000000;">http://www.gnu.org/software/screen/</a></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8; font-size: 16px;"><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 1.8; color: #800000;">?#31489;銆?#29831;硶</span></strong></span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;"># screen [-AmRvx -ls -wipe][-d <浣?#28051;氬?#23943;>][-h <琛屾暟>][-r <浣?#28051;氬?#23943;>][-s ][-S <浣?#28051;氬?#23943;>]</span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">鍙傛暟璇?#37828;?/strong></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">-A 銆灏?#37813;?#28225;?#27537;瑙嗙獥?#20824;璋?#37825;?#28051;虹洰鍓嶇粓绔?#37832;虹殑澶?#28751;?#37510;?/span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">-d <浣?#28051;氬?#23943;> 銆灏?#37816;?#28729;氱殑screen浣?#28051;氱?#33636;嚎銆?/span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">-h <琛屾暟> 銆鎸?#28729;?#29785;嗙?#26947;殑缂撳鍖?#29723;屾暟銆?/span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">-m 銆鍗?#28003;跨洰鍓嶅凡鍦?#28003;?#28051;?#28051;殑screen浣?#28051;?#38171;?#28000;?#23534;?#37714;跺缓绔?#37826;扮殑screen浣?#28051;?#37510;?/span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">-r <浣?#28051;氬?#23943;> 銆鎭?#28598;嶇?#33636;?#36328;殑screen浣?#28051;?#37510;?/span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">-R 銆鍏?#29831;?#37733;炬仮澶嶇?#33636;?#36328;殑浣?#28051;?#37510;傝嫢鎵?#28051;?#37714;扮?#33636;?#36328;殑浣?#28051;?#38171;?#37719;冲缓绔?#37826;扮殑screen浣?#28051;?#37510;?/span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">-s 銆鎸?#28729;氬缓绔?#37826;?#29785;嗙?#26945;椂锛屾墍瑕佹墽琛岀殑shell銆?/span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">-S <浣?#28051;氬?#23943;> 銆鎸?#28729;歴creen浣?#28051;氱殑鍚嶇銆?/span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">-v 銆鏄剧鐗?#37832;?#28103;伅銆?/span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">-x 銆鎭?#28598;?#28052;嬪?#23943;?#33636;?#36328;殑screen浣?#28051;?#37510;?/span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">-ls鎴?-list 銆鏄剧?#34425;洰鍓嶆墍?#28225;?#27537;screen浣?#28051;?#37510;?/span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">-wipe 銆妫鏌洰鍓嶆墍?#28225;?#27537;screen浣?#28051;?#38171;?#39582;?#37714;?#38340;?#23480;?#32513;?#37827;犳硶浣?#37922;殑screen浣?#28051;?#37510;?/span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8; color: #800000; font-size: 16px;"><strong style="margin: 0px; padding: 0px;">鍥?#37510;佸父鐢screen鍙傛暟</strong></span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">screen -S yourname -> 鏂板缓?#31476;涓?#37721;yourname?#27537;session</span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">screen -ls -> 鍒?#37713;哄?#25779;?#23942;墍?#28225;?#27537;session</span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">screen -r yourname -> 鍥?#37714;皔ourname杩?#28051;猻ession</span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">screen -d yourname -> 杩?#32459;媎etach鏌?#28051;猻ession</span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">screen -d -r yourname -> ?#31912;鏉熷?#25779;墠session骞跺洖鍒皔ourname杩?#28051;猻ession</span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">鍦?#23011;?#28051;猻creen session 涓?#38171;屾墍?#28225;鍛?#28000;兘?#20114; ctrl+a(C-a) 寮濮?#37510;?/strong><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a ? -> <span style="margin: 0px; padding: 0px; line-height: 1.8;">鏄剧鎵?#28225;閿?#32513;?#28729;?#28103;伅</span></span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a c -> <span style="margin: 0px; padding: 0px; line-height: 1.8;">鍒涘缓?#31476;涓?#37826;扮殑杩愯?#23483;hell?#27537;?#29541;鍙?#39582;?#37714;囨崲鍒?#29831;獥鍙?/span></span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a n -> Next锛?#37714;囨崲鍒?#28051;嬩竴涓?window </span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a p -> Previous锛?#37714;囨崲鍒板墠?#31476;涓?window </span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a 0..9 -> 鍒囨崲鍒扮 0..9 涓?window</span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">Ctrl+a [Space] -> 鐢?#29785;嗙獥0寰簭鍒囨崲鍒?#29785;嗙獥9</span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a C-a -> 鍦?#28051;?#28051;?#37832;杩?#28003;?#37922;殑 window ?#26879;鍒囨崲 </span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a x -> 閿佷?#24531;?#25779;?#23943;殑 window锛岄渶鐢?#37922;埛瀵嗙爜瑙?#38335;?/span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a d -> detach锛屾?#20635;椂绂诲紑褰撳墠session锛屽?#21977;洰鍓嶇殑 screen session (鍙兘鍚湁澶?#28051;?windows) 涓?#37714;?#37722;?#37721;版墽琛?#38171;?#39582;朵?#27692;洖鍒?#26473;?#23052;?#26473;?screen ?#26882;?#27537;鐘?#37804;?#38171;屾?#26882;鍦?screen session 閲?#38171;?#23011;?#28051;?window 鍐呰?#24879;?#23680;殑 process (鏃?#29825;?#37828;墠鍙?鍚?#37721;??#20824;鍦?#32513;?#32513;?#37813;?#29723;?#38171;?#37719;?#28003;?logout 涔?#28051;嶅?#21342;搷銆?nbsp;</span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a z -> 鎶婂?#25779;墠session鏀?#37714;?#37722;?#37721;版墽琛?#38171;?#37922;?shell ?#27537; fg 鍛?#28000;?#37714;?#37721;?#37733;?#37720;汇?/span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a w -> <span style="margin: 0px; padding: 0px; line-height: 1.8;">鏄剧鎵?#28225;?#29541;鍙?#37714;?#29723;?/span></span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a t -> Time锛?#37828;剧?#21700;?#25779;?#23942;椂?#26879;锛屽拰绯荤粺?#27537; load </span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a k -> kill window锛?#23534;?#29723;?#37711;?#38338;?#35120;撳?#23943;殑 window</span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a [ -> 杩?#37711;?copy mode锛?#37734;?copy mode 涓?#37721;互鍥炴銆佹?#28357;储銆佸鍒跺氨?#20762;鐢?#28003;?#37922;?vi ?#31476;鏍?/span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">    C-b Backward锛孭ageUp </span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">    C-f Forward锛孭ageDown </span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">    H(澶?#37712;? High锛屽皢鍏夋爣绉?#38007;?#23480;?#28051;?#29785;?nbsp;</span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">    L Low锛屽皢鍏夋爣绉?#38007;?#23480;?#28051;嬭 </span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">    0 绉?#37714;?#29723;岄 </span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">    $ 琛?#37832;?nbsp;</span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">    w forward one word锛屼互瀛?#28051;?#37719;?#28003;嶅鍓嶇 </span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">    b backward one word锛屼互瀛?#28051;?#37719;?#28003;嶅鍚庣 </span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">    Space 绗竴娆?#37816;?#28051;烘爣璁?#37718;?#29863;?#37904;?#38171;岀浜屾鎸?#28051;?#32513;堢偣 </span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">    Esc ?#31912;鏉?copy mode </span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a ] -> Paste锛屾妸鍒氬?#27692;湪 copy mode 閫夊畾?#27537;?#21812;瀹硅创涓?/span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8; font-size: 16px;"><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 1.8; color: #800000;">浜?#37510;佷娇鐢?screen</span></strong></span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">5.1 瀹夎screen</strong></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">娴?#29723;岀殑Linux鍙戣鐗?#38171;?#28186;嬪Red Hat Enterprise Linux锛夐氬父?#32048;?#22172;甯screen瀹?#37922;?#32459;嬪簭锛屽鏋?#23052;湁?#27537;璇?#38171;?#37721;互浠嶨NU screen?#27537;瀹樻柟缃戠涓嬭浇銆?/span></p><div style="margin: 5px 0px; font-size: 12px !important;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; word-wrap: break-word; white-space: pre-wrap; font-family: "Courier New" !important;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">[root@TS-DEV ~]# yum install screen [root@TS-DEV ~]# rpm -qa|grep screen screen-4.0.3-4.el5 [root@TS-DEV ~]#</span></pre></div><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">5.2 鍒涘缓?#31476;涓?#37826;扮殑?#29541;鍙?/strong></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">瀹夎瀹屾垚鍚?#38171;?#37929;存帴鏁?#37723;?#28000;screen?#27688;鍙互鍚姩瀹?#37510;?span style="margin: 0px; padding: 0px; line-height: 1.8;">浣?#37828;?#26473;?#37837;?#37722;姩?#27537;screen?#32048;璇?#23052;湁鍚嶅瓧锛?#28729;?#29882;?#28051;?#37818;崘涓?#23011;?#28051;猻creen?#32048;璇?#37721;栦竴涓?#37722;嶅瓧锛屾柟渚垮垎杈?#38171;?/span></span></p><div style="margin: 5px 0px; font-size: 12px !important;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; word-wrap: break-word; white-space: pre-wrap; font-family: "Courier New" !important;">[root@TS-DEV ~]# screen -S david </pre></div><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">screen鍚姩鍚?#38171;屼?#27692;?#28056;缓绗竴涓獥鍙?#38171;?#28052;熷氨鏄獥鍙No. 0锛?#39582;?#37734;?#37711;?#28051;?#37813;?#23534;?#31476;涓?#32495;荤粺榛樿?#27537;shell锛屼竴鑸兘?#32048;鏄痓ash銆?#37813;?#20114;浣?#37825;?#37711;?#37723;?#28000;screen涔嬪悗锛屼細绔?#37714;?#37721;?#26473;?#37733;?#37714;板懡浠?#37819;愮?#34425;锛?#28000;?#28003;?#28000;涔?#28052;?#23052;湁鍙?#37922;?#28028;肩殑锛?#37711;?#28729;?#28003;犲凡缁?#26473;?#37711;Screen?#27537;涓栫浜?#37510;傚綋?#21159;锛?#28052;?#37721;互鍦screen鍛?#28000;?#28052;嬪悗鍔?#37711;?#28003;犲?#28356;?#27537;鍙傛暟锛?#28003;?#28052;嬬?#23384;帴鎵?#23534;浣?#37816;?#28729;氱殑绋嬪簭锛屼?#23338;锛?/span></p><div style="margin: 5px 0px; font-size: 12px !important;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; word-wrap: break-word; white-space: pre-wrap; font-family: "Courier New" !important;">[root@TS-DEV ~]# screen vi david.txt</pre></div><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">screen鍒涘缓?#31476;涓?#37813;?#29723;寁i david.txt?#27537;鍗曠獥鍙細璇?#38171;岄鍑簐i 灏嗛鍑?#29831;獥鍙??#32048;璇?#37510;?/span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">5.3 鏌?#37930;嬬獥鍙拰?#29541;鍙?#37722;嶇</strong></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">鎵?#23534;澶?#28051;獥鍙?#37722;?#38171;?#37721;互浣?#37922;?#36423;?#37817;?#38335;瓹-a w鍒?#37713;哄?#25779;?#23942;墍?#28225;?#29541;鍙?#37510;傚鏋?#28003;?#37922;枃鏈?#32513;?#32468;?#38171;?#26473;?#28051;?#37714;?#29723;?#28028;氬垪鍦?#28766;?#39582;?#23480;?#28051;嬭锛屽鏋?#28003;?#37922;X?#24134;澧?#28051;嬬殑缁?#32468;?#22959;?#37815;?#37731;?#38171;?#26473;?#28051;?#37714;?#29723;?#28028;氬垪鍦爣棰樻爮閲?#37510;傜獥鍙?#37714;?#29723;殑鏍?#28699;愪竴鑸?#37828;?#26473;?#37837;?#38171;?/p><div style="margin: 5px 0px; font-size: 12px !important;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; word-wrap: break-word; white-space: pre-wrap; font-family: "Courier New" !important;">0$ bash 1-$ bash 2*$ bash </pre></div><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">杩?#28051;?#28186;嬪瓙涓?#37812;?#23534;鍚?#27996;嗕笁涓獥鍙?#38171;?#37711;?#28051;?鍙?#29723;?#32448;哄?#25779;墠浣?#27996;庣獥鍙?锛?鍙?#29723;?#32448;?#28051;婁竴娆?#37714;囨崲?#29541;鍙椂浣?#27996;庣獥鍙?銆?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">Screen榛樿?#32048;涓虹獥鍙?#37723;?#37722;?#28051;虹紪鍙峰拰?#29541;鍙?#28051;?#26473;愯绋嬪?#24531;?#23943;殑缁勫悎锛?#28051;婇潰?#27537;渚嬪瓙涓獥鍙兘鏄?#27035;樿鍚嶅瓧銆傜粌涔?#27996;?#28051;婇潰鏌?#37930;嬬獥鍙殑?#26591;?#30838;锛?#28003;?#37721;兘?#27688;甯?#37832;?#37722;?#28051;獥鍙?#37721;互?#28225;涓嶅?#23680;殑鍚嶅瓧?#20114;?#26591;渚?#37718;哄垎浜?#37510;?#37721;互浣?#37922;?#36423;?#37817;?#38335;瓹-a A鏉?#28051;哄?#25779;?#23943;獥鍙?#38322;嶅懡鍚?#38171;屾寜涓嬪揩鎹?#38335;?#37722;?#38171;孲creen浼氬厑璁?#28003;?#28051;哄?#25779;?#23943;獥鍙?#26440;?#37711;?#37826;扮殑鍚嶅瓧锛屽洖杞?#32429;?#29825;?#37510;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">5.4 ?#32048;璇濆垎绂?#28051;庢仮澶?/strong></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">浣?#37721;互涓?#28051;?#37826;screen?#29541;鍙?#28051;?#32459;嬪?#24533;殑杩愯?#23683;屾?#20635;椂鏂?#23534;锛坉etach锛塻creen?#32048;璇?#38171;?#39582;?#37734;?#38341;忓?#24226;椂?#26879;閲嶆柊杩炴帴锛坅ttach锛?#29831;細璇?#38171;岄?#23942;?#29256;帶鍒跺?#21229;獥鍙?#28051;?#26473;愯?#23680;殑绋嬪簭銆?#28186;嬪锛屾垜浠?#37813;?#23534;?#31476;涓猻creen?#29541;鍙紪杈?tmp/david.txt?#26499;浠?#38171;?/span></p><div style="margin: 5px 0px; font-size: 12px !important;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; word-wrap: break-word; white-space: pre-wrap; font-family: "Courier New" !important;">[root@TS-DEV ~]# screen vi /tmp/david.txt</pre></div><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">涔嬪悗鎴?#28000;?#37807;虫?#20635;椂閫鍑哄?#27697;偣鍒殑浜嬫儏锛?#23011;?#28641;?#37713;?#37720;?#37825;?#37825;?#23005;?#38171;岄偅涔?#37734;screen?#29541;鍙?#38335;?#37711;?/span><code style="margin: 0px; padding: 0px;">C-a d</code><span style="margin: 0px; padding: 0px; line-height: 1.8;">锛孲creen?#32048;缁?#37713;篸etached鎻愮锛?/span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;"><strong style="margin: 0px; padding: 0px;">鏆傛椂涓?#37826;細璇?/strong></span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;"><img src="https://images0.cnblogs.com/blog/370046/201301/29144351-ff7e78c079a44f51ae44d48b6942b87f.jpg" alt="" width="900" style="margin: 0px; padding: 0px; border: 0px; max-width: 900px;" /></span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">鍗?#28051;?#28751;忔椂涔嬪悗鍥炴潵浜?#38171;屾壘鍒?#29831;screen?#32048;璇?#38171;?/span></p><div style="margin: 5px 0px; font-size: 12px !important;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; word-wrap: break-word; white-space: pre-wrap; font-family: "Courier New" !important;">[root@TS-DEV ~]# screen -ls</pre></div><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><img src="https://images0.cnblogs.com/blog/370046/201301/29144759-7cea9fc3f5f4481ab21df8bd017c88ef.jpg" alt="" style="margin: 0px; padding: 0px; border: 0px; max-width: 900px;" /></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">閲嶆柊杩炴帴?#32048;璇?#38171;?/span></p><div style="margin: 5px 0px; font-size: 12px !important;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; word-wrap: break-word; white-space: pre-wrap; font-family: "Courier New" !important;">[root@TS-DEV ~]# screen -r 12865</pre></div><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">?#31476;鍒囬兘鍦?#37510;?/span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">褰撶劧锛屽鏋?#28003;?#37734;?#37721;竴鍙版満鍣?#28051;?#23052;湁?#22414;绂讳竴涓猄creen?#32048;璇?#38171;屽氨鏃?#28000;庢仮澶嶄細璇?#27996;?#37510;?/span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">杩欐椂鍙互浣?#37922;?#28051;嬮潰鍛?#28000;?#23534;?#37714;跺皢杩?#28051;細璇?#28000;?#28729;?#37813;鍦殑缁?#32468;垎绂?#38171;岃浆绉?#37714;版?#25198;殑缁?#32468;?#28051;?#37833;?#38171;?/span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;"><img src="https://images0.cnblogs.com/blog/370046/201301/29215655-6d2f0c7e7f294756a4b40a40e1e76a84.jpg" alt="" style="margin: 0px; padding: 0px; border: 0px; max-width: 900px;" /></span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">5.5 娓?#38340;dead ?#32048;璇?/strong></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">濡?#37835;?#37922;?#27996;庢煇绉?#37720;熷洜鍏?#28051;竴涓細璇?#23005;?#37818;?#27996;?#38171;?#28186;嬪浜?#28051;?#37833;鎺?#29831;細璇?#38171;?#38171;?#26473;欐椂screen -list?#32048;鏄剧璇細璇?#28051;篸ead鐘?#37804;?#37510;?#28003;?#37922;screen -wipe鍛?#28000;?#23059;?#38340;?#29831;細璇?#38171;?/span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><img src="https://images0.cnblogs.com/blog/370046/201301/29154746-51185199905542c68d3c3b46dddef648.jpg" alt="" style="margin: 0px; padding: 0px; border: 0px; max-width: 900px;" /></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">5.6 鍏?#38338;?#37812;?#37833;姝荤獥鍙?/strong></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">姝?#29999;告儏鍐?#28051;?#38171;屽綋浣?#38315;鍑轰竴涓獥鍙?#28051;?#37832;鍚庝竴涓?#32459;嬪簭锛?#38315;氬父鏄痓ash锛夊悗锛?#26473;?#28051;獥鍙氨鍏?#38338;?#27996;?#37510;?#37721;竴涓?#37711;?#38338;獥鍙殑?#26591;?#30838;鏄?#28003;?#37922;C-a k锛?#26473;?#28051;?#36423;?#37817;?#38335;?#37833;姝诲?#25779;?#23943;殑?#29541;鍙?#38171;屽?#23678;椂涔熷皢鏉姝?#26473;?#28051;獥鍙?#28051;?#23005;?#37734;?#26473;愯?#23680;殑杩?#32459;?#37510;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">濡?#37835;滀竴涓猄creen?#32048;璇?#28051;?#37832;鍚庝竴涓獥鍙?#29722;?#37711;?#38338;?#27996;?#38171;岄偅涔?#37825;?#28051;猄creen?#32048;璇?#28052;熷氨閫鍑?#27996;?#38171;宻creen杩?#32459;嬩細琚?#32513;堟銆?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">闄?#27996;嗕娆?#38315;鍑?鏉姝诲?#25779;墠Screen?#32048;璇?#28051;?#37813;?#28225;?#29541;鍙?#26473;?#32457;嶆柟?#30838;涔嬪锛?#26473;?#37721;互浣?#37922;?#36423;?#37817;?#38335;瓹-a :锛?#37906;跺悗杈?#37711;quit鍛?#28000;?#38315;鍑篠creen?#32048;璇?#37510;傞渶瑕佹敞鎰忕殑鏄?#38171;?#26473;?#37837;?#38315;鍑轰細鏉姝?#37813;?#28225;?#29541;鍙?#39582;堕鍑?#37711;?#28051;?#26473;愯?#23680;殑鎵?#28225;绋嬪簭銆?#37711;?#28729;濩-a :杩?#28051;?#36423;?#37817;?#38335;?#37711;?#29825;?#37922;埛鐩存帴杈?#37711;殑鍛?#28000;湁寰?#28598;?#38171;屽?#21614;嫭?#22414;灞?#37721;互杈?#37711;split绛?#38171;?#26473;?#28052;?#37828;?#28729;?#37916;癝creen鍔熻兘?#27537;?#31476;涓?#38315;斿緞锛?#28051;?#26473;?#28051;?#27996;?#29825;?#28051;?#26473;?#37828;?#36423;?#37817;?#38335;?#23011;旇緝?#26591;渚?#27996;?#37510;?/span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8; font-size: 16px;"><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 1.8; color: #800000;">鍏?#37510;乻creen 楂樼骇?#31794;鐢?nbsp;</span></strong></span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">6.1 ?#32048;璇?#37711;?#27996;?/strong></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">杩樻湁?#31476;绉?#23011;旇緝濂?#37916;殑?#32048;璇?#37805;?#28598;?#38171;?#37721;互瀹?#37916;颁細璇?#37711;?#27996;?#37510;傚亣璁?#28003;?#37734;拰鏈?#37721;?#37734;?#28051;嶅悓鍦扮?#36891;互鐩稿悓鐢埛鐧诲?#26330;竴鍙版満鍣?#38171;?#37906;跺悗浣?#37714;涘缓?#31476;涓猻creen?#32048;璇?#38171;?#28003;?#37832;?#37721;?#37721;互鍦?#28000;栫殑缁?#32468;?#28051;婂懡浠?#38171;?/span></p><div style="margin: 5px 0px; font-size: 12px !important;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; word-wrap: break-word; white-space: pre-wrap; font-family: "Courier New" !important;">[root@TS-DEV ~]# screen -x</pre></div><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">杩?#28051;?#37723;?#28000;?#28028;氬皢浣?#37832;?#37721;嬬殑缁?#32468;Attach鍒?#28003;犵殑Screen?#32048;璇?#28051;?#38171;?#39582;?#28051;?#28003;犵殑缁?#32468;?#28051;嶄細琚獶etach銆?#26473;?#37837;?#28003;犲氨鍙互?#25328;鏈?#37721;?#37711;?#27996;?#37722;屼竴涓細璇?#27996;?#38171;屽鏋?#28003;?#28000;?#35120;撳墠鍙?#28598;?#27996;?#37722;屼竴涓獥鍙?#38171;岄偅?#27688;鐩稿綋浜庡潗鍦?#37722;屼竴涓?#37828;剧鍣墠?#28528;锛?#28003;犵殑鎿?#28003;滀?#27692;?#23678;婕?#32448;?#32513;?#28003;?#37832;?#37721;?#38171;?#28003;?#37832;?#37721;嬬殑鎿?#28003;?#28052;?#28028;氬?#23678;婕?#32448;?#32513;?#28003;犮傚綋?#21159;锛屽鏋?#28003;?#28000;?#37714;囨崲鍒?#26473;?#28051;細璇濈殑涓嶅?#23680;獥鍙?#28051;?#37720;?#38171;岄偅杩?#37828;?#37721;互?#22414;鍒?#26473;?#29723;?#28051;嶅?#23680;殑鎿?#28003;滅殑銆?/span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">6.2 ?#32048;璇?#38335;佸畾涓?#29785;?#38335;?/strong></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">Screen鍏?#29825;?#28003;?#37922;?#36423;?#37817;?#38335;瓹-a s閿佸畾?#32048;璇?#37510;傞?#20344;畾?#20114;鍚?#38171;屽啀杩?#29723;?#28000;?#28003;?#26440;?#37711;?#28766;?#39582;曢兘涓嶄?#27692;?#23942;湁鍙嶅簲浜?#37510;?#28003;?#37828;?#29781;佹敞?#21104;铏界劧灞?#39582;?#28051;婄?#23337;笉鍒?#37721;嶅簲锛?#28003;?#28003;犵殑杈?#37711;兘?#32048;琚玈creen涓殑杩?#32459;嬫帴鏀?#37714;?#37510;傚揩鎹?#38335;瓹-a q鍙互瑙?#38335;佷竴涓細璇?#37510;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">涔?#37721;互浣?#37922;C-a x閿佸畾?#32048;璇?#38171;?#28051;嶅?#23680;殑鏄?#26473;?#37837;?#38335;佸畾涔嬪悗锛屼細璇濅細琚玈creen鎵灞?#37922;埛?#27537;瀵嗙?#20343;繚鎶?#38171;岄渶瑕?#26440;?#37711;?#28725;嗙?#20345;?#23944;兘缁?#32513;?#29825;?#38338;?#26473;?#28051;細璇?#37510;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">6.3 鍙戦佸懡浠?#37714;皊creen?#32048;璇?/strong></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">鍦Screen?#32048;璇?#28052;嬪锛?#37721;互閫?#26473;screen鍛?#28000;?#37823;?#28003;滀竴涓猄creen?#32048;璇?#38171;?#26473;?#28052;?#28051;?#28003;?#37922;Screen浣?#28051;鸿剼鏈?#32459;嬪?#24531;鍔?#27996;嗕究鍒?#37510;?#37711;?#27996;嶴creen鍦?#38004;?#37832;?#28051;殑?#31794;鐢?#29906;?#37713;?#27996;?#37711;?#38338;殑冨洿锛?#26473;?#38322;?#37721;?#37930;嬩竴涓?#28186;嬪瓙锛?#28003;撲細?#31476;涓?#37734;細璇?#28052;嬪瀵筍creen?#27537;鎿?#28003;?#38171;?/span></p><div style="margin: 5px 0px; font-size: 12px !important;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; word-wrap: break-word; white-space: pre-wrap; font-family: "Courier New" !important;">[root@TS-DEV ~]# screen -S sandy -X screen ping www.baidu.com</pre></div><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">杩?#28051;?#37723;?#28000;?#37734;竴涓?#37721;仛sandy?#27537;screen?#32048;璇?#28051;?#37714;涘缓?#31476;涓?#37826;扮獥鍙?#38171;?#39582;?#37734;?#37711;?#28051;?#26473;愯?#23474;ing鍛?#28000;?#37510;?/span></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">6.4 灞?#39582;曞垎?#22730;</strong></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">鐜?#37734;?#37828;剧鍣偅涔?#28598;?#38171;屽?#21973;竴涓?#28766;?#39582;曞垎?#22730;鎴?#28051;嶅?#23677;?#21700;煙鏄剧涓嶅?#23680;殑Screen?#29541;鍙?#37828;剧劧鏄?#28051;?#23536;?#38320;风殑浜嬫儏銆?#37721;互浣?#37922;?#36423;?#37817;?#38335;瓹-a S灏?#37828;剧鍣?#23000;?#39582;冲垎?#22730;锛孲creen 4.00.03鐗?#37832;互鍚?#38171;?#28052;?#37824;?#37816;佸鐩村垎灞?#38171;屽揩鎹?#38335;?#37828;疌-a |銆傚垎灞忎互鍚?#38171;?#37721;互浣?#37922;C-a <tab>鍦?#37722;?#28051;?#37718;哄?#26949;棿鍒囨崲锛?#23011;忎竴鍖哄潡涓婇兘鍙互鍒涘缓?#29541;鍙?#39582;?#37734;?#37711;?#28051;?#26473;愯杩?#32459;?#37510;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">鍙互鐢C-a X蹇?#37817;?#38335;?#37711;?#38338;?#35120;撳?#23943;劍鐐?#37813;鍦殑灞?#39582;?#37718;哄潡锛?#28052;?#37721;互鐢C-a Q鍏?#38338;?#38340;?#35120;撳?#23941;?#21700;潡涔嬪鍏?#28000;栫殑鎵?#28225;鍖哄潡銆?#37711;?#38338;殑鍖哄潡涓殑?#29541;鍙?#39582;?#28051;嶄?#27692;叧闂?#38171;?#26473;?#37721;互閫?#26473;囩獥鍙?#37714;囨崲鎵?#37714;?#28729;?#37510;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><img src="https://images0.cnblogs.com/blog/370046/201301/29205553-38cdde403beb45f4814ca9a180987a9e.jpg" alt="" width="900" style="margin: 0px; padding: 0px; border: 0px; max-width: 900px;" /></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">6.5 C/P妯?#23534;忓拰鎿?#28003;?/strong></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">screen?#27537;鍙竴涓?#23536;?#23534;?#28598;殑鍔熻兘?#27688;鏄?#37721;互鍦?#28051;嶅?#23680;獥鍙?#28052;嬮棿杩?#29723;?#28598;?#37714;剁?#27199;创浜?#37510;?#28003;?#37922;?#36423;?#37817;?#38335;瓹-a <Esc>鎴栬匔-a [鍙互杩?#37711;copy/paste妯?#23534;?#38171;?#26473;?#28051;?#22959;?#23534;?#28051;?#37721;互?#20762;鍦vi涓竴鏍?#32457;诲姩鍏夋爣锛?#39582;?#37721;互浣?#37922;?#32460;?#37837;?#38335;?#29825;剧疆?#29219;璁?#37510;?#37711;?#28729;?#37734;?#26473;?#28051;?#22959;?#23534;?#28051;嬫湁寰?#28598;?#32491;?#28028;vi?#27537;鎿?#28003;?#38171;岃濡?#28003;?#37922;?杩?#29723;屾?#28357;储锛?#28003;?#37922;y蹇?#38315;熸爣璁颁竴琛?#38171;?#28003;?#37922;w蹇?#38315;熸爣璁颁竴涓?#37719;?#29831;?#32475;?#37510;?#37711;?#27996;嶤/P妯?#23534;?#28051;嬬殑楂樼骇鎿?#28003;?#38171;?#37711;舵枃妗殑杩欎竴閮垎?#28225;姣旇緝璇?#32513;嗙殑璇?#37828;?#37510;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?#31476;鑸儏鍐?#28051;?#38171;?#37721;互绉诲姩鍏夋爣鍒版寚瀹?#28003;嶇疆锛屾寜涓嬬鏍?#29825;剧疆?#31476;涓?#23534;澶存爣璁?#38171;?#37906;跺?#24227;?#35826;姩鍏夋爣鍒扮粨灏?#28003;嶇疆锛屾寜涓嬬鏍?#29825;剧疆绗?#27996;?#28051;爣璁?#38171;屽?#23678;椂浼氬皢涓?#28051;爣璁?#28052;嬮棿?#27537;閮垎?#20557;瀛?#37734;copy/paste buffer涓?#38171;?#39582;堕鍑篶opy/paste妯?#23534;?#37510;?#37734;?#23005;?#29999;告寮?#28051;?#38171;?#37721;互浣?#37922;?#36423;?#37817;?#38335;瓹-a ]灏嗗偍瀛?#37734;buffer涓殑?#21812;瀹圭?#27199;创鍒板?#25779;?#23943;獥鍙?#37510;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><img src="https://images0.cnblogs.com/blog/370046/201301/29210355-9026652834d446d2bbafa18fd7bca276.jpg" alt="" width="900" style="margin: 0px; padding: 0px; border: 0px; max-width: 900px;" /></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">6.6 ?#27967;澶歴creen鍔熻兘</strong></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">鍚?#28598;?#28598;氭暟UNIX绋嬪簭?#31476;鏍?#38171;GNU Screen鎻愪緵浜?#28051;板寮?#28598;殑瀹氬?#36346;?#29115;兘銆?#28003;?#37721;互鍦Screen?#27537;榛樿涓?#32510;?#38320;嶇疆?#26499;浠?etc/screenrc?#25328;$HOME/.screenrc涓?#37816;?#28729;氭洿澶?#38171;屼?#23338;璁?#28729;歴creen閫?#26916;?#38171;?#28729;氬?#21057;粦瀹?#38335;?#38171;?#29825;?#28729;歴creen?#32048;璇濊嚜鍚姩?#29541;鍙?#38171;屽惎鐢?#28598;?#37922;埛妯?#23534;?#38171;?#28729;氬埗鐢埛璁?#38338;?#37833;?#38340;?#37818;?#37714;?#32475;?#32475;?#37510;傚鏋?#28003;犳?#25358;?#24533;殑璇?#38171;?#28052;?#37721;互?#22172;宸?#37816;?#28729;歴creen閰嶇疆?#26499;浠?#37510;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?#20114;澶?#37922;埛鍔熻兘涓轰緥锛宻creen榛樿鏄互鍗?#37922;埛妯?#23534;?#26473;愯?#23680;殑锛?#28003;犻渶瑕佸湪閰嶇疆?#26499;浠?#28051;?#37816;?#28729;歮ultiuser on 鏉?#37813;?#23534;澶?#37922;埛妯?#23534;?#38171;岄?#26473;acl*锛坅cladd,acldel,aclchg...锛夊懡浠?#38171;?#28003;?#37721;互鐏垫椿閰嶇疆鍏?#28000;?#37922;埛璁?#38338;?#28003;犵殑screen?#32048;璇?#37510;傛洿澶?#38320;嶇疆?#26499;浠跺唴瀹?#29831;?#37721;傝僺creen?#27537;man椤?#37510;?/p><div></div><img src ="http://www.9087120.com/markqian86/aggbug/215751.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.9087120.com/markqian86/" target="_blank">闀挎垷鍗佷笁鍗?/a> 2018-06-28 20:12 <a href="http://www.9087120.com/markqian86/archive/2018/06/28/215751.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣璇?#29825;?/a></div>]]></description></item><item><title>鍒?#37826;?#37904;?#37828;?#37722;?#37734;?#28598;?#26440;?#35120;唴閮?/title><link>http://www.9087120.com/markqian86/archive/2018/06/22/215739.html</link><dc:creator>闀挎垷鍗佷笁鍗?/dc:creator><author>闀挎垷鍗佷笁鍗?/author><pubDate>Fri, 22 Jun 2018 03:03:00 GMT</pubDate><guid>http://www.9087120.com/markqian86/archive/2018/06/22/215739.html</guid><wfw:comment>http://www.9087120.com/markqian86/comments/215739.html</wfw:comment><comments>http://www.9087120.com/markqian86/archive/2018/06/22/215739.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.9087120.com/markqian86/comments/commentRss/215739.html</wfw:commentRss><trackback:ping>http://www.9087120.com/markqian86/services/trackbacks/215739.html</trackback:ping><description><![CDATA[<p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, "Times New Roman", Times, sans-serif; background-color: #ffffff;">濡?#28003;?#37714;?#37826;竴涓?#37904;?#37828;?#37722;?#37734;?#28598;?#26440;?#35120;唴閮?#38171;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, "Times New Roman", Times, sans-serif; background-color: #ffffff;">锛?锛夐潰绉拰鍒?#37714;硶锛氬垽鏂洰?#29219;鐐?#28051;?#28598;?#26440;?#35120;殑姣?#37833;?#26440;圭?#21228;?#24878;殑?#31489;瑙?#35120;潰绉拰鏄?#37722;?#32475;?#27996;?#29831;?#28598;?#26440;?#35120;?#38171;?#37929;?#32475;?#37714;?#37734;?#28598;?#26440;?#35120;唴閮?#37510;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, "Times New Roman", Times, sans-serif; background-color: #ffffff;">锛?锛夊?#30789;?#25489;拰鍒?#37714;硶锛氬垽鏂洰?#29219;鐐?#28051;?#37813;?#28225;杈圭殑澶硅?#25489;拰鏄?#37722;?#28051;?60?#23475;锛?#28051;?60?#23475;鍒?#37734;?#28598;?#26440;?#35120;唴閮?#37510;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, "Times New Roman", Times, sans-serif; background-color: #ffffff;">锛?锛夊?#26334;?#21229;?#25358;硶锛?#28000;庣洰?#29219;鐐?#37713;?#37721;?#23534;曚竴鏉?#28751;勭嚎锛岀?#23341;繖鏉?#28751;勭?#22446;拰澶?#26440;?#35120;?#37813;?#28225;杈圭殑浜?#37904;规暟?#27952;銆傚鏋滄湁濂囨暟涓?#27996;?#37904;?#38171;?#37714;?#29831;?#37828;?#37734;唴閮?#38171;屽鏋滄湁鍋舵暟涓?#27996;?#37904;?#38171;?#37714;?#29831;?#37828;?#37734;?#28598;?#38318;?#37510;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, "Times New Roman", Times, sans-serif; background-color: #ffffff;">鍏?#28003;撳仛?#30838;锛氬?#21976;祴璇曠?#22317;殑Y鍧愭爣涓?#28598;?#26440;?#35120;殑姣忎竴涓?#37904;硅繘琛?#23011;旇緝锛屼?#27692;緱鍒颁竴涓祴璇曠偣鎵鍦殑琛?#28051;?#28598;?#26440;?#35120;?#26440;圭殑浜?#37904;圭殑鍒?#29723;?#37510;?#37734;?#28051;嬪?#21095;殑杩?#28051;?#28186;嬪瓙涓湁8鏉?#26440;?#28051;庢祴璇曠偣鎵鍦殑琛?#37929;?#27996;?#38171;岃屾湁6鏉?#26440;?#23052;湁鐩?#27996;?#37510;傚鏋滄祴璇曠?#22317;殑涓?#26440;圭?#22317;殑涓暟?#20824;鏄?#28610;囨暟涓?#37714;?#29831;祴璇曠偣鍦?#28598;?#26440;?#35120;唴锛屽惁鍒?#37734;?#28598;?#26440;?#35120;?#28598;?#37510;?#37734;?#26473;?#28051;?#28186;嬪瓙涓祴璇曠?#22317;殑宸?#26440;规湁5涓?#27996;?#37904;?#38171;?#37721;?#26440;规湁?#31489;涓?#27996;?#37904;?#38171;?#28729;?#28000;兘鏄?#28610;囨暟锛屾墍?#20114;鐐?#37734;?#28598;?#26440;?#35120;唴銆?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, "Times New Roman", Times, sans-serif; background-color: #ffffff;"><img src="https://images0.cnblogs.com/i/434101/201405/112137381678569.gif" alt="" style="margin: 0px auto; padding: 0px; border: none; max-width: 800px; display: block;" /></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, "Times New Roman", Times, sans-serif; background-color: #ffffff;">绠楁硶鍥?#29785;?#38171;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, "Times New Roman", Times, sans-serif; background-color: #ffffff;"><img src="https://images0.cnblogs.com/blog/434101/201412/061456221234057.jpg" alt="" style="margin: 0px; padding: 0px; border: none; max-width: 800px;" /></p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, "Times New Roman", Times, sans-serif; background-color: #ffffff;">鍏?#27996;?#26473;?#28051;?#32480;楁硶?#27537;鍏?#28003;撶殑?#27967;澶氬浘褰?#28186;嬪瓙锛歨ttp://alienryderflex.com/polygon/</p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, "Times New Roman", Times, sans-serif; background-color: #ffffff;">鍙傝?#28000;?#37934;?#38171;?/p><div style="margin: 5px 0px; font-size: 12px !important;"><div style="margin: 5px 0px 0px;"><span style="margin: 0px; padding: 0px 5px 0px 0px; line-height: 1.5 !important;"><a title="澶?#37714;?#28000;?#37934;? style="margin: 0px; padding: 0px; text-decoration-line: underline; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="澶?#37714;?#28000;?#37934;? style="margin: 0px; padding: 0px; max-width: 800px; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; word-wrap: break-word; white-space: pre-wrap; font-family: "Courier New" !important;"><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">int</span> pnpoly(<span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">int</span> nvert, <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">float</span> *vertx, <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">float</span> *verty, <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">float</span> testx, <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">float</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> testy) { </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">int</span> i, j, c = <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">0</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">; </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">for</span> (i = <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">0</span>, j = nvert-<span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">1</span>; i < nvert; j = i++<span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">) { </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">if</span> ( ((verty[i]>testy) != (verty[j]>testy)) &&<span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> (testx </span>< (vertx[j]-vertx[i]) * (testy-verty[i]) / (verty[j]-verty[i]) +<span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> vertx[i]) ) c </span>= !<span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">c; } </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">return</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> c; }</span></pre><div style="margin: 5px 0px 0px;"><span style="margin: 0px; padding: 0px 5px 0px 0px; line-height: 1.5 !important;"><a title="澶?#37714;?#28000;?#37934;? style="margin: 0px; padding: 0px; text-decoration-line: underline; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="澶?#37714;?#28000;?#37934;? style="margin: 0px; padding: 0px; max-width: 800px; border: none !important;" /></a></span></div></div><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, "Times New Roman", Times, sans-serif; background-color: #ffffff;">鏉嚜?#31476;涓猵olygon?#27537;?#21812;閮?#28729;?#37916;?#38171;?/p><div style="margin: 5px 0px; font-size: 12px !important;"><div style="margin: 5px 0px 0px;"><span style="margin: 0px; padding: 0px 5px 0px 0px; line-height: 1.5 !important;"><a title="澶?#37714;?#28000;?#37934;? style="margin: 0px; padding: 0px; text-decoration-line: underline; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="澶?#37714;?#28000;?#37934;? style="margin: 0px; padding: 0px; max-width: 800px; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; word-wrap: break-word; white-space: pre-wrap; font-family: "Courier New" !important;"> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">public</span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">bool</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> IsInside(PointLatLng p) { </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">int</span> count =<span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> Points.Count; </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">if</span>(count < <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">3</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">) { </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">return</span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">false</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">; } </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">bool</span> result = <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">false</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">; </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">for</span>(<span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">int</span> i = <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">0</span>, j = count - <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">1</span>; i < count; i++<span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">) { </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">var</span> p1 =<span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> Points[i]; </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">var</span> p2 =<span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> Points[j]; </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">if</span>(p1.Lat < p.Lat && p2.Lat >= p.Lat || p2.Lat < p.Lat && p1.Lat >=<span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> p.Lat) { </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">if</span>(p1.Lng + (p.Lat - p1.Lat) / (p2.Lat - p1.Lat) * (p2.Lng - p1.Lng) <<span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> p.Lng) { result </span>= !<span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">result; } } j </span>=<span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> i; } </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">return</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> result; }</span></pre><div style="margin: 5px 0px 0px;"><span style="margin: 0px; padding: 0px 5px 0px 0px; line-height: 1.5 !important;"><a title="澶?#37714;?#28000;?#37934;? style="margin: 0px; padding: 0px; text-decoration-line: underline; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="澶?#37714;?#28000;?#37934;? style="margin: 0px; padding: 0px; max-width: 800px; border: none !important;" /></a></span></div></div><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, "Times New Roman", Times, sans-serif; background-color: #ffffff;">鐗?#23048;婃儏鍐?#38171;?#29781;佹娴嬬殑鐐?#37734;?#28598;氬彉褰殑?#31476;鏉?#26440;?#28051;?#38171;屽?#21229;?#25358;硶鍒?#37826;殑?#31912;鏋?#37828;?#28051;嶇瀹氱殑锛岄渶瑕佺壒娈?#28598;勭悊锛?span style="margin: 0px; padding: 0px;">If the test point is on the border of the polygon, this algorithm will deliver unpredictable results</span>锛?#37510;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, "Times New Roman", Times, sans-serif; background-color: #ffffff;">璁?#32480;椾竴涓?#28598;?#26440;?#35120;殑?#28528;绉?#38171;坅rea of a polygon锛?#38171;?/p><div style="margin: 5px 0px; font-size: 12px !important;"><div style="margin: 5px 0px 0px;"><span style="margin: 0px; padding: 0px 5px 0px 0px; line-height: 1.5 !important;"><a title="澶?#37714;?#28000;?#37934;? style="margin: 0px; padding: 0px; text-decoration-line: underline; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="澶?#37714;?#28000;?#37934;? style="margin: 0px; padding: 0px; max-width: 800px; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; word-wrap: break-word; white-space: pre-wrap; font-family: "Courier New" !important;"> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">private</span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">static</span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">double</span> SignedPolygonArea(List<PointLatLng><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> points) { </span><span style="margin: 0px; padding: 0px; color: #008000; line-height: 1.5 !important;">//</span><span style="margin: 0px; padding: 0px; color: #008000; line-height: 1.5 !important;"> Add the first point to the end.</span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">int</span> pointsCount =<span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> points.Count; PointLatLng[] pts </span>= <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">new</span> PointLatLng[pointsCount + <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">1</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">]; points.CopyTo(pts, </span><span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">0</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">); pts[pointsCount] </span>= points[<span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">0</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">]; </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">for</span> (<span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">int</span> i = <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">0</span>; i < pointsCount + <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">1</span>; ++<span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">i) { pts[i].Lat </span>= pts[i].Lat * (System.Math.PI * <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">6378137</span> / <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">180</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">); pts[i].Lng </span>= pts[i].Lng * (System.Math.PI * <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">6378137</span> / <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">180</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">); } </span><span style="margin: 0px; padding: 0px; color: #008000; line-height: 1.5 !important;">//</span><span style="margin: 0px; padding: 0px; color: #008000; line-height: 1.5 !important;"> Get the areas.</span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">double</span> area = <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">0</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">; </span><span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">for</span> (<span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">int</span> i = <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">0</span>; i < pointsCount; i++<span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">) { area </span>+= (pts[i + <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">1</span>].Lat - pts[i].Lat) * (pts[i + <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">1</span>].Lng + pts[i].Lng) / <span style="margin: 0px; padding: 0px; color: #800080; line-height: 1.5 !important;">2</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;">; } </span><span style="margin: 0px; padding: 0px; color: #008000; line-height: 1.5 !important;">//</span><span style="margin: 0px; padding: 0px; color: #008000; line-height: 1.5 !important;"> Return the result.</span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">return</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> area; } </span><span style="margin: 0px; padding: 0px; color: #808080; line-height: 1.5 !important;">///</span> <span style="margin: 0px; padding: 0px; color: #808080; line-height: 1.5 !important;"><summary></span> <span style="margin: 0px; padding: 0px; color: #808080; line-height: 1.5 !important;">///</span><span style="margin: 0px; padding: 0px; color: #008000; line-height: 1.5 !important;"> Get the area of a polygon </span><span style="margin: 0px; padding: 0px; color: #808080; line-height: 1.5 !important;">///</span> <span style="margin: 0px; padding: 0px; color: #808080; line-height: 1.5 !important;"></summary></span> <span style="margin: 0px; padding: 0px; color: #808080; line-height: 1.5 !important;">///</span> <span style="margin: 0px; padding: 0px; color: #808080; line-height: 1.5 !important;"><param name="points"></param></span> <span style="margin: 0px; padding: 0px; color: #808080; line-height: 1.5 !important;">///</span> <span style="margin: 0px; padding: 0px; color: #808080; line-height: 1.5 !important;"><returns></returns></span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">public</span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">static</span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">double</span> GetPolygonArea(List<PointLatLng><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> points) { </span><span style="margin: 0px; padding: 0px; color: #008000; line-height: 1.5 !important;">//</span><span style="margin: 0px; padding: 0px; color: #008000; line-height: 1.5 !important;"> Return the absolute value of the signed area. </span><span style="margin: 0px; padding: 0px; color: #008000; line-height: 1.5 !important;">//</span><span style="margin: 0px; padding: 0px; color: #008000; line-height: 1.5 !important;"> The signed area is negative if the polygon is oriented clockwise.</span> <span style="margin: 0px; padding: 0px; color: #0000ff; line-height: 1.5 !important;">return</span><span style="margin: 0px; padding: 0px; line-height: 1.5 !important;"> Math.Abs(SignedPolygonArea(points)); }</span></pre><div style="margin: 5px 0px 0px;"><span style="margin: 0px; padding: 0px 5px 0px 0px; line-height: 1.5 !important;"><a title="澶?#37714;?#28000;?#37934;? style="margin: 0px; padding: 0px; text-decoration-line: underline; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="澶?#37714;?#28000;?#37934;? style="margin: 0px; padding: 0px; max-width: 800px; border: none !important;" /></a></span></div></div><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, "Times New Roman", Times, sans-serif; background-color: #ffffff;"> </p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, "Times New Roman", Times, sans-serif; background-color: #ffffff;"> </p><img src ="http://www.9087120.com/markqian86/aggbug/215739.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.9087120.com/markqian86/" target="_blank">闀挎垷鍗佷笁鍗?/a> 2018-06-22 11:03 <a href="http://www.9087120.com/markqian86/archive/2018/06/22/215739.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣璇?#29825;?/a></div>]]></description></item><item><title>Linux涓嬪唴瀛樻娴嬪伐鍏?#38171;asanhttp://www.9087120.com/markqian86/archive/2018/06/14/215728.html闀挎垷鍗佷笁鍗?/dc:creator>闀挎垷鍗佷笁鍗?/author>Thu, 14 Jun 2018 07:46:00 GMThttp://www.9087120.com/markqian86/archive/2018/06/14/215728.htmlhttp://www.9087120.com/markqian86/comments/215728.htmlhttp://www.9087120.com/markqian86/archive/2018/06/14/215728.html#Feedback0http://www.9087120.com/markqian86/comments/commentRss/215728.htmlhttp://www.9087120.com/markqian86/services/trackbacks/215728.htmlASAN锛?span xml:lang="en-us" style="outline: 0px; box-sizing: border-box; word-break: break-all;">Address-Sanitizier锛?/span>鏃?#37711;?#37828;?span xml:lang="en-us" style="outline: 0px; box-sizing: border-box; word-break: break-all;">LLVM涓殑鐗?#37804;?#38171;屽悗琚?#37716;?#37711;?/span>GCC 4.8锛?#37734;?/span>GCC 4.9鍚?#37716;?#37711;?#28725;?/span>ARM骞?#37721;扮殑鏀?#37816;?#37510;傚洜姝?/span>GCC 4.8?#20114;涓?#37911;?#37832;?#28003;?#37922;ASAN?#26882;涓嶉渶瑕佸?#22798;绗笁?#26591;?#31793;锛岄?#26473;?#37734;紪璇戞椂鎸?#28729;氱紪璇?/span>CFLAGS鍗?#37721;?#37813;?#23534;寮鍏?#37510;?/span>

1銆佺紪璇戦?#26916;?/span>

1.1 Gcc?#32042;璇戦?#26916;?/span>

# -fsanitize=address锛氬紑鍚唴瀛樿?#23108;?#23678;?#31092;

# -fsanitize-recover=address锛氫竴鑸?#37722;?#37721;?#32459;嬪簭涓?#28103;?#29831;佺瀹?#37804;?#38171;?#28051;嶈兘?#20131;鍒?#38335;?#29831;氨绠鍗?#38315;鍑?#38171;岃?#37828;?#32513;?#32513;?#26473;愯锛岄噰鐢?#29831;?#38315;?#26916;?#37824;?#37816;佸唴瀛?#37713;?#38335;?#28052;嬪悗绋嬪?#24533;户缁?#26473;愯锛岄渶瑕佸?#29362;姞璁剧疆ASAN_OPTIONS=halt_on_error=0鎵嶄細鐢?#37825;?#38171;涜嫢鏈?#29825;剧疆姝?#38315;?#26916;?#38171;?#37714;欏唴瀛?#37713;?#38335;?#37719;虫姤閿?#38315;鍑?/span>

ASAN_CFLAGS += -fsanitize=address -fsanitize-recover=address

 

# -fno-stack-protector锛氬幓浣?#38003;芥?#22559;孩鍑?#28103;?#37814;?/span>

# -fno-omit-frame-pointer锛氬幓浣?#38003;芥?#22559;孩鍑?#28103;?#37814;?/span>

# -fno-var-tracking锛?#27035;樿閫?#26916;?#28051;?span xml:lang="en-us" style="outline: 0px; box-sizing: border-box; word-break: break-all;">-fvar-tracking锛屼?#27692;鑷?#26473;愯?#23684;潪甯告

# -g1锛?#29723;?#32448;?#37832;灏忚皟璇?#28103;伅锛岄氬父debug鐗?#37832;?#37922;?/span>-g鍗?/span>-g2

ASAN_CFLAGS += -fno-stack-protector -fno-omit-frame-pointer -fno-var-tracking -g1

1.2 Ld閾炬帴閫?#26916;?/span>

ASAN_LDFLAGS += -fsanitize=address -g1

濡?#37835;?#28003;?#37922;?span xml:lang="en-us" style="outline: 0px; box-sizing: border-box; word-break: break-all;">gcc閾炬帴锛屾澶?#37721;?#36423;界暐銆?/span>

2銆?span xml:lang="en-us" style="outline: 0px; box-sizing: border-box; word-break: break-all;">ASAN杩愯?#23684;?#26916;?/span>

2.1 ASAN_OPTIONS璁剧疆

ASAN_OPTIONS鏄?span xml:lang="en-us" style="outline: 0px; box-sizing: border-box; word-break: break-all;">Address-Sanitizier?#27537;杩愯?#23684;?#26916;圭幆澧?#37721;?#38322;?#37510;?/span>

# halt_on_error=0锛氭娴嬪唴瀛橀敊璇?#37722;庣户缁?#26473;愯

# detect_leaks=1:浣胯兘?#21812;瀛?#23049;勯湶妫?#31092;

# malloc_context_size=15锛氬唴瀛橀敊璇?#37721;?#37922;熸椂锛?#37828;剧?#34425;殑璋?#37922;?#37837;?#28766;傛暟涓?span xml:lang="en-us" style="outline: 0px; box-sizing: border-box; word-break: break-all;">15

# log_path=/home/xos/asan.log:?#21812;瀛樻鏌?#38338;?#26864;?#37827;?#36423;?#28699;?#37824;炬枃浠惰矾?#32222;

# suppressions=$SUPP_FILE:灞忚?#33445;墦鍗版煇浜涘唴瀛橀敊璇?/span>

export ASAN_OPTIONS=halt_on_error=0:use_sigaltstack=0:detect_leaks=1:malloc_context_size=15:log_path=/home/xos/asan.log:suppressions=$SUPP_FILE

 

闄?#27996;?#28051;?#26473;?#29999;?#37922;?#38315;?#26916;?#38171;屼互涓嬭?#27195;湁?#31476;浜?#38315;?#26916;?#37721;?#37837;规嵁瀹?#38340;呴渶瑕佹?#35826;姞锛?/span>

# detect_stack_use_after_return=1锛氭鏌?#29825;?#38338;?#37816;囧?#25117;凡琚?#38322;?#37824;剧殑鏍堢?#27946;棿

# handle_segv=1锛氬?#21229;悊娈?#38335;?#29831;?#38171;?#28052;?#37721;互娣诲姞handle_sigill=1澶勭悊SIGILL淇?#37721;?/span>

# quarantine_size=4194304:?#21812;瀛?span xml:lang="en-us" style="outline: 0px; box-sizing: border-box; word-break: break-all;">cache鍙?#32514;撳瓨free?#21812;瀛?#28598;?#28751;?/span>4M

ASAN_OPTIONS=${ASAN_OPTIONS}:verbosity=0:handle_segv=1:allow_user_segv_handler=1:detect_stack_use_after_return=1:fast_unwind_on_fatal=1:fast_unwind_on_check=1:fast_unwind_on_malloc=1:quarantine_size=4194304

2.2 LSAN_OPTIONS璁剧疆

LSAN_OPTIONS鏄?span xml:lang="en-us" style="outline: 0px; box-sizing: border-box; word-break: break-all;">LeakSanitizier杩愯?#23684;?#26916;圭殑?#24134;澧?#37721;?#38322;?#38171;岃?/span>LeakSanitizier鏄?/span>ASAN?#27537;?#21812;瀛?#23049;勬?#24532;娴嬫鍧?#38171;?#29999;?#37922;?#26473;愯?#23684;?#26916;规湁锛?/span>

# exitcode=0锛?#29825;剧疆?#21812;瀛?#23049;勯湶閫鍑虹?#20343;负0锛岄?#27199;?#20751;鍐靛唴瀛?#23049;勯湶閫鍑虹爜0x16

# use_unaligned=4锛?span xml:lang="en-us" style="outline: 0px; box-sizing: border-box; word-break: break-all;">4瀛楄?#20634;榻?/span>

export LSAN_OPTIONS=exitcode=0:use_unaligned=4

3銆佹荤粨

瀹?#38340;?#23534;鍙戠幆澧?#28051;?#38171;?#37721;兘瀛?#37734;?span xml:lang="en-us" style="outline: 0px; box-sizing: border-box; word-break: break-all;">gcc鐗?#37832;?#28003;?#38171;?#28003;?#37922;?/span>asan鍋氬唴瀛樻鏌椂锛岄渶瑕?#38334;炬帴libasan.so?#31793;?#27537;?#20751;鍐?#37510;?#37711;舵锛?#39582;?#37721;拌蒋浠堕氬父?#20824;浼氬唴閮?#28729;?#37916;颁竴濂楀唴瀛樻搷浣滄帴鍙?#38171;?#28051;?#28003;?#37922;?/span>asan?#20240;鍏?#38171;岄渶瑕佹?#25358;崲鎴?/span>glibc鎻愪?#28058;殑?#24116;鍙?#37510;傛?#26882;锛?#37721;互閫?#26473;?/span>LD_PRELOAD?#24134;澧?#37721;?#38322;?#29785;?#37712;?#26473;?#32491;婚棶棰?#37510;?/span>

export LD_PRELOAD= libasan.so.2:libprelib.so   #vos_malloc --> malloc



ps:
1銆佸?#22798;?#21287;LVM 3.1?#20114;涓?#37911;?#37832;?/span>

2銆佺紪璇?#37721;傛暟闄勫姞

-fsanitize=address

3銆?#29825;剧疆?#24134;澧?#37721;?#38322;?#37721;傛暟

export ASAN_SYMBOLIZER_PATH=/usr/local/bin/llvm-symbolizer

export ASAN_OPTIONS=symbolize=1

4銆?#26473;愯绋嬪簭锛屽鏋?#37713;?#38335;?#38171;宎ddressSanitizer?#32048;缁?#37713;?#29831;?#32513;嗙殑鎶?#37723;?#37510;?/p>



]]> տ3
<center id="iceyg"><tr id="iceyg"></tr></center>
<noscript id="iceyg"></noscript>
<center id="iceyg"></center>
<noscript id="iceyg"></noscript>
<noscript id="iceyg"></noscript>
<center id="iceyg"><tr id="iceyg"></tr></center>
<noscript id="iceyg"></noscript>
<center id="iceyg"></center>
<noscript id="iceyg"></noscript>
<noscript id="iceyg"></noscript>