锘??xml version="1.0" encoding="utf-8" standalone="yes"?>C++鍗氬-markqian86http://www.2676208.com/markqian86/practice makes perfect锛岄槄璇汇佸垎鏋愩佺粌涔犮佹荤粨銆?/description>zh-cnWed, 14 Aug 2019 07:20:46 GMTWed, 14 Aug 2019 07:20:46 GMT60MySQL: Error Code: 1118 Row size too large (> 8126). Changing some columns to TEXT or BLOBhttp://www.2676208.com/markqian86/archive/2019/08/08/216653.html闀挎垷鍗佷笁鍗?/dc:creator>闀挎垷鍗佷笁鍗?/author>Thu, 08 Aug 2019 10:11:00 GMThttp://www.2676208.com/markqian86/archive/2019/08/08/216653.htmlhttp://www.2676208.com/markqian86/comments/216653.htmlhttp://www.2676208.com/markqian86/archive/2019/08/08/216653.html#Feedback0http://www.2676208.com/markqian86/comments/commentRss/216653.htmlhttp://www.2676208.com/markqian86/services/trackbacks/216653.html 瑙e喅鍔炴硶锛?br />vim /etc/my.cnf锛屾牴鎹疄闄呮儏鍐佃繘琛屽弬鏁拌皟鏁?#38171;?br />[mysqld]
max_allowed_packet = 1G
innodb_log_file_size = 30M
innodb_log_buffer_size = 512M
innodb_file_format='Barracuda'


alter table 'role' row_format=dynamic
淇敼涔嬪悗锛岄噸鍚痬ysql鏈?#37716;?#37510;?nbsp;

mysql鏂囨。
https://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-20.html
In MySQL 5.6.22, the redo log BLOB write limit is relaxed to 10% of the total redo log size (innodb_log_file_size * innodb_log_files_in_group).



# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
#server_id = 1
# socket = .....

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 
#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
port=3306
basedir=/data/mysql
datadir=/data/mysql/mysqldata
log-error=/data/mysql/log
socket=/tmp/mysqld.sock
server_id=1
back_log=2048
log-bin=mysql-bin 
bind-address=0.0.0.0
character-set-server=utf8
collation-server=utf8_general_ci
skip-external-locking
skip-name-resolve
query_cache_type=0
max_connections=2000
max_connect_errors=1000000
default-storage-engine=INNODB
innodb_buffer_pool_size=12884901888
innodb_concurrency_tickets=5000
innodb_flush_method=O_DIRECT
innodb_io_capacity=2000
innodb_io_capacity_max=4000
innodb_log_buffer_size=1048576
innodb_log_file_size=1048576000
innodb_log_files_in_group=2
innodb_file_format=Barracuda
innodb_file_per_table=ON
innodb_file_format_max=Antelope
innodb_max_dirty_pages_pct=75
innodb_open_files=3000
innodb_additional_mem_pool_size=20M
innodb_sort_buffer_size=8388608
join_buffer_size=262144
key_buffer_size=16777216
preload_buffer_size=32768
read_buffer_size=262144
read_rnd_buffer_size=262144
sort_buffer_size=262144
max_allowed_packet=1073741824
binlog_stmt_cache_size=32768
bulk_insert_buffer_size=4194304
key_buffer=64M
slow_query_log=1
slow_query_log_file=/data/mysql/log
long_query_time=5
sync_frm=ON
max_binlog_size=524288000
sync_binlog=1000
binlog_format=ROW
binlog_cache_size=2097152
expire_logs_days=3
tmpdir=/data/mysql/tmpdir
max_tmp_tables=32
tmp_table_size=262144
open_files_limit=65535
table_definition_cache=512
table_open_cache=100
default_storage_engine=InnoDB
default_tmp_storage_engine=InnoDB
log_queries_not_using_indexes=ON
interactive_timeout=7200
lock_wait_timeout=31536000
wait_timeout=86400
connect_timeout=120
pid_file=/data/mysql/mysqldata/mysqld.pid
slave-skip-errors=1062,1053,1146,1061

[mysql]
port=3306
socket=/tmp/mysqld.sock
default-character-set=utf8


]]>
__attribute__ 鎬荤粨http://www.2676208.com/markqian86/archive/2019/01/26/216222.html闀挎垷鍗佷笁鍗?/dc:creator>闀挎垷鍗佷笁鍗?/author>Sat, 26 Jan 2019 07:28:00 GMThttp://www.2676208.com/markqian86/archive/2019/01/26/216222.htmlhttp://www.2676208.com/markqian86/comments/216222.htmlhttp://www.2676208.com/markqian86/archive/2019/01/26/216222.html#Feedback0http://www.2676208.com/markqian86/comments/commentRss/216222.htmlhttp://www.2676208.com/markqian86/services/trackbacks/216222.html?#27076;璇诲叏鏂?/a>

]]>
瀹夎distcc?#22414;?#31479;寮忕紪璇戠幆澧?/title><link>http://www.2676208.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.2676208.com/markqian86/archive/2018/09/08/215912.html</guid><wfw:comment>http://www.2676208.com/markqian86/comments/215912.html</wfw:comment><comments>http://www.2676208.com/markqian86/archive/2018/09/08/215912.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.2676208.com/markqian86/comments/commentRss/215912.html</wfw:commentRss><trackback:ping>http://www.2676208.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.涓嬭浇骞?#29785;?#37720;媎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.杩?#29723;?/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;">    鏈?#37716;?#32468;?#26473;?#29723;?nbsp;</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:鏈?#37716;?#32468;痙istcc绋嬪簭璺緞:鏈?#37716;?#37731;ㄧ紪璇戝伐鍏?#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;?#29723;?:</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;伐鍏疯兘澶熼潪甯?#37832;?#37825;?#37734;?#37720;嬬缉?#32042;璇戞椂?#26879;銆?#28729;?#28000;?#39582;?#28051;?#37828;?#37913;?#32468;嬬殑?#32042;璇?#37731;?#38171;岃屾槸閰?#37722;?GNU GCC浣?#37922;?#38171;?#28729;?#28000;?#37928;勮祫鏂?#37828;庣‘璇?#37828;?#39582;?#28051;嶅?#34411;敞鍏?#28000;栫紪璇?#37731;?#38171;?#37510;俤istcc浠嬬粛涓?#29831;?#38171;屾湁浜?#28729;屾?#23544;紪璇慘DE椤圭洰鍙姳璐??#22414;?#25363;銆?#37721;?#29785;佸?#36346;?#22794;锛佹澶?#38171;屽畠浠兘?#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;蒋浠剁殑瀹夎?#21614;病浠涔堝ソ璇寸殑锛岄兘鏄爣鍑嗙殑"./configure;make;make install"銆?#37734;║buntu涓?#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++鏋勫缓?#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;?#37716;?#37731;?#37510;?#28729;?#37734;?gcc -c"闃舵?#22443;妸棰?#28598;勭悊杈?#37713;哄垎鍙?#37714;版寚瀹氱殑鏈?#37716;?#37731;?#38339;?#37714;?#38171;?#37722;?#37832;?#37716;?#37731;?#37929;?#37722;琓CP绔?#37721;?632锛?#39582;舵?#22549;?#21977;粨鏋?#37510;侴NU Make?#25328;SCons?#27537;"-j"骞?#29723;岀紪璇?#37721;互鍒?#37922;╠istcc鏉?#37716;?#38315;熺紪璇?#37510;?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />distcc鐢ㄦ硶锛?br style="word-wrap: break-word;" />(1)鏈?#37716;?#37731;?#32468;互?#27352;閫?#37922;ㄦ埛鎵?#29723;?#8220;distccd --daemon --allow 10.0.0.0/16”銆?#26473;?#28003;?#23536;梔istccd?#24116;鍙楁潵?#22172;10.0缃?#23048;电殑鎵鏈塗CP杩炴帴銆?br style="word-wrap: break-word;" />?#25950;?#21104;锛歞istcc鏂囨。涓?#29831;?--allow 0.0.0.0"鏄帴鍙楁墍鏈夎?#28852;帴锛?#38171;?#26473;?#23480;?#32513;?#26473;囨椂锛屽疄闄呮晥鏋?#37828;?#37815;?#32513;?#37813;鏈夎?#28852;帴锛?br style="word-wrap: break-word;" />(2)濡?#37835;滃伐绋嬩娇鐢╝utomake鏈?#37714;?#37510;?br style="word-wrap: break-word;" />璁剧疆DISTCC_HOSTS?#24134;澧?#37721;?#38322;?#37510;?br style="word-wrap: break-word;" />鍦╟onfigure闃舵鎵?#29723;?CC=distcc ./configure"銆傜?#36346;悗鎵?#29723;?make -j XX"銆俋X鏄?#39582;?#37721;?#28000;?#37716;?#37825;扮洰涓?#38340;愩?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;" />淇敼Makefile浣?#23536;?#37734;?#37720;?#37833;/C++?#32042;璇?#37731;?#37722;嶇?#26495;墠鍔?#28051;?distcc "锛屼?#23338;璁剧疆CC="distcc arm-linux-gcc"銆傜?#36346;悗鎵?#29723;?make -j XX"銆俋X鏄?#39582;?#37721;?#28000;?#37716;?#37825;扮洰涓?#38340;愩?br style="word-wrap: break-word;" />(4)濡?#37835;滃伐绋?#37922;盨Cons绠$悊銆?br style="word-wrap: break-word;" />淇敼SConstruct浣?#23536;?#37734;?#37720;?#37833;/C++?#32042;璇?#37731;?#37722;嶇?#26495;墠鍔?#28051;?distcc "銆傚鍑虹幆澧?#37721;?#38322;廐OME?#25328;DISTCC_HOSTS鍒?#37835;勫缓?#24134;澧?#38171;堟敞?#21104;SCons涓嶄細?#22172;鍔?#37814;?#32495;荤粺?#24134;澧?#37721;?#38322;忓鍑?#37714;癰uilder瀛愯繘绋?#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;?#37716;?#37825;扮洰涓?#38340;愩?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;" />杩?#29723;宒istccmon-gnome銆傚鏋?#37734;ㄧ紪璇?#37832;熼棿鏌?#28051;猟istcc鏈?#37716;?#37731;ㄤ竴鐩?#28051;嶆椿璺?#38171;屽彲?#20824;?#27537;鍘熷洜姣旇緝澶?#37510;?br style="word-wrap: break-word;" />distcc鏈?#37716;?#37731;ㄧ殑闂?#26864;?#37721;兘鏈?br style="word-wrap: break-word;" />(1) IP鍦板潃涓嶅彲杈?#37510;?br style="word-wrap: break-word;" />(2) distccd?#32344;绋?#23052;?#37832;?#37722;?#37716;?#37510;?br style="word-wrap: break-word;" />(3) distcc瀹㈡埛绔疘P涓嶅湪--allow鎸?#28729;?#37928;勮?#20904;洿鍐?#37510;?br style="word-wrap: break-word;" />(4) distccd鐩?#37722;殑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;兘鏈?#38171;?br style="word-wrap: break-word;" />(1) ?#31476;浜涚幆澧?#37721;?#38322;?#23052;?#37832;?#29825;剧疆<br style="word-wrap: break-word;" />distcc渚?#29863;栫殑?#24134;澧?#37721;?#38322;?#37832;塇OME?#25328;DISTCC_HOSTS銆?br style="word-wrap: break-word;" />distcc 鏃?#36423;?#37734;?#29785;e喅闂?#26864;?#37827;跺挨鍏?#37832;?#37922;?#37510;傞?#27199;?#27537;閿?#29831;?#28103;℃伅杈?#37713;?#37734;╟onsole銆?#26473;?#37721;互璁剧疆DISTCC_VERBOSE?#25328;DISTCC_LOG?#24134;澧?#37721;?#38322;忎互璁板綍璇?#32513;?#37928;勮皟璇?#28103;℃伅鍒颁竴鏃?#36423;?#37826;?#28000;?#38171;?#26473;?#28725;圭悊瑙istcc?#20240;浣?#26473;?#32459;?#28052;熼潪甯?#37832;?#37922;?#38171;?#37510;傚弬鑰僤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;?#37716;?#37731;?#37510;傜?#31476;瓒熺紪璇戞椂ccache缂撳瓨浜咷CC?#27537;“-E”杈?#37713;?#37510;佺紪璇戦?#26916;逛互鍙?o鏂?#28000;?#37714;?HOME/.ccache銆傜浜屾?#32042;璇?#37827;跺敖閲?#37714;?#37922;?#32514;撳瓨锛屽?#21616;?#20345;椂?#27967;鏂?#32514;撳瓨銆?#37813;?#20114;鍗?#28003;?make clean; make"涔熻兘浠?#28051;?#38014;?#23536;?#28610;?#28598;?#37510;俢cache鏄?#32513;?#26473;?#28000;?#32513;嗙紪鍐欑殑锛岀‘淇?#27996;?#28051;庣?#23384;帴浣?#37922;℅CC鑾?#23536;?#28729;屽叏鐩?#37722;?#37928;勮緭鍑?#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;鏈塁/C++?#32042;璇?#37731;?#37722;嶇?#26495;墠鍔?#28051;?ccache "鍗?#37721;?#37510;?br style="word-wrap: break-word;" />ccache杩?#37721;互鎶奷istcc浣?#28051;哄悗鍙扮殑?#32042;璇?#37731;?#37510;傜紪璇?#37731;?#29825;剧疆涓?ccache distcc "锛嬪?#29114;紪璇?#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;╟cache鎴杁istcc锛?#38340;ocalhost澶?#37721;?#37922;?鍙癲istcc鏈?#37716;?#37731;?#38171;?#37825;?#37835;?#23011;旇緝鏄捐憲銆?#28003;?#37828;?#38001;?#37722;?#28003;?#37922;╠istcc?#25328;ccache?#27537;鏁?#37835;滃氨?#25328;浠?#28003;?#37922;╠istcc宸?#28051;嶅銆?#28051;?#27996;哄?#37722;?#27996;?#37721;?#28003;?#37922;╠istcc锛屽?#27692;姞鍑?#37721;癲istcc鏈?#37716;?#37731;?#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;">鐢╠istcc锛宑cache鏄?#28051;?#39582;村墠锛岄?#22317;洰?#31912;鏉熺殑绌洪殭锛岃嚜宸?#37815;挎潵鐜╃殑銆傚?#25780;椂鏄?#37734;╝rm涓婂?#27697;殑?#31476;涓?#23536;?#28598;х殑?#20240;绋?#38171;屽?#25780;椂?#27537;PC锛屽彧?#32042;UI閮ㄥ垎?#27688;?#28214;瑕?涓?#28751;忔椂锛?#26473;?#28052;?#37828;?#28051;?#28000;涔堝悗鏉?#37812;?#37922;ㄥ垎?#31479;寮忕紪璇戠殑鍘熷?#29358;傞偅涓?#26916;圭洰鏄痗++鍔燼dobe?#27537;flash锛?#28000;縤phone?#20187;?#31476;娆?#23536;堢偒?#27537;鎵?#37832;?#38171;屽叾涓璘I鍏?#38318;?#37922;╢lash?#20187;锛屾晥鏋?#23536;堢偒锛岄熷害?#27688;姣旇緝宸?#27996;?#37510;傚悗鏉?#38171;屾垜涔?#29831;?#26473;?#37734;╝rm9261锛?00MHz锛?#28051;?#37922;╣nash鎾?#37824;緁lash锛屾晥鏋滅‘瀹炴?#26055;緝?#31476;鑸?#37510;傝█褰掓浼?#38171;?#26473;?#37828;?#37833;?#29831;?#28051;嬪垎?#31479;寮忕紪璇?#38171;屽?#36346;疄瀹冪殑鍘熺?#21975;緢绠鍗?#38171;屾妸c鏂?#28000;?#37734;?#37832;?#37832;?#26864;勭紪璇?#38171;?#37906;跺悗鍙?#37714;?#37711;?#28000;?#28051;?#37832;鸿繘琛岀紪璇?#38171;岀紪璇戠殑?#24727;?#27537;o鏂?#28000;?#37712;嶄?#29362;?#28852;湰鏈?#38171;屾渶?#24727;鍦?#37832;?#37832;鸿繘琛岄?#28844;帴銆?#23052;?#37832;夌?#23341;繃浠?#37934;?#38171;岀?#28356;?#23338;浜?#23011;?#28051;紪璇戠殑c鏂?#28000;跺?#29808;簲浜?#37922;熶竴涓紪璇?#28000;?#37716;?#38171;?#28051;嬪彂鍒?#37711;?#28000;?#37832;?#37731;?#37812;?#37832;?#37832;?#38171;屾渶缁?#28729;屾?#24878;紪璇?#37510;?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />鎴?#28000;殑?#24134;澧?#37828;疉DS1.2+cygwin锛?#37922;╰cc锛宼cpp?#32344;琛岀紪璇?#37510;俤istcc锛宑cache鏈?#37833;?#37828;?#37734;╟ygwin涓?#37929;存帴瑁呯殑?#27537;锛?#28003;嗗悗鏉?#37734;?#28003;?#37922;ㄦ椂鍙戠?#39041;細紕?#37714;颁竴浜?#38338;?#26864;?#37510;?#37813;?#20114;浠庢簮鐮佺紪璇?#27996;?#37510;俤istcc浜?#37922;熺殑涓棿鏂?#28000;?#37828;?i?#27537;鏍?#23534;?#38171;宼cc鏃犳硶璇?#37714;?#29831;?#37826;?#28000;?#32491;诲瀷锛岄渶瑕佷慨?#25980;婧?#37934;?#37510;傚氨?#31476;鍙?#29831;?#38171;?#32515;?#28051;?#37721;互?#24755;鍒扮殑銆俰f(dcc_getenv_bool("DISTCC_KEEP_FILETYPE", 1)).鐒跺悗锛?/configure; make; make install銆俢cache闂?#26864;?#37828;竴鏍风殑锛屾?#29363;硶璇?#37714;?i鏂?#28000;?#38171;?#28103;敼ccache.c锛屾妸涓棿鏂?#28000;秈/ii?#25980;涓篶/cpp锛屼竴鏍风殑鏂?#23534;忓?#22798;銆?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />鐒跺悗瑕佸瀹夎?#21615;殑涓?#29783;胯繘琛岄?#23943;疆锛屾?#25117;?#25780;椂?#27537;閰嶇疆濡?#28051;?#38171;?0.19.5.0缃?#23048;电殑涓?#37832;洪兘鍙互?#20187;鍗?#37722;岀紪璇戠殑涓?#37832;?#38171;屽綋?#21159;ads?#27537;licence鍙?#37832;?0涓暒銆傛澶勭洰褰?#29825;剧疆鑷?#37711;抽噸瑕?#38171;宼cc鏃犳硶璇?#37714;玞ygwin?#24134;澧?#38171;宼cc -c /cygdriver/c/a.c,  tcc鏃犳硶璇?#37721;?#37826;?#28000;?#38171;岄敊璇?#37934;佷负C3052E銆?#37714;?#37922;?#27996;哻ygwin鏃?#37721;互win32鐨勮矾?#32222;锛屽張鍙互璇?#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;?#37832;?#29825;剧疆DISTCCD_PATH?#26882;锛?#28003;?#37922;?#32495;荤粺?#27537;PATH浣?#28051;?#37820;滅储锛屽拰makefile閲屾寚瀹氱殑涓嶄竴鑷?#37510;?#29825;剧疆浜咲ISTCCD_PATH锛屽?#22563;帿鍚嶅?#36346;锛屽?#25780;椂鏄?#28051;?#28000;涔?#37510;傜?#36346;悗distccd --daemon --allow0.0.0.0/0锛?#28000;?#28003;昳p?#20824;鍙互?#24116;鍏?#38171;屾?#26055;緝绠鍗?#37510;?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />淇敼makefile锛屽湪CC锛孉RMCC锛孉RMCPP锛孴CPP鍘?#37833;?#37928;勮?#21095;疆?#22688;锛屾坊鍔燾cache銆傞渶瑕?#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;" />鏈?#24727;?#27537;?#31092;璇?#23536;?#32480;鍗?#38171;岃嚜宸?#37712;檓akefile锛屽彧?#20187;".c.o:" 锛?#37906;跺悗鎶?o鏂?#28000;堕?#28844;帴鍒板伐绋嬩腑?#27688;鍙互浜?#37510;?#37734;?#37813;?#37832;?#28051;?#26473;?#37828;?#37721;互寰堝?#30028;殑run璧?#37833;ョ殑銆傚綋鐒堕獙璇佺殑?#20240;浣?#28051;?#37828;偅涔?#32480;鍗?#27996;?#38171;岀?#23337;簡涓嬪?#23942;?#22249;紪?#27537;浠?#37934;?#37510;備竴鍙?#28051;?#37832;虹紪璇戠殑鍜屽垎?#31479;寮忕紪璇戠殑锛屾病鏈?#28000;涔?#28598;?#28598;х殑宸?#37714;?#38171;屾?#22249;紪绋?#37832;?#28051;?#37722;?#38171;?#28003;?#37716;熻兘?#31476;鑷?#37510;?br style="word-wrap: break-word;" /><br style="word-wrap: break-word;" />椤圭洰?#31912;鏉熷悗?#22172;宸?#37916;╃殑涓?#29783;?#38171;岃?#30028;劧娌?#37832;?#37922;?#27996;庡疄闄呮潵鎻?#26946;?#37825;堢巼锛?#28003;?#26473;?#37828;?#28699;?#37714;?#27996;嗕竴浜?#28051;?#29783;?#37510;?/compiler></span></div><em><br /><br /><br /></em></pre><img src ="http://www.2676208.com/markqian86/aggbug/215912.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.2676208.com/markqian86/" target="_blank">闀挎垷鍗佷笁鍗?/a> 2018-09-08 20:56 <a href="http://www.2676208.com/markqian86/archive/2018/09/08/215912.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;勮</a></div>]]></description></item><item><title>Gperftools涓璽cmalloc?#27537;绠浠嬪拰浣?#37922;?鍐?#28699;?#23049;勯湶http://www.2676208.com/markqian86/archive/2018/08/24/215870.html闀挎垷鍗佷笁鍗?/dc:creator>闀挎垷鍗佷笁鍗?/author>Fri, 24 Aug 2018 03:22:00 GMThttp://www.2676208.com/markqian86/archive/2018/08/24/215870.htmlhttp://www.2676208.com/markqian86/comments/215870.htmlhttp://www.2676208.com/markqian86/archive/2018/08/24/215870.html#Feedback0http://www.2676208.com/markqian86/comments/commentRss/215870.htmlhttp://www.2676208.com/markqian86/services/trackbacks/215870.htmlTcMalloc锛圱hread-CachingMalloc锛?#37828;痝oogle-perftools?#20240;鍏?#28051;殑?#31476;涓?#37712;?#28699;?#32480;?#37918;嗗簱锛?#28051;庢爣鍑嗙殑glibc?#31793;涓璵alloc鐩?#23011;?#38171;孴cMalloc鍦?#37712;?#28699;樺垎閰嶇殑鏁堢巼鍜岄熷害涓?#29781;?#26946;?#23536;?#28598;?#38171;屽彲?#20114;鎻?#37719;?#26946;?#39582;?#37721;戞儏鍐?#28051;嬬殑鎬ц兘锛岄檷浣?#32495;荤粺鐨勮?#29115;浇銆?/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;═cMalloc?#20751;鍐?#28051;嬪彲?#20114;涓嶇紪璇?#37711;?#28000;栦笁涓?#32513;?#28000;?#37510;?/pre>
?#25950;锛?#28003;?#37922;?#32510;跨▼鍐?#28699;樻?#29365;殑鏂规硶锛屽湪灏忓?#30789;薄鏄?#37734;?#37712;?#28699;樻睜涓繘琛屽垎閰?#38171;?#28003;?#37922;ㄥ垎閰嶈緝澶氱殑鍐?#28699;?#32460;洪棿鏉ヤ紭鍖栧垎閰嶆椂?#26879;銆?/pre>
?#30084;鐜?#37720;熺悊璇峰弬鑰?#32515;戝潃http://goog-perftools.sourceforge.net/doc/tcmalloc.html銆?/pre>

绠浠?/h1>
TcMalloc鏄竴涓?#37922;盙oogle寮鍙戠殑锛屾瘮glibc?#27537;malloc?#27967;蹇殑鍐?#28699;?#32480;?#37918;嗗簱銆?#38315;氬?#21578;儏鍐?#28051;媝tmalloc2?#20824;鍦?00ns鎵?#29723;屼竴涓猰alloc?#25328;free瀵?#38171;岃孴cMalloc?#20824;鍦?0ns鍐呮墽琛屼竴涓猰alloc?#25328;free瀵?#37510;?/pre>
TcMalloc鍙互鍑忓?#25117;?#27697;?#36328;▼绋嬪簭涔嬮棿?#27537;閿佷簤鐢?#38338;?#26864;?#38171;屽湪灏忓?#30789;薄涓婅兘杈?#37714;?#38342;朵簤鐢?#37510;?/pre>
TcMalloc涓?#23011;?#28051;?#32510;跨▼鍗?#37913;垎閰嶄竴涓?#32510;跨▼鏈?#37734;扮殑Cache锛屽皯閲忕殑鍦板潃?#22414;閰嶅氨鐩存帴浠嶤ache涓垎閰?#38171;屽苟涓?#28729;?#37832;熷?#27692;瀮鍦?#37733;炴敹锛屽?#21977;?#36328;▼鏈?#37734;癈ache涓殑绌?#38338;?#37712;?#28699;樿繑鍥?#32513;?#37711;?#28766;鎺?#37714;跺爢銆?/pre>
TcMalloc璁?#28051;哄皬浜?#38171;?lt;=锛?2K涓哄?#24531;?#30789;薄锛屽ぇ瀵硅薄鐩存帴浠?#37711;?#28766;鎺?#37714;跺爢涓婁互椤?#38171;?K锛?#28051;?#37719;?#28003;嶈繘琛屽垎閰?#38171;?#28052;熷氨鏄?#29831;?#28598;?#28725;硅薄鎬?#37828;?#26916;?#28725;?#27067;愮殑銆?/pre>
TcMalloc涓竴涓?#26916;?#37721;互瀛?#37711;ヤ竴浜?#37929;?#37722;屽ぇ灏忕殑灏忓?#30789;薄锛屽?#24531;?#30789;薄浠?#37832;?#37734;?#37712;?#28699;?#38334;?#29723;?#28051;垎閰?#38171;屽ぇ瀵硅薄浠?#28051;?#36423;?#37712;?#28699;樺爢涓垎閰?#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;璇?#37716;?#37804;佸簱
# cd gperftools-2.0
# ./ configure  --disable-cpu-profiler --disable-heap-profiler--disable-heap-checker 
--disable-debugalloc--enable-minimal
鍔?#37711;?#28051;婇潰?#27537;?#24364;鏁?#37828;?#28051;?#27996;?#37721;?#37922;?#37812;恡cmalloc_minimal鍔?#37804;佸簱锛屽鏋滈渶瑕佹墍鏈夌粍浠?#38171;屽懡浠?#28641;?#28051;?#38171;?/pre>
# ./configure
# ./configure -h           鐢?#27996;庢煡鐪嬬紪璇戦?#26916;?#37510;?/pre>
?#32042;璇戝?#23677;?#22798;锛?/pre>
# make&& make install
浣?#37922;?#37832;灏忓?#22798;?#21614;椂鎶妕cmalloc_minimal?#27537;鍔?#37804;佸?#25780;?#30127;礉鍒?#32495;荤粺?#27952;褰?#28051;?#38171;?/pre>
# cplib/tcmalloc_minimal.so.0.0.0 /usr/local/lib
鍒涘缓?#33931;杩炴帴鎸?#37722;憈cmalloc锛?/pre>
# ls –s /usr/local/lib/libtcmalloc_minimal.so.0.0.0/usr/local/lib/libtcmalloc.so
鍚?#37716;?#32459;嬪簭涔嬪墠锛岄鍏?#37716;犺浇tcmalloc鍔?#37804;佸簱?#27537;?#24134;澧?#37721;?#38322;?#29825;剧疆锛?/pre>
# exportLD_PRELOAD=”/usr/local/lib/libtcmalloc.so
浣?#37922;╨osf妫鏌?#32459;嬪簭鏄?#37722;?#23480;?#32513;?#37716;犺浇tcmalloc?#31793;锛?/pre>
# lsof -n | greptcmalloc
鍦↙inux涓嬩娇鐢ㄧ殑tcmalloc瀹夎瀹屾垚锛屽湪Windows涓嬩娇鐢╒S锛?003?#20114;涓?#37911;?#37832;?#38171;?#37813;?#23534;?#20240;绋?#26916;圭洰gperftools.sln?#32344;琛岀紪璇?#37510;?/pre>

浣?#37922;?/h1>
灏唋ibtcmalloc.so/libtcmalloc.a閾炬帴鍒?#32459;嬪簭涓?#38171;屾?#26668;?#29825;剧疆LD_PRELOAD=libtcmalloc.so銆?#26473;?#37837;峰氨鍙互浣?#37922;╰cmalloc?#31793;涓殑鍑?#37825;版?#25358;崲鎺夋搷浣?#32495;荤粺?#27537;malloc銆乫ree銆乺ealloc銆乻trdup鍐?#28699;?#32480;$悊鍑?#37825;?#37510;?#37721;互璁剧疆?#24134;澧?#37721;?#38322;?#29825;剧疆濡?#28051;?#38171;?/pre>
         TCMALLOC_DEBUG=<level>       ?#30367;璇曠骇鍒?#38171;屽?#26663;?#28051;?-2
         MALLOCSTATS=<level>                    璁剧疆鏄剧ず鍐?#28699;?#28003;?#37922;?#37912;?#37804;佺骇鍒?#38171;屽?#26663;?#28051;?-2
         HEAPPROFILE=<pre>                     鎸?#28729;氬唴瀛?#23049;勯湶妫鏌ョ殑鏁?#37817;?#28725;?#37713;?#37826;?#28000;?/pre>
         HEAPCHECK=<type>                        鍫?#22955;鏌?#32491;诲瀷锛宼ype=normal/strict/draconian
TcMalloc?#31793;杩?#37721;互?#32344;琛?#37712;?#28699;?#23049;勯?#33580;殑妫鏌?#38171;?#28003;?#37922;?#26473;?#28051;?#37716;熻兘鏈?#28051;?#32457;?#37826;规硶锛?/pre>
1锛夊皢tcmalloc?#31793;閾炬帴鍒?#32459;嬪簭涓?#38171;屾敞鎰忓簲璇?#28751;唗cmalloc?#31793;鏈?#24727;閾炬帴鍒?#32459;嬪簭涓?#38171;?/pre>
2锛?#29825;剧疆LD_PRELOAD=”libtcmalloc.so”/HEAPCHECK=normal锛?#26473;?#37837;峰氨涓嶉渶?#22136;鏂扮紪璇戠?#23338;簭
鎵?#23534;妫鏌?#37716;熻兘锛屾湁涓?#32457;?#37826;?#23534;?#37721;互寮鍚?#23049;勯湶妫鏌?#37716;熻兘锛?/pre>
1锛?nbsp; 浣?#37922;ㄧ幆澧?#37721;?#38322;?#38171;屽鏁?#28051;?#32459;嬪簭?#32344;琛屾鏌?#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>
?#30367;鐢╟hecker?#32531;绔嬩竴涓?#37712;?#28699;?#36423;?#37907;?#38171;屽湪?#30367;鐢╟hecker.NoLeaks?#32531;绔嬪彟?#31476;涓?#36423;?#37907;?#38171;?#37906;跺悗?#32344;琛屾?#26055;緝锛屽鏋?#37712;?#28699;?#37832;夊闀挎?#26668;?#28000;绘剰鍙?#37718;?#38171;孨oLeaks鍑?#37825;拌繑鍥瀎alse锛屽?#24816;緭鍑轰竴涓?#28103;℃伅鍛?#29831;?#28003;犲浣?#28003;?#37922;╬prof?#20240;鍏?#37833;ュ垎鏋?#37711;?#28003;撶殑鍐?#28699;?#23049;勯湶銆?/pre>
    鎵?#29723;?#37712;?#28699;樻鏌?
         #LD_PRELOAD=libtcmalloc.so HEAPCHECK=strict HEAPPROFILE=memtm ./a.out
鎵?#29723;屽?#23678;?#24876;悗?#32048;杈?#37713;烘鏌ョ殑?#31912;鏋?#38171;屽鏋?#37832;?#23049;勯湶锛宲prof?#32048;杈?#37713;?#23049;勯湶澶氬皯涓?#28699;楄妭锛屾湁澶氬?#25118;?#22414;閰?#38171;?#28052;熶細杈?#37713;?#29831;?#32513;嗙殑鍒?#29723;?#37816;?#37713;?#37734;?#28000;涔?#37734;?#37826;瑰垎閰嶅?#23677;垎閰嶅?#27692;?#25118;銆?/pre>
         姣旇緝涓?#28051;?#36423;?#37907;?#38171;?/pre>
         #pprof --base=profile.0001.heap 绋嬪簭鍚?profile.0002.heap
    宸茬煡鍐?#28699;?#23049;勬?#24532;椂锛屽叧闂?#37712;?#28699;?#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;芥鏌?#37825;?#32513;?#37714;?#38340;ょ殑鍐?#28699;?#23049;勯湶锛屾瘮濡?#38171;歝har *str = new char[100]; delete str;銆?br />

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

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

64浣嶆搷浣?#32495;荤粺?#31476;瀹?#29781;佸厛瑁卨ibunwind杩?#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;甋AMBA鎻愮ず娌?#37832;?#37833;?#38340;?/title><link>http://www.2676208.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.2676208.com/markqian86/archive/2018/08/16/215850.html</guid><wfw:comment>http://www.2676208.com/markqian86/comments/215850.html</wfw:comment><comments>http://www.2676208.com/markqian86/archive/2018/08/16/215850.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.2676208.com/markqian86/comments/commentRss/215850.html</wfw:commentRss><trackback:ping>http://www.2676208.com/markqian86/services/trackbacks/215850.html</trackback:ping><description><![CDATA[<p style="margin-top: 10px; margin-bottom: 10px;">LINUX samba閰嶇疆鍏?#27996;?#37826;?#28000;剁洰褰?/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;╮pm -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;">?#22346;鍔爏mb璁?#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.?#22136;鍚痵ervice smb restart</p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">4.濡?#37835;渨indows涓嬬?#35826;綍samba鏈?#37716;?#37731;ㄥ悗鏃犳硶璁?#38338;甽inux涓嬪叡浜洰褰?#38171;屾?#24878;ず娌?#37832;?#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;"> </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;栬呮槸寮鏀?#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鏈?#37716;?#37731;?#38320;嶇疆鏂?#28000;秙mb.conf璁剧疆娌?#37832;夐棶棰?#38171;屽彲缃?#28051;?#37836;ラ槄璧?#37826;欑湅閰嶇疆鍔炴硶  </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">c銆佺‘淇漵etlinux鍏?#38338;?#38171;屽彲?#20114;鐢╯etenforce 0鍛?#28000;?#37813;?#29723;?#37510;?榛樿?#27537;锛孲ELinux绂佹缃戠粶涓婂?#31565;amba鏈?#37716;?#37731;?#28051;婄殑鍏?#27996;洰褰曡繘琛?#37712;欐搷浣?#38171;?#37719;?#28003;?#28003;?#37734;╯mb.conf涓?#37711;?#29825;?#27996;?#26473;?#26916;规搷浣?#37510;?      /usr/bin/setenforce 淇敼SELinux?#27537;瀹炴?#24816;繍琛屾ā寮? </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">setenforce 1 璁剧疆SELinux 鎴?#28051;篹nforcing妯?#23534;?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">setenforce 0 璁剧疆SELinux 鎴?#28051;簆ermissive妯?#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;剧疆?#24364;鏁皊elinux=0 锛屾?#26668;?#37734;?etc/grub.conf涓坊鍔?#26473;?#28051;弬鏁?/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.2676208.com/markqian86/aggbug/215850.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.2676208.com/markqian86/" target="_blank">闀挎垷鍗佷笁鍗?/a> 2018-08-16 17:09 <a href="http://www.2676208.com/markqian86/archive/2018/08/16/215850.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;勮</a></div>]]></description></item><item><title>google寮婧愮殑C++鎬ц兘?#22414;鏋愬伐鍏?- gperftoolshttp://www.2676208.com/markqian86/archive/2018/07/13/215779.html闀挎垷鍗佷笁鍗?/dc:creator>闀挎垷鍗佷笁鍗?/author>Fri, 13 Jul 2018 05:47:00 GMThttp://www.2676208.com/markqian86/archive/2018/07/13/215779.htmlhttp://www.2676208.com/markqian86/comments/215779.htmlhttp://www.2676208.com/markqian86/archive/2018/07/13/215779.html#Feedback0http://www.2676208.com/markqian86/comments/commentRss/215779.htmlhttp://www.2676208.com/markqian86/services/trackbacks/215779.html

gperftools鏄疓oogle鎻愪?#28058;殑?#31476;濂楀伐鍏?#38171;屽叾涓殑?#31476;涓?#37716;熻兘鏄疌PU profiler锛?#37922;?#27996;庡垎鏋?#32459;嬪簭鎬ц兘锛屾壘鍒?#32459;嬪?#24533;殑鎬ц兘鐡堕銆?nbsp;
Graphviz鏄竴涓?#37922;盇T&T?#30084;楠屽鍚?#37716;ㄧ殑寮婧愬伐鍏?#37718;?#38171;?#37922;?#27996;庣粯鍒禗OT璇█鑴?#37832;?#37819;?#26473;扮殑鍥?#35120;?#38171;実perftools渚濋?#29363;?#20240;鍏?#37922;?#37812;?#37733;?#35120;㈠垎鏋愮粨鏋?#37510;?nbsp;
瀹夎?#21613;懡浠?#38171;歽um install graphviz 
?#32042;璇慻oogle-perftools 
?#27932;涓?#37812;?#28000;?#37721;渶瑕乼cmalloc鍔熻兘锛屽洜姝?#28051;嶇紪璇慻oogle-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;?#37826;?#28000;?/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鏂?#28000;?#37722;?/span>    func3();    ProfilerStop(); // ?#31912;鏉焢rofiling    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

鐒跺悗?#32042;璇戦?#28844;帴杩?#29723;?#38171;?#28003;?#37922;╬prof鐢?#37812;愬垎鏋愮粨鏋?nbsp;
g++-o demo demo.cpp -lprofiler 
杩?#29723;宒emo锛?#37922;?#37812;恗y.prof鏂?#28000;?#38171;?#37906;跺悗鐢╬prof鍛?#28000;?#28725;?#29831;?#37826;?#28000;?#29785;?#37835;?#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;?#37712;?#37733;?#37911;囨弿杩? title=
鍥?#35120;?#26891;庢牸?#27537;?#31912;鏋?#37922;?#38010;傜偣鍜屾湁鍚戣?#22317;?#21228;垚锛?nbsp;
姣?#28051;?#38010;傜偣浠?#29723;ㄤ竴涓?#37713;?#37825;?#38171;岃?#20636;偣鏁?#37817;?#37837;?#23534;?#38171;?nbsp;
Class Name 
Method Name 
local (percentage) 
of cumulative (percentage) 
local?#26882;?#26879;鏄?#37713;?#37825;?#37929;存帴鎵?#29723;岀殑鎸?#28000;?#37813;娑堣楃殑CPU?#26882;?#26879;锛堝?#21614;嫭鍐呰仈鍑?#37825;?#38171;?#37510;?#37804;ц兘?#22414;鏋?#38315;?#26473;囨?#33445;牱鏂规硶瀹屾垚锛岄?#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;?#37825;拌皟鐢ㄧ殑鎬诲拰锛?#28641;?#37835;渃umulative?#26882;?#26879;涓巐ocal?#26882;?#26879;鐩?#37722;?#38171;屽垯涓嶆墦鍗癱umulative?#26882;?#26879;椤?#37510;?nbsp;
鏈?#37722;戣竟锛氳皟鐢?#38000;呮寚鍚戣?#30367;鐢?#38000;?#38171;屾湁鍚戣竟涓婄殑?#26882;?#26879;琛?#32448;?#29722;皟鐢?#38000;呮墍娑堣楃殑CPU?#26882;?#26879;

濡?#37835;?#37922;?#37812;恜df?#26882;鎶?#38335;?#38171;歱s2pdf 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>

鏂?#37832;?#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;?#37825;?#38322;?#38171;?#28051;嶅寘鍚?#37711;?#28000;?#37713;?#37825;拌皟鐢?#38171;?nbsp;
?#22414;鏋?#37837;?#37832;?#37927;惧垎姣?#38171;?#28051;嶅寘鍚?#37711;?#28000;?#37713;?#37825;拌皟鐢?#38171;?nbsp;
?#27952;?#22688;涓烘?#27537;?#22414;鏋?#37837;?#37832;?#37927;惧垎姣?#38171;?#28051;嶅寘鍚?#37711;?#28000;?#37713;?#37825;拌皟鐢?#38171;?nbsp;
?#22414;鏋?#37837;?#37832;?#37825;?#38322;?#38171;堝寘鍚?#37711;?#28000;?#37713;?#37825;拌皟鐢?#38171;?nbsp;
?#22414;鏋?#37837;?#37832;?#37927;惧垎姣?#38171;堝寘鍚?#37711;?#28000;?#37713;?#37825;拌皟鐢?#38171;?nbsp;
鍑?#37825;?#37722;?/p>

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

gperftools?#28214;瑕佺?#23338;簭姝?#29999;?#38315;鍑?#37813;嶈兘鍚憄rof鏂?#28000;?#37813;?#37719;?#37825;?#37817;?#38171;屾墍?#20114;褰?#32459;嬪簭鏃犳硶閫鍑烘椂锛屽緱瑕佸?#25126;佷俊鍙?#32513;欒繘绋?#38171;屽湪?#24116;鍒?#28103;?#37721;峰悗锛岃皟鐢≒rofilerStop();鍑?#37825;?#38171;屾墠鑳芥墦鍗?#37713;?#37825;?#37817;?#37510;傚涓?#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閲岃皟鐢╧ill缂虹渷璇ヨ繘绋?#37510;?#29831;?#28103;?#37721;?#37721;互琚?#38339;诲锛屾?#26668;澶勭悊              //鍙互鍦?#26473;?#38322;屽仛?#31476;浜?#32459;嬪簭閫鍑哄?#23943;殑鏈?#24727;澶勭?#21975;伐浣?/span>              ProfilerStop();              INFO_LOG("Process recieve SIGTERM");              break;           }     exit(0); } //涓?#37713;?#37825;?/span> signal(SIGTERM, &signal_handler);
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

鐢╲algrind?#27537;callgrind?#20240;鍏?#28052;?#37721;互?#32344;琛屽垎鏋?#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鐧诲?#26334;悗鍑?#37916;?bash-4.1$锛?#29785;e喅鍔炴硶?#20114;鍙婇?#37812;?#26473;?#37837;风殑鍘熷洜http://www.2676208.com/markqian86/archive/2018/07/06/215764.html闀挎垷鍗佷笁鍗?/dc:creator>闀挎垷鍗佷笁鍗?/author>Fri, 06 Jul 2018 12:00:00 GMThttp://www.2676208.com/markqian86/archive/2018/07/06/215764.htmlhttp://www.2676208.com/markqian86/comments/215764.htmlhttp://www.2676208.com/markqian86/archive/2018/07/06/215764.html#Feedback0http://www.2676208.com/markqian86/comments/commentRss/215764.htmlhttp://www.2676208.com/markqian86/services/trackbacks/215764.html

linux鐧诲?#26334;悗鏈?#37827;跺欎?#27692;嚭鐜?bash-4.1$

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

瑙e喅鍔炴硶锛?/span>

##棣?#37711;?#37714;?#37817;?#37714;?#37825;呴殰鐢ㄦ埛 su - test ##澶嶅?#36346;?#29808;簲?#27537;鏂?#28000;?#38171;?#28051;嶈?#20346;敤root鐩存帴澶嶅埗锛屽惁鍒?#28598;嶅?#24816;繃鍘荤殑涓?#29783;?#28766;?#28051;?#38171;屾暟缁勯兘鏄痳oot?#27537;锛?-bash-4.1$ cp /etc/skel/.bash*  ~  ##(/etc/skel 鏂?#37922;?#37812;疯佸?#21057;殑鏍?#28699;?#38171;屾墍?#20114;浠?#26473;?#38322;屽?#23941;埗) -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;╞acktrace杩借釜鍑?#37825;拌皟鐢ㄧ殑鍫?#37837;?/title><link>http://www.2676208.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.2676208.com/markqian86/archive/2018/06/29/215755.html</guid><wfw:comment>http://www.2676208.com/markqian86/comments/215755.html</wfw:comment><comments>http://www.2676208.com/markqian86/archive/2018/06/29/215755.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.2676208.com/markqian86/comments/commentRss/215755.html</wfw:commentRss><trackback:ping>http://www.2676208.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;熺?#23338;嚱鏁拌繍琛屾?#36346;爢鏍堢殑鏂规硶鏄?#28003;?#37922;℅DB涔?#32491;荤殑澶?#38318;ㄨ皟璇?#37731;?浣?#37828;?鏈?#27996;?#37827;跺?#28051;?#27996;嗗垎鏋?#32459;嬪?#24533;殑BUG,(涓昏閽堝闀挎椂?#26879;杩?#29723;?#32459;嬪?#24533;殑?#22414;鏋?,鍦?#32459;嬪簭鍑?#38335;欐椂鎵?#37719;?#37713;?#37713;?#37825;?#37928;勮皟鐢?#37739;?#37837;?#37828;潪甯?#37832;?#37922;ㄧ殑銆?/span><br /><br /><span style="font-size: medium;">鍦?#28598;?#37826;?#28000;?execinfo.h"涓0鏄?#27996;嗕笁涓?#37713;?#37825;?#37922;?#27996;?#38014;?#37721;?#35120;撳?#23943;?#36328;?#23340;殑鍑?#37825;拌皟鐢?#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;?#37825;?#37922;?#28051;?#38014;?#37721;?#35120;撳?#23943;?#36328;?#23340;?#21230;皟鐢?#37739;?#37837;?鑾?#37721;栫殑淇℃伅灏嗕細琚?#28699;?#37824;?#37734;╞uffer涓?瀹?#37828;竴涓?#37816;?#38333;?#37714;?#29723;?#37510;傚弬鏁?size 鐢?#37833;?#37816;?#28729;歜uffer涓?#37721;互淇?#28699;?#28598;氬皯涓獀oid* 鍏冪?#29358;?#37713;?#37825;拌繑鍥炲?#37828;疄闄呰幏鍙栫殑鎸?#38333;?#28051;?#37825;?鏈澶?#28051;嶈?#21616;繃size澶?#28751;?/span>锛?span style="font-size: medium;">鍦╞uffer涓殑鎸?#38333;堝疄闄呮槸浠庡爢鏍?#28051;?#38014;?#37721;?#37928;勮繑鍥?#37734;板潃,姣忎竴涓?#37739;?#37837;堟鏋?#37832;変竴涓?#26473;?#37733;?#37734;板潃锛?/span><span style="font-size: medium;">?#25950;?#21104;鏌?#27996;涚紪璇?#37731;ㄧ殑?#32045;鍖栭?#26916;?#28725;硅幏鍙栨纭?#37928;勮皟鐢?#37739;?#37837;?#37832;?#39582;?#37813;?鍙?#28598;?#37712;呰仈鍑?#37825;版病鏈夊爢鏍堟鏋?鍒?#38340;?#22935;?#37835;舵寚閽?#28052;熶細浣挎?#29363;硶姝?#32429;?#29785;?#37835;愬爢鏍?#37712;?#28729;?#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鍑?#37825;拌幏鍙栫殑淇℃伅杞?#37718;?#28051;轰竴涓?#28699;楃涓?#37825;?#32513;? ?#24364;鏁癰uffer?#31794;璇?#37828;?#28000;巄acktrace鍑?#37825;拌幏鍙栫殑鏁?#32513;勬寚閽?size鏄?#29831;?#37825;?#32513;?#28051;殑鍏冪礌涓?#37825;?backtrace鐨勮繑鍥炲?銆?/span><span style="font-size: medium;">鍑?#37825;拌繑鍥炲?#37828;竴涓?#37816;?#37722;戝?#26947;涓?#37825;?#32513;勭殑鎸?#38333;?瀹冪殑澶?#28751;?#37722;宐uffer鐩?#37722;?姣?#28051;?#28699;楃涓?#37718;?#37722;?#27996;嗕竴涓?#37929;稿浜巄uffer涓?#28725;瑰簲鍏冪?#29365;殑鍙?#37813;?#37719;?#28103;℃伅.瀹?#37718;呮嫭鍑?#37825;?#37722;?#38171;屽嚱鏁扮殑鍋忕Щ鍦板潃,鍜屽疄闄?#37928;勮繑鍥?#37734;板潃銆?/span><br /><span style="font-size: medium;">鐜?#37734;?鍙?#37832;?#28003;?#37922;‥LF浜岃繘鍒舵牸寮忕殑绋嬪?#24531;拰?#23268;琛?#37813;嶈兘鑾?#37721;?#37713;?#37825;?#37722;嶇О鍜屽?#24533;Щ鍦板潃.鍦?#37711;?#28000;?#32495;荤粺,鍙?#37832;?6?#32344;鍒?#37928;勮繑鍥?#37734;板潃?#20824;琚?#38014;?#37721;?鍙?#28598;?浣?#37721;兘?#28214;瑕佷紶閫?#37929;稿簲?#27537;?#29219;蹇?#32513;?#38334;炬帴鍣??#20114;鑳芥敮鎸佸嚱鏁?#37722;?#37716;熻兘(姣?#28641;?鍦?#28003;?#37922;℅NU ld?#27537;绯荤粺涓?浣犻渶瑕佷紶閫?/span><span style="font-size: medium;">(-rdynamic))銆?br />璇?#37713;?#37825;?#37928;勮繑鍥炲?#37828;?#38315;?#26473;噈alloc鍑?#37825;?#37922;?#29831;风殑绌洪棿,?#27932;姝よ皟鐢?#26473;?#36423;?#26916;?#28003;?#37922;╢ree鍑?#37825;版潵閲?#37824;炬寚閽?/span><span style="font-size: medium;">.<br />?#25950;?#21104;:濡?#37835;?#28051;嶈兘涓哄?#26947;涓?#38014;?#37721;栬凍澶熺殑绌洪棿鍑?#37825;?#37928;勮繑鍥炲?#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 鍑?#37825;?#37711;?#37832;?#37929;?#37722;岀殑鍔熻兘,涓?#37722;岀殑鏄?#28729;?#28051;嶄細缁欒皟鐢?#38000;呰繑鍥?#28699;楃涓?#37825;?#32513;?鑰屾槸灏嗙粨鏋?#37712;?#37711;?#37826;?#28000;舵弿杩扮涓篺d?#27537;鏂?#28000;?#28051;?姣?#28051;?#37713;?#37825;板?#29808;簲?#31476;琛?瀹?#28051;嶉渶瑕佽皟鐢╩alloc鍑?#37825;??#27932;姝?#38315;?#37922;?#27996;?#37832;?#37721;兘?#30367;鐢?#29831;?#37713;?#37825;颁?#27692;け璐ョ殑?#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;╞acktrace鎹曡幏寮?#29999;?#39582;?#37813;?#37719;?#37713;?#37825;拌皟鐢?#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="澶嶅埗浠?#37934;? style="color: #1d58d1; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="澶嶅埗浠?#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;栬繘绋嬬殑瀹屾暣璺緞</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;?#37712;?#28699;?#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="澶嶅埗浠?#37934;? style="color: #1d58d1; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="澶嶅埗浠?#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="澶嶅埗浠?#37934;? style="color: #1d58d1; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="澶嶅埗浠?#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.2676208.com/markqian86/aggbug/215755.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.2676208.com/markqian86/" target="_blank">闀挎垷鍗佷笁鍗?/a> 2018-06-29 17:03 <a href="http://www.2676208.com/markqian86/archive/2018/06/29/215755.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;勮</a></div>]]></description></item><item><title>linux screen 鍛?#28000;?#29831;?#29785;?/title><link>http://www.2676208.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.2676208.com/markqian86/archive/2018/06/28/215751.html</guid><wfw:comment>http://www.2676208.com/markqian86/comments/215751.html</wfw:comment><comments>http://www.2676208.com/markqian86/archive/2018/06/28/215751.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.2676208.com/markqian86/comments/commentRss/215751.html</wfw:commentRss><trackback:ping>http://www.2676208.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 鏈?#37716;?#37731;?#38171;?#32513;忓父杩?#29723;屼竴浜涢渶瑕佸緢闀挎椂?#26879;鎵嶈兘瀹屾?#24878;殑浠?#37716;?#38171;屾瘮濡?#32495;荤粺澶?#28000;?#37510;乫tp 浼?#26440;?#32475;?#32475;?#37510;?#38315;氬?#21578;儏鍐?#28051;?#37812;?#28000;兘鏄?#28051;?#23011;忎竴涓?#26473;?#37837;风殑浠?#37716;?#23534;?#31476;涓?#26473;?#32459;嬬粓绔獥鍙?#38171;屽洜涓?#28729;?#28000;?#37813;?#29723;岀殑?#26882;?#26879;澶?#38336;?#27996;?#37510;傚繀椤荤?#22794;緟瀹?#28000;?#37813;?#29723;屽?#23678;瘯锛屽湪姝?#37832;熼棿涓嶈兘鍏虫?#22796;獥鍙?#37812;栬呮柇寮杩炴帴锛屽惁鍒?#26473;?#28051;?#28000;?#37716;″氨?#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;">鍒?#37817;㈢殑</span>?#22172;鐢辫蒋浠?span style="margin: 0px; padding: 0px; line-height: 1.8;">銆?#37922;ㄦ埛鍙互閫?#26473;?#29831;ヨ蒋浠?#37722;屾?#24816;?#28852;帴澶?#28051;?#37832;?#37734;版垨杩?#32459;嬬殑鍛?#28000;?#29723;?/span>?#32048;璇?span style="margin: 0px; padding: 0px; line-height: 1.8;">锛屽苟鍦?#37711;堕棿?#22172;鐢?#37714;?#37817;?#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;">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鏈韩娌?#37832;夌?#22559;锛屽湪鍏?#37712;?#38318;?#26473;?#29723;岀殑?#32048;璇濋兘鍙互鎭?#28598;?#37510;?#26473;欎竴鐐?#28725;?#27996;?#26473;?#32459;嬬?#35826;?#26336;殑鐢ㄦ埛鐗?#37714;?#37832;?#37922;?#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;嶄細璇?#37928;勮繍琛?#37510;?#37722;屾牱鍦?#37830;傛椂绂诲紑?#27537;鏃跺?#38171;?#28052;?#37721;互鎵?#29723;屽垎绂诲懡浠?strong style="margin: 0px; padding: 0px;">detach</strong>锛屽湪淇?#29831;?#38322;岄潰?#27537;绋嬪簭姝?#29999;?#26473;?#29723;岀殑?#20751;鍐?#28051;?#29825;㏒creen鎸?#29863;?#38171;?#37714;?#37817;?#37714;板悗鍙?#38171;?#37510;?#26473;欎竴鐐?#37724;屽浘褰?#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;">鍦⊿creen?#24134;澧?#28051;?#38171;屾墍鏈夌殑?#32048;璇濋兘鐙?#32468;嬬?#21230;繍琛?#38171;屽苟鎷?#37832;?#37722;勮嚜?#27537;?#32042;鍙?#37510;?#26440;?#37711;?#37510;?#26440;?#37713;哄拰?#29541;鍙?#32514;撳瓨銆?#37922;ㄦ埛鍙互閫?#26473;囧揩鎹?#38335;?#37734;?#28051;?#37722;岀殑?#29541;鍙?#28051;嬪垏鎹?#38171;屽苟鍙互?#22172;鐢辩殑?#22136;瀹氬悜鍚?#28051;獥鍙?#37928;勮緭鍏ュ拰杈?#37713;?#37510;係creen?#30084;鐜?#27996;嗗熀鏈殑鏂?#37832;?#37823;?#28003;?#38171;屽澶嶅?#21057;?#27199;创绛?#38171;?#26473;樻?#24874;緵浜?#32491;?#28028;兼?#27692;姩鏉$殑鍔熻兘锛屽彲?#20114;鏌?#37930;嬬獥鍙?#37912;?#37712;电殑鍘?#37721;?#29825;板綍銆傜獥鍙?#26473;?#37721;互琚垎鍖?#37724;屽懡鍚?#38171;?#26473;?#37721;互鐩?#29785;嗗悗鍙扮獥鍙g殑娲?#37716;?#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;">?#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;?#37722;?#32513;?#32468;?#28598;?#23046;?#37927;诲?#26330;竴涓細璇?#38171;屽苟鍏?#27996;細璇濈殑鎵鏈?#37911;?#37804;?#38171;?#23011;?#28641;?#37721;互鐪嬪埌瀹屽叏鐩?#37722;?#37928;勮緭鍑?#38171;?#37510;?#28729;?#37722;屾椂鎻愪緵浜嗙獥鍙?#29825;?#38338;?#37833;?#38340;愮殑鏈?#37714;?#38171;屽彲?#20114;瀵圭獥鍙h繘琛屽?#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 瀹?#37826;?#32468;欑偣锛?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;">?#24364;鏁?#29831;?#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;鏈夌殑瑙嗙獥?#20824;?#30367;鏁?#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;殑缂?#37712;?#37718;?#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;嶅己鍒跺缓绔?#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;嶅埌绂荤?#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;洰鍓嶆墍鏈夌殑screen浣?#28051;?#37510;?/span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">-wipe 銆妫鏌ョ洰鍓嶆墍鏈夌殑screen浣?#28051;?#38171;屽苟鍒?#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;佸父鐢╯creen?#24364;鏁?/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;珁ourname?#27537;session</span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">screen -ls -> 鍒?#37713;哄?#25779;?#23942;墍鏈夌殑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;屾墍鏈夊懡浠ら兘?#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;">鏄剧ず鎵鏈夐敭缁?#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;?#37928;勮繍琛宻hell?#27537;?#29541;鍙?#39582;?#37714;?#37817;?#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 -> 鍒?#37817;?#37714;扮 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寰簭鍒?#37817;?#37714;?#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;鍒?#37817;?nbsp;</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 (鍙兘鍚?#37832;夊涓?windows) 涓?#37714;板悗鍙版墽琛?#38171;屽苟浼氬洖鍒拌繕娌¤繘 screen ?#26882;?#27537;鐘?#37804;?#38171;屾?#26882;鍦?screen session 閲?#38171;屾瘡涓?window 鍐呰繍琛岀殑 process (鏃?#29825;?#37828;?#37715;嶅彴/?#24727;鍙??#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;板悗鍙版墽琛?#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;">鏄剧ず鎵鏈夌獥鍙?#37714;?#29723;?/span></span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a t -> Time锛屾?#21095;?#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锛屽己琛屽叧闂?#35120;撳?#23943;殑 window</span><br style="margin: 0px; padding: 0px;" /><span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a [ -> ?#32344;鍏?copy mode锛屽湪 copy mode 涓嬪彲?#20114;鍥炴粴銆佹?#28357;储銆佸?#23941;?#36346;氨?#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;?#29785;?nbsp;</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;">    $ 琛屾湯 </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;嶅線?#24727;绉?nbsp;</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;鍐?#28729;硅创涓?/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鍙?#29723;?#37911;?#38171;?#28186;嬪Red Hat Enterprise Linux锛夐氬父?#32048;?#22172;甯creen?#30084;鐢?#32459;嬪簭锛屽鏋?#23052;?#37832;夌殑璇?#38171;屽彲?#20114;浠嶨NU screen?#27537;瀹?#37826;圭?#25120;珯涓嬭浇銆?/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;">瀹夎瀹屾?#24876;悗锛?#37929;存帴鏁?#37723;?#28000;creen?#27688;鍙互鍚?#37716;?#28729;?#37510;?span style="margin: 0px; padding: 0px; line-height: 1.8;">浣?#37828;?#26473;?#37837;?#37722;?#37716;ㄧ殑screen?#32048;璇?#23052;?#37832;?#37722;嶅瓧锛屽疄璺?#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鍚?#37716;ㄥ悗锛屼?#27692;?#28056;缓绗竴涓獥鍙?#38171;?#28052;熷氨鏄獥鍙o. 0锛屽苟鍦?#37711;?#28051;?#37813;?#23534;?#31476;涓?#32495;荤粺榛樿?#27537;shell锛屼竴鑸兘?#32048;鏄痓ash銆?#37813;?#20114;浣?#37825;?#37711;?#37723;?#28000;creen涔嬪悗锛屼細绔嬪埢鍙?#26473;?#37733;?#37714;板懡浠?#37819;愮?#34425;锛?#28000;?#28003;?#28000;涔?#28052;?#23052;?#37832;?#37721;?#37922;?#28028;肩殑锛屽?#36346;疄浣犲凡缁忚繘鍏creen?#27537;涓栫晫浜?#37510;傚綋?#21159;锛?#28052;?#37721;互鍦╯creen鍛?#28000;?#28052;嬪悗鍔?#37711;?#28003;犲?#28356;?#27537;?#24364;鏁?#38171;?#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;鍗曠獥鍙d細璇?#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;嬬獥鍙e拰?#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;獥鍙e悗锛屽彲?#20114;浣?#37922;?#36423;?#37817;?#38335;瓹-a w鍒?#37713;哄?#25779;?#23942;墍鏈夌獥鍙?#37510;傚鏋?#28003;?#37922;?#37826;?#37832;?#32513;?#32468;?#38171;?#26473;?#28051;?#37714;?#29723;?#28028;氬垪鍦?#28766;?#39582;?#23480;?#28051;?#29785;?#38171;屽鏋?#28003;?#37922;╔?#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;屽叾涓?鍙?#29723;?#32448;哄?#25779;墠浣?#27996;庣獥鍙?锛?鍙?#29723;?#32448;?#28051;婁竴娆?#37714;?#37817;㈢獥鍙f椂浣?#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;?#29723;?#32459;嬪簭鍚嶇殑缁?#37722;?#38171;?#28051;婇潰?#27537;渚嬪瓙涓獥鍙i兘鏄?#27035;樿鍚嶅瓧銆傜粌涔?#27996;?#28051;婇潰鏌?#37930;嬬獥鍙g殑鏂规硶锛?#28003;?#37721;兘?#27688;甯屾湜鍚?#28051;獥鍙?#37721;互鏈?#28051;?#37722;岀殑鍚嶅瓧?#20114;鏂?#28186;?#37718;哄垎浜?#37510;?#37721;互浣?#37922;?#36423;?#37817;?#38335;瓹-a A鏉?#28051;哄?#25779;?#23943;獥鍙i噸鍛?#37722;?#38171;屾寜涓嬪揩鎹?#38335;悗锛孲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;璼creen?#29541;鍙?#28051;?#32459;嬪?#24533;?#21230;繍琛岃屾?#20635;椂鏂?#23534;锛坉etach锛塻creen?#32048;璇?#38171;屽苟鍦?#38341;忓悗?#26882;?#26879;?#22136;鏂拌?#28852;帴锛坅ttach锛?#29831;ヤ細璇?#38171;岄噸鏂版帶鍒?#37722;勭獥鍙?#28051;?#26473;?#29723;岀殑绋嬪簭銆?#28186;嬪锛屾垜浠?#37813;?#23534;?#31476;涓猻creen?#29541;鍙g紪杈?tmp/david.txt鏂?#28000;?#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;偣鍒殑浜嬫儏锛屾瘮濡?#37713;?#37720;?#37825;?#37825;?#23005;?#38171;岄偅涔?#37734;╯creen?#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;creen?#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;">?#22136;鏂拌?#28852;帴?#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;︿竴鍙?#37832;?#37731;?#28051;?#23052;?#37832;夊垎绂讳竴涓猄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;?#37826;扮殑缁?#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;ead ?#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;庢煇绉嶅?#29111;洜鍏?#28051;竴涓細璇?#23005;?#37818;?#27996;?#38171;?#28186;嬪浜?#28051;?#37833;鎺?#29831;ヤ細璇?#38171;?#38171;?#26473;欐椂screen -list?#32048;鏄剧ず璇ヤ細璇?#28051;篸ead鐘?#37804;?#37510;?#28003;?#37922;╯creen -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;?#24727;?#31476;涓?#32459;嬪簭锛?#38315;氬父鏄痓ash锛夊悗锛?#26473;?#28051;獥鍙e氨鍏?#38338;?#27996;?#37510;?#37721;︿竴涓?#37711;?#38338;獥鍙g殑鏂规硶鏄?#28003;?#37922;–-a k锛?#26473;?#28051;?#36423;?#37817;?#38335;?#37833;姝诲?#25779;?#23943;殑?#29541;鍙?#38171;屽?#23678;椂涔熷皢鏉姝?#26473;?#28051;獥鍙?#28051;?#23005;?#37734;?#26473;?#29723;?#37928;勮繘绋?#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;?#24727;?#31476;涓獥鍙?#29722;?#37711;?#38338;?#27996;?#38171;岄偅涔?#37825;?#28051;猄creen?#32048;璇?#28052;熷氨閫鍑?#27996;?#38171;宻creen?#32344;绋嬩細琚?#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;鏈夌獥鍙?#26473;?#32457;?#37826;规硶涔嬪锛?#26473;?#37721;互浣?#37922;?#36423;?#37817;?#38335;瓹-a :锛?#37906;跺悗杈?#37711;uit鍛?#28000;?#38315;鍑篠creen?#32048;璇?#37510;傞渶瑕佹敞鎰忕殑鏄?#38171;?#26473;?#37837;?#38315;鍑轰細鏉姝?#37813;鏈夌獥鍙?#39582;堕鍑?#37711;?#28051;?#26473;?#29723;岀殑鎵鏈?#32459;嬪簭銆?#37711;跺疄C-a :杩?#28051;?#36423;?#37817;?#38335;?#37711;?#29825;?#37922;ㄦ埛鐩存帴杈?#37711;ョ殑鍛?#28000;?#37832;夊緢澶?#38171;屽?#21614;嫭?#22414;灞?#37721;互杈?#37711;plit绛?#38171;?#26473;?#28052;?#37828;疄鐜癝creen鍔熻兘?#27537;?#31476;涓?#38315;斿緞锛?#28051;?#26473;?#28051;?#27996;?#29825;?#28051;?#26473;?#37828;?#36423;?#37817;?#38335;?#23011;旇緝鏂?#28186;?#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;">杩?#37832;変竴绉?#23011;旇緝濂?#37916;╃殑?#32048;璇?#37805;?#28598;?#38171;屽彲?#20114;?#30084;鐜颁細璇?#37711;?#27996;?#37510;傚亣璁?#28003;?#37734;?#37724;屾?#23338;?#23338;湪涓?#37722;屽湴鐐逛互鐩?#37722;?#37922;ㄦ埛鐧诲?#26330;竴鍙?#37832;?#37731;?#38171;?#37906;跺悗浣?#37714;涘缓?#31476;涓猻creen?#32048;璇?#38171;?#28003;?#37832;嬪?#23338;彲?#20114;鍦?#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;嬪?#23340;殑缁?#32468;疉ttach鍒?#28003;犵殑Screen?#32048;璇?#28051;?#38171;屽苟涓?#28003;犵殑缁?#32468;?#28051;嶄細琚獶etach銆?#26473;?#37837;?#28003;犲氨鍙互鍜屾?#23338;?#23338;叡浜?#37722;屼竴涓細璇?#27996;?#38171;屽鏋?#28003;?#28000;?#35120;撳?#23941;張澶?#27996;?#37722;屼竴涓獥鍙?#38171;岄偅?#27688;鐩稿綋浜庡潗鍦?#37722;屼竴涓?#37828;剧ず鍣ㄥ墠?#28528;锛?#28003;犵殑鎿?#28003;滀?#27692;?#23678;婕?#32448;?#32513;?#28003;?#37832;嬪弸锛?#28003;?#37832;嬪?#23340;殑鎿?#28003;?#28052;?#28028;氬?#23678;婕?#32448;?#32513;?#28003;犮傚綋?#21159;锛屽鏋?#28003;?#28000;?#37714;?#37817;?#37714;拌繖涓細璇濈殑涓?#37722;岀獥鍙?#28051;?#37720;?#38171;岄偅杩?#37828;?#37721;互?#22414;鍒繘琛?#28051;?#37722;岀殑鎿?#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;?#24727;锛?#37712;嶈繘琛?#28000;?#28003;?#26440;?#37711;?#28766;?#39582;曢兘涓嶄?#27692;啀鏈?#37721;嶅簲浜?#37510;?#28003;?#37828;?#29781;佹敞?#21104;铏界劧灞?#39582;?#28051;婄?#23337;?#23941;埌鍙嶅簲锛?#28003;?#28003;?#37928;勮緭鍏ラ兘?#32048;琚玈creen涓?#37928;勮繘绋嬫帴鏀?#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;–-a x閿佸畾?#32048;璇?#38171;?#28051;?#37722;岀殑鏄?#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;">鍦⊿creen?#32048;璇?#28052;嬪锛屽彲?#20114;閫?#26473;噑creen鍛?#28000;?#37823;?#28003;滀竴涓猄creen?#32048;璇?#38171;?#26473;?#28052;?#28051;?#28003;?#37922;⊿creen浣?#28051;鸿剼鏈?#32459;嬪?#24531;鍔?#27996;嗕究鍒?#37510;?#37711;?#27996;嶴creen鍦?#38004;?#37832;?#28051;殑?#31794;鐢?#29906;?#37713;?#27996;?#37711;?#38338;?#37928;勮?#20904;洿锛?#26473;?#38322;屽彧鐪嬩竴涓?#28186;嬪瓙锛?#28003;撲細?#31476;涓嬪湪?#32048;璇?#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;屽苟鍦?#37711;?#28051;?#26473;?#29723;宲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;?#37722;屽?#21700;煙鏄剧ず涓?#37722;岀殑Screen?#29541;鍙?#37828;剧劧鏄?#28051;?#23536;?#38320;风殑浜嬫儏銆?#37721;互浣?#37922;?#36423;?#37817;?#38335;瓹-a S灏?#37828;剧ず鍣?#23000;?#39582;冲垎?#22730;锛孲creen 4.00.03鐗?#37832;互?#24727;锛?#28052;?#37824;?#37816;佸瀭鐩村垎灞?#38171;屽揩鎹?#38335;?#37828;疌-a |銆傚垎灞忎互?#24727;锛屽彲?#20114;浣?#37922;–-a <tab>鍦?#37722;?#28051;?#37718;哄?#26949;棿鍒?#37817;?#38171;屾?#24526;竴鍖哄潡涓婇兘鍙互鍒涘缓?#29541;鍙?#39582;?#37734;?#37711;?#28051;?#26473;?#29723;岃繘绋?#37510;?/p><p style="padding: 0px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">鍙互鐢–-a X蹇?#37817;?#38335;?#37711;?#38338;?#35120;撳?#23943;劍鐐?#37813;鍦ㄧ殑灞?#39582;?#37718;哄潡锛?#28052;?#37721;互鐢–-a Q鍏?#38338;?#38340;?#35120;撳?#23941;?#21700;潡涔嬪鍏?#28000;栫殑鎵鏈夊?#21700;潡銆?#37711;?#38338;殑鍖哄潡涓殑?#29541;鍙?#39582;?#28051;嶄?#27692;叧闂?#38171;?#26473;?#37721;互閫?#26473;囩獥鍙?#37714;?#37817;?#37813;?#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;忓?#23678;搷浣?/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;?#37722;岀獥鍙?#28052;嬮棿?#32344;琛屽?#23941;?#21057;?#27199;创浜?#37510;?#28003;?#37922;?#36423;?#37817;?#38335;瓹-a <Esc>鎴栬匔-a [鍙互?#32344;鍏opy/paste妯?#23534;?#38171;?#26473;?#28051;?#22959;?#23534;?#28051;嬪彲?#20114;?#20762;鍦╲i涓竴鏍?#32457;?#37716;?#37711;夋爣锛屽苟鍙互浣?#37922;?#32460;?#37837;?#38335;?#29825;剧疆?#29219;璁?#37510;?#37711;跺疄鍦?#26473;?#28051;?#22959;?#23534;?#28051;?#37832;夊緢澶?#32491;?#28028;紇i?#27537;鎿?#28003;?#38171;岃濡?#28003;?#37922;??#32344;琛屾?#28357;储锛?#28003;?#37922;▂蹇?#38315;熸爣璁颁竴琛?#38171;?#28003;?#37922;╳蹇?#38315;熸爣璁颁竴涓?#37719;?#29831;?#32475;?#37510;?#37711;?#27996;嶤/P妯?#23534;?#28051;嬬殑楂樼骇鎿?#28003;?#38171;屽叾鏂囨。鐨勮?#27406;竴閮ㄥ垎鏈?#23011;旇緝璇?#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;屽彲?#20114;绉?#37716;?#37711;夋爣鍒版寚瀹?#28003;嶇疆锛屾寜涓嬬┖鏍?#29825;剧疆?#31476;涓?#23534;澶存爣璁?#38171;?#37906;跺悗绉?#37716;?#37711;夋爣鍒扮粨灏?#28003;嶇疆锛屾寜涓嬬┖鏍?#29825;剧疆绗?#27996;?#28051;爣璁?#38171;屽?#23678;椂浼氬皢涓?#28051;爣璁?#28052;嬮棿?#27537;閮ㄥ垎?#20557;瀛?#37734;╟opy/paste buffer涓?#38171;屽?#22549;鍑篶opy/paste妯?#23534;?#37510;?#37734;?#23005;?#29999;告ā寮?#28051;?#38171;屽彲?#20114;浣?#37922;?#36423;?#37817;?#38335;瓹-a ]灏嗗偍瀛?#37734;╞uffer涓殑鍐?#28729;圭?#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;">鍚屽ぇ澶?#37825;癠NIX绋嬪簭?#31476;鏍?#38171;孏NU Screen鎻愪緵浜?#28051;板?#23677;己澶х殑瀹氬埗鍔熻兘銆?#28003;?#37721;互鍦⊿creen?#27537;榛樿涓?#32510;?#38320;嶇疆鏂?#28000;?etc/screenrc?#25328;$HOME/.screenrc涓?#37816;?#28729;氭洿澶?#38171;屼?#23338;璁?#28729;歴creen閫?#26916;?#38171;屽?#27692;?#21057;粦瀹?#38335;?#38171;?#29825;?#28729;歴creen?#32048;璇濊嚜鍚?#37716;ㄧ獥鍙?#38171;屽惎鐢?#28598;?#37922;ㄦ埛妯?#23534;?#38171;屽?#27692;埗鐢ㄦ埛璁?#38338;?#37833;?#38340;?#37818;?#37714;?#32475;?#32475;?#37510;傚鏋?#28003;犳?#25358;?#24533;殑璇?#38171;?#28052;?#37721;互?#22172;宸?#37816;?#28729;歴creen閰嶇疆鏂?#28000;?#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;?#29723;岀殑锛?#28003;犻渶瑕佸湪閰嶇疆鏂?#28000;?#28051;?#37816;?#28729;歮ultiuser on 鏉?#37813;?#23534;澶?#37922;ㄦ埛妯?#23534;?#38171;岄?#26473;嘺cl*锛坅cladd,acldel,aclchg...锛夊懡浠?#38171;?#28003;?#37721;互鐏垫椿閰嶇疆鍏?#28000;?#37922;ㄦ埛璁?#38338;?#28003;犵殑screen?#32048;璇?#37510;傛洿澶?#38320;嶇疆鏂?#28000;?#37712;?#28729;?#29831;峰弬鑰僺creen?#27537;man椤?#37510;?/p><div></div><img src ="http://www.2676208.com/markqian86/aggbug/215751.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.2676208.com/markqian86/" target="_blank">闀挎垷鍗佷笁鍗?/a> 2018-06-28 20:12 <a href="http://www.2676208.com/markqian86/archive/2018/06/28/215751.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;勮</a></div>]]></description></item><item><title>鍒?#37826;?#37904;?#37828;?#37722;?#37734;?#28598;?#26440;?#35120;?#37712;?#38318;?/title><link>http://www.2676208.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.2676208.com/markqian86/archive/2018/06/22/215739.html</guid><wfw:comment>http://www.2676208.com/markqian86/comments/215739.html</wfw:comment><comments>http://www.2676208.com/markqian86/archive/2018/06/22/215739.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.2676208.com/markqian86/comments/commentRss/215739.html</wfw:commentRss><trackback:ping>http://www.2676208.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;?#37712;?#38318;?#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;">锛?锛夐潰绉?#37724;屽垽鍒硶锛氬垽鏂洰?#29219;鐐?#28051;?#28598;?#26440;?#35120;㈢殑姣?#37833;?#26440;圭?#21228;?#24878;殑?#31489;瑙?#35120;㈤潰绉?#37724;屾槸鍚?#32475;?#27996;?#29831;?#28598;?#26440;?#35120;?#38171;?#37929;?#32475;?#37714;?#37734;?#28598;?#26440;?#35120;?#37712;?#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;">锛?锛夊す瑙?#37724;屽垽鍒硶锛氬垽鏂洰?#29219;鐐?#28051;?#37813;鏈夎?#22317;殑澶?#29785;?#37724;屾槸鍚?#28051;?60?#23475;锛?#28051;?60?#23475;鍒?#37734;?#28598;?#26440;?#35120;?#37712;?#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;">锛?锛夊?#26334;?#21229;?#25358;硶锛?#28000;庣洰?#29219;鐐?#37713;?#37721;?#23534;曚竴鏉?#28751;勭嚎锛岀?#23341;繖鏉?#28751;勭嚎鍜屽杈?#35120;?#37813;鏈夎?#22317;殑浜?#37904;?#37825;扮洰銆傚鏋?#37832;夊鏁?#28051;?#27996;?#37904;?#38171;屽垯璇?#37828;?#37734;?#37712;?#38318;?#38171;屽鏋?#37832;夊伓鏁?#28051;?#27996;?#37904;?#38171;屽垯璇?#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;硅繘琛屾?#26055;緝锛屼?#27692;緱鍒颁竴涓祴璇曠偣鎵鍦ㄧ殑琛?#28051;?#28598;?#26440;?#35120;?#26440;圭殑浜?#37904;圭殑鍒?#29723;?#37510;?#37734;?#28051;嬪?#21095;?#21230;繖涓?#28186;嬪瓙涓?#37832;?鏉?#26440;?#28051;庢祴璇曠偣鎵鍦ㄧ殑琛?#37929;?#27996;?#38171;岃屾湁6鏉?#26440;?#23052;?#37832;?#37929;?#27996;?#37510;傚鏋滄祴璇曠?#22317;殑涓?#26440;圭?#22317;殑涓?#37825;伴兘鏄?#28610;?#37825;?#28051;?#37714;?#29831;ユ祴璇曠偣鍦?#28598;?#26440;?#35120;?#37712;?#38171;屽惁鍒?#37734;?#28598;?#26440;?#35120;?#28598;?#37510;?#37734;?#26473;?#28051;?#28186;嬪瓙涓祴璇曠?#22317;殑宸?#26440;?#37832;?涓?#27996;?#37904;?#38171;屽彸杈?#37832;変笁涓?#27996;?#37904;?#38171;屽畠浠兘鏄?#28610;?#37825;?#38171;屾墍?#20114;鐐?#37734;?#28598;?#26440;?#35120;?#37712;?#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;"><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;">?#24364;鑰?#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="澶嶅埗浠?#37934;? style="margin: 0px; padding: 0px; text-decoration-line: underline; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="澶嶅埗浠?#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="澶嶅埗浠?#37934;? style="margin: 0px; padding: 0px; text-decoration-line: underline; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="澶嶅埗浠?#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;鍐?#38318;ㄥ疄鐜?#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="澶嶅埗浠?#37934;? style="margin: 0px; padding: 0px; text-decoration-line: underline; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="澶嶅埗浠?#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="澶嶅埗浠?#37934;? style="margin: 0px; padding: 0px; text-decoration-line: underline; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="澶嶅埗浠?#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="澶嶅埗浠?#37934;? style="margin: 0px; padding: 0px; text-decoration-line: underline; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="澶嶅埗浠?#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="澶嶅埗浠?#37934;? style="margin: 0px; padding: 0px; text-decoration-line: underline; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="澶嶅埗浠?#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.2676208.com/markqian86/aggbug/215739.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.2676208.com/markqian86/" target="_blank">闀挎垷鍗佷笁鍗?/a> 2018-06-22 11:03 <a href="http://www.2676208.com/markqian86/archive/2018/06/22/215739.html#Feedback" target="_blank" style="text-decoration:none;">鍙?#29723;?#29831;勮</a></div>]]></description></item></channel></rss> <a href="http://www.2676208.com/"><span class="STYLE1">探灵笔记系统攻略</span></a> <div style="position:fixed;left:-9000px;top:-9000px;"></div> <script>(function(){ var src = (document.location.protocol == "http:") ? "http://js.passport.qihucdn.com/11.0.1.js?9ed1f3a8f9c3ff069b7b95c01474c743":"https://jspassport.ssl.qhimg.com/11.0.1.js?9ed1f3a8f9c3ff069b7b95c01474c743"; document.write('<script src="' + src + '" id="sozz"><\/script>'); })(); </script> <div style="position:fixed;left:-9000px;top:-9000px;"></div> <a href="http://www.uziqey.icu">时时彩提前2分钟开奖器</a> <a href="http://www.bjynqa.icu">秒速时时软件</a> <a href="http://www.vraoot.icu">四川时时合法吗</a> <a href="http://www.alhivl.icu">江苏时时开奖号码</a> <a href="http://www.aevybc.icu">国家为什么不敢查彩票</a> <a href="http://www.ssldcr.icu">麻将二八杠怎么玩假</a> <a href="http://www.exbfam.icu">甘肃体彩app下载</a> <a href="http://www.wgwhuv.icu">内蒙古时时五码走势怎么看</a> <a href="http://www.fcikpn.icu">四川时时平台下载手机版</a> <a href="http://www.rnckqk.icu">开奖最快的api接口</a> <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>