<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title>meisw's blog</title>
		<link>http://meisw.wdlinux.cn//</link>
		<description>工作,学习,生活,这里将会有一些记录.     备用域名:http://meisw.wdlinux.cn</description>
		<copyright>Copyright (C) 2004 Security Angel Team [S4T] All Rights Reserved.</copyright>
		<generator>SaBlog-X Version 1.6 Build 20080806</generator>
		<lastBuildDate>Sun, 20 Sep 2026 23:57:17 +0000</lastBuildDate>
		<ttl>30</ttl>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1000-1.html</guid>
			<title>英国公司查询</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;<span style="color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, &quot;Luxi Sans&quot;, &quot;DejaVu Sans&quot;, Tahoma, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, sans-serif;">http://www.endole.co.uk</span></p>]]></description>
			<link>http://meisw.wdlinux.cn//show-1000-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-12-1.html">杂七杂八</category>
			<pubDate>2017-12-11 12:10</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-927-1.html</guid>
			<title>background-size 设置背景图片的大小</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;</p>
<h2 id="J_CodeLang" class="code-head" data-lang="HTML" style="margin: 0px; padding: 0px; font-size: 14px; font-weight: 500; font-family: tahoma, arial, 宋体; line-height: 21px;">background-size</h2>
<p style="margin-bottom: 15px; color: rgb(37, 37, 37); line-height: 28px; text-indent: 2em; font-family: tahoma, arial, 宋体;">设置背景图片的大小，以<strong>长度值</strong>或<strong>百分比</strong>显示，还可以通过<strong>cover</strong>和<strong>contain</strong>来对图片进行伸缩。</p>
<p style="margin-bottom: 15px; color: rgb(37, 37, 37); line-height: 28px; text-indent: 2em; font-family: tahoma, arial, 宋体;">语法：</p>
<pre class="code" style="margin-top: 0px; margin-bottom: 10.5px; padding: 10px; line-height: 1.45; word-break: break-all; word-wrap: break-word; color: rgb(51, 51, 51); border: 1px solid rgba(128, 128, 128, 0.0745098); border-radius: 5px; overflow: auto; white-space: pre-wrap; background-color: rgba(128, 128, 128, 0.0470588);">background-size: auto | &lt;长度值&gt; | &lt;百分比&gt; | cover | contain</pre>
<p style="margin-bottom: 15px; color: rgb(37, 37, 37); line-height: 28px; text-indent: 2em; font-family: tahoma, arial, 宋体;">取值说明：</p>
<p style="margin-bottom: 15px; color: rgb(37, 37, 37); line-height: 28px; text-indent: 2em; font-family: tahoma, arial, 宋体;"><strong>1、auto</strong>：默认值，不改变背景图片的原始高度和宽度；</p>
<p style="margin-bottom: 15px; color: rgb(37, 37, 37); line-height: 28px; text-indent: 2em; font-family: tahoma, arial, 宋体;"><strong>2、&lt;长度值&gt;</strong>：成对出现如200px 50px，将背景图片宽高依次设置为前面两个值，当设置一个值时，将其作为图片宽度值来<strong>等比缩放</strong>；</p>
<p style="margin-bottom: 15px; color: rgb(37, 37, 37); line-height: 28px; text-indent: 2em; font-family: tahoma, arial, 宋体;"><strong>3、&lt;百分比&gt;</strong>：0％~100％之间的任何值，将背景图片宽高依次设置为所在元素宽高乘以前面百分比得出的数值，当设置一个值时同上；</p>
<p style="margin-bottom: 15px; color: rgb(37, 37, 37); line-height: 28px; text-indent: 2em; font-family: tahoma, arial, 宋体;"><strong>4、cover</strong>：顾名思义为<strong>覆盖</strong>，即将背景图片等比缩放以<strong>填满整个容器</strong>；</p>
<p style="margin-bottom: 15px; color: rgb(37, 37, 37); line-height: 28px; text-indent: 2em; font-family: tahoma, arial, 宋体;"><strong>5、contain</strong>：容纳，即将背景图片等比缩放至<strong>某一边紧贴容器边缘为止</strong>。</p>
<p style="margin-bottom: 15px; color: rgb(37, 37, 37); line-height: 28px; text-indent: 2em; font-family: tahoma, arial, 宋体;"><strong>提示：</strong>大家可以在右边的编辑窗口输入自己的代码尝试不同取值的效果。</p>]]></description>
			<link>http://meisw.wdlinux.cn//show-927-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-12-1.html">杂七杂八</category>
			<pubDate>2017-02-21 23:49</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-808-1.html</guid>
			<title>传统企业的互联网之伤</title>
			<author>admin</author>
			<description><![CDATA[<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">经济观察报 周航</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">最近和朋友聊天，谈的话题比较集中在互联网与传统产业的关系上。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">他们中好几位的企业都已是各自行业里的翘楚，做得非常成功。尽管最大的互联网企业仍然比自己小很多，然而面对整个世界都奔向互联网的趋势，大家都很茫然。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">他们模模糊糊地认为，不管是主动拥抱还是被动等待，自己的行业可能最终都会跟互联网发生关系，但到底是什么样的关系，该如何应对，可以说完全没有概念。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">一位国内数一数二的家电制造品牌老总对我说，&ldquo;小米们&rdquo;的崛起给他的心理带来了非常大的震撼，或者说惶恐。自己苦苦拼了几十年，冰箱、洗衣机、 厨房电器，几十种品类，又从国内拼到国外，勉强过了1000亿元的营业额；一个小米才两年，就那么一个产品，已经卖了100多亿，这个刺激太大了。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">他无法理解这样迅速的成功，而只能从一些表层的东西去解读：小米很会炒作，很会利用社交媒体，领导者很有个人魅力，等等。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">两个小时里，我只能尽量向他解释做传统企业的人和互联网人的区别。那就是后者的思维起点永远是用户，其一切行动的出发点都是用户。但传统企业离真正的终端用户非常远。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">拿中国的家电制造产业来说，它的逻辑是，世界上有了什么新产品、新技术，跑过去了解甚至干脆copy一下，加进一些所谓的符合中国用户使用习惯的改造，产品出来后，还要经过非常长的销售链条&mdash;&mdash;区域代理、省级代理、市县级代理，才能到最终用户手上。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">所以，他每天考虑的都是渠道如何管控，用户怎么想他根本不知道。做品牌也是传统的方式，广告预算出来，电视多大比例，纸媒多大比例，互联网广告投放得非常少，即使有也只是尝试尝试，属于补充。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">我不敢说完全看懂了互联网，但我曾经有一只脚在传统行业里，里面的人的心态，受到哪些束缚，我深有体会。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">我问这位家电品牌老总，你有没有想过5年以后的家居行业是什么样子？你们有没有这样一个实验室，里面模拟的是未来的人居生活？他说完全没有。行业竞争这么激烈、利润超低、渠道难管理，还哪有闲暇去思考这些&ldquo;遥远&rdquo;的事情。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">所以，他们看互联网，正如当年我做音响企业时看互联网。个性使然，我对创新和变化一直很热衷。对于渐渐热门起来的网络，我会想，是不是也去搞个网站、去阿里巴巴上做个推广，换作在时下，我肯定会想是不是也去做个App。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">这就是搞互联网吗？显然不是。因为对互联网的认识非常表象，你所做的任何努力注定都不得法。尝试了一下没什么效果，回报和投入的精力和人员都不成正比，就很容易得出结论：互联网跟我做的事情、跟我的行业的关系不大。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">对于互联网，我们就是旁观者，在舞台下面，是观众。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">然后你就会和温水里的青蛙一样，开始时可能还感受不到压力和紧迫，但当真正的互联网侵袭到你的领地时，你可能瞬间就束手就擒。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">然而，即使你看懂了，就能成功拥抱互联网吗？</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">我并不是没有尝试过，但和绝大多数传统企业经营者一样，我每天都忙于处理一些眼前的事情，这个月的收入多少，利润多少，这个产品的市场反应怎么样，价格和渠道怎么样&hellip;&hellip;不知不觉就随波逐流了，根本跳不出来，那是一种身不由己。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">所以我才决定，算了，不折腾老行业了，既然我那么看好互联网，还背着传统行业的包袱，包括好几百号人，怎么转啊。你可以说你们坐在船上就行了，我来转，但是会很累，另外船上的人又会说，头晕，你的动作太大。总之是阻力太大了。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">企业越大、越成功，越不容易改变，因为身上的包袱太重了。它的潜意识总是希望去证明自己过去做的所拥有的是可以延续的。微软做surface不 太容易成功，或者说必然不会成功，为什么？因为它在PC上太成功了。尽管认识到了移动是未来，但它总想找到一个中间状态，既能延续在PC上的成功，又能够 拥抱变化，但是很显然，这个过渡的中间产物是你的需求，不是用户的需求。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">如果你的出发点是利用互联网让过去的业务和公司活得更好，那么，不管你做多大的努力，宿命都是必死无疑。但是人总是能用一个看似合理的理由，自圆其说。企业也一样，微软如此，国美、苏宁也是如此。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">10年之前，所有的企业还都很迷恋《基业长青》这本书。可是，哪有什么基业长青可言啊？企业渴望基业长青，就像人渴望长生不老，炼丹、锻炼，无非让寿命延长。然而，这跟大自然的规律是相悖的。企业就像人要死一样，要么被新的力量破坏、重构，要么就是消亡。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">所以，对于那些老朋友，我的结论听起来会很残忍：没有办法，别抱幻想，你转不了。怎么办，要么推翻一切旧有思维，完全跳出来，从头开始；要么等待着新的互联网企业来重新去整合你的行业。只有这两条路。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">历史一直如此。在一个正常的经济社会中，创新永远都是破坏性的，如果你秉着中庸之道，不想破坏原有，试图从增量上去创新，这是自欺欺人。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">工业革命的蒸汽机、汽车淘汰了马车业；如今的亚马逊、eBay、淘宝逼得沃尔玛、百思买这样的大连锁企业关店，不管你有3000家还是5000家门店，到了今天都不是资源了，变成了成本。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">当然，实体的东西并不会完全消失，至少在现阶段，线下的体验和展示，互联网还做不到。但人们的标准动作已经变成：到国美、苏宁，看半天摸半天，把图片一拍，回家上淘宝下单。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">租车行业同样，赫兹在美国做了60年，100万台车、8000个门店，不得了了吧？但你想想跟美国整个汽车保有量上亿台相比，100万台算什么呢？这样的公司不一定会消失，但不再会是主流了。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">自信者会振振有词，我们这个行业有互联网取代不了的地方，没错，但是互联网和传统行业的关系不是取代关系，而是谁主谁次、谁是枢纽谁是附属的关系。我们从小受到的革命教育就是这样，除了取代和打倒就没有别的，可互联网它是慢慢地渗透，然后颠覆原有的产业结构。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">淘宝网存在了10年了，中国互联网购物目前也仅过1万亿，占整个社会的零售总值的比例不到10%，如果从这个数字来看，我们依然会觉得传统商业是主，互联网是新增。但如果看成长曲线，看趋势，那你得出的结论一定是相反的。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">关于租车行业，想再多说几句。赫兹的规模化逻辑在中国还有机会，因为中国的社会目前处于一种时代的多层叠加形态，大家都有机会，但它的成长速度和空间是有限的。</p>
<p style="font: 14px/22px 微软雅黑, Verdana, sans-serif, 宋体; margin: 0px 0px 15pt; padding: 0px; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">这个行业未来的理想状态就是没有租车行业，汽车应该全民共享。生活中汽车已经这么多了，为什么不可以提高效率让大家来共享汽车呢？真正的互联网 为什么有这么大的威力？就是释放了最小的经济单位的活力&mdash;&mdash;个人。释放越多的经济单位，越有爆炸性，而且它有自我组织性和社区性。这都是传统产业不能望其 项背的。</p>]]></description>
			<link>http://meisw.wdlinux.cn//show-808-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-12-1.html">杂七杂八</category>
			<pubDate>2013-04-22 09:04</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-103-1.html</guid>
			<title>1月19日——Y2K38 bug 30年倒计时开始</title>
			<author>admin</author>
			<description><![CDATA[<div class="t_msgfont" id="message7861687">2008年1月19日星期六是一个值得注意的日期，它标志了Y2K38 bug 30年倒计时开始。Y2K38是指Unix系统时间使用的32位整数将在2038年溢出。从1970年1月1日开始，到2038年超过2^31，确切的时间是世界标准时2038年1月19日星期二凌晨03:14:07。</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-103-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-12-1.html">杂七杂八</category>
			<pubDate>2008-01-17 09:46</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-68-1.html</guid>
			<title>伪装成Google Bot突破收费网站页面</title>
			<author>admin</author>
			<description><![CDATA[<div id="art" style="margin: 15px" width="100%">
<div>为什么有的网站能够被Google搜索到，点击链接进去以后却显示&ldquo;未注册&rdquo;、&ldquo;还不是会员&rdquo;呢？这是一种网站专门针对对搜索引擎优化的技术。<br />
<br />
那么我们也可以伪装成搜索引擎来进入这些页面。我们需要的是修改浏览器的User-Agent值。下面以Internet Explorer为例说明：<br />
<br />
把下列代码保存为 ua.reg，双击导入到注册表中：<br />
Windows Registry Editor Version 5.00<br />
<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent]<br />
@=&quot;Googlebot/2.1&quot;<br />
&quot;Compatible&quot;=&quot;+<a title="http://www.googlebot.com/bot.html" href="http://www.googlebot.com/bot.html" target="_blank"><font color="#0000ff">http://www.googlebot.com/bot.html</font></a>&quot; <br />
这样我们就可以突破一些被封锁的收费内容页面了。</div>
<div>&nbsp;</div>
<div>Firefox用户可以去下载一个名字为 Agent-Switcher的插件，把User-Agent修改成 Googlebot/2.1 (<a title="http://www.googlebot.com/bot.html" href="http://www.googlebot.com/bot.html" target="_blank"><font color="#0000ff">http://www.googlebot.com/bot.html</font></a>) 就行了。</div>
<div>&nbsp;</div>
<div>转载的 . 觉得这还是有一定创意的.</div>
</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-68-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-12-1.html">杂七杂八</category>
			<pubDate>2007-08-28 11:06</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-67-1.html</guid>
			<title>腾讯仅仅是简单的抄袭吗？</title>
			<author>admin</author>
			<description><![CDATA[<div class="t_msgfont" id="message7250991">有一种声音：&ldquo;腾讯就是个抄袭专家&rdquo;<br />
从腾讯推出qq休闲游戏到最近滔滔的上线，这种声音经常会出现在我们的视听中。<br />
那我们就来分析一下腾讯的&ldquo;抄袭&rdquo;历程，看看腾讯是怎么抄得。<br />
腾讯的OICQ是借鉴了以色列Mirabilis公司的ICQ，但是随后的腾讯与Mirabilis走的是截然相反的两条道路：<br />
1、Mirabilis的ICQ在98年被AOL以2.87亿美元收购后，影响力却日趋下降；ICQ至今为止在欧洲、亚洲和南美的用户总数不过几千万。<br />
2、腾讯推出QQ后的四年时间里注册用户突破1亿，据07年5月的相关统计显示QQ注册用户总数多达5.9亿，同时在线人数突破3千万，腾讯公司市值621.7亿港元。<br />
所谓原创的一直在惨淡营生，而所谓抄袭的却突飞猛进一路高歌。原因何在？<br />
而与之类似的情况在随后的几年中反复的上演：四年前腾讯开始做门户，现在流量第一；做休闲游戏，将业界老大联众取而代之；进入网游后成长势头凶猛，让盛大、网易开始警惕；拍拍又让马云、王志东等紧张万分；原因又何在？<br />
我们再看看国外的&ldquo;抄袭专家&rdquo;微软是如何抄的：<br />
微软是&ldquo;抄袭门&rdquo;的常客，例如：旗下的windows操作系统经常被苹果指责抄袭、还有微软新推出的地图软件&ldquo;虚拟地球&rdquo;也被指&ldquo;抄袭&rdquo;google的卫星地图&ldquo;google earth&rdquo;。但是似乎看似凑巧的是，在微软每次&ldquo;抄袭门&rdquo;事件中的时候，微软就向前更迈进一步，因为他们那些被指责为&ldquo;抄袭&rdquo;的产品饱受市场好品为微软创造了一个接一个的利润高峰。原因更是何在？<br />
&ldquo;抄袭&rdquo;是一种不道德的行为当然会为众人所不耻，但是往往被指&ldquo;抄袭&rdquo;的那一方却总是胜过&ldquo;原创&rdquo;，要不然&ldquo;原创者&rdquo;不会恼火。之所以会出现这种情况的原因在于被指&ldquo;抄袭&rdquo;者并非正真的抄袭，反而他是做出了创新；因为仅仅是简单的抄袭是绝对不会胜过&ldquo;原创&rdquo;的。这种巧妙的&ldquo;抄袭&rdquo;是把一种技术发明改造成能够解决实际问题的创新。<br />
创新在英语中的解释是&ldquo;create&rdquo;和&ldquo;innovate&rdquo;， create指得是创造、创作，是一种从无到有的创作。Innovate的含义除了这层外还有改变和革新的意思。现如今我们需要的就是innovate的精神，毕竟能create的人还是很稀缺的。<br />
其实腾讯所走的路，自然都是每个企业都要走的路，因为任何一个企业很难做到每个产品都是自己原创，即使如此也可能陷入&ldquo;抄袭门&rdquo;，如何去应对呢？腾讯的这种创新给他们指了一条很好的捷径。其他的企业能不能走好，有没有innovate式的创新精神是个关键。</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-67-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-12-1.html">杂七杂八</category>
			<pubDate>2007-08-23 17:06</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-41-1.html</guid>
			<title>使用 SystemTap 调试内核</title>
			<author>admin</author>
			<description><![CDATA[<div>原文:http://www.ibm.com/developerworks/cn/linux/l-systemtap/</div>
<div>&nbsp;</div>
<div>
<p><a href="http://www.ibm.com/developerworks/cn/linux/l-systemtap/#author"><font color="#996699">桂 剑</font></a> (<a href="mailto:guijian@cn.ibm.com?subject=使用 SystemTap 调试内核"><font color="#5c81a7">guijian@cn.ibm.com</font></a>), IBM 中国开发中心,Linux Performance 项目软件工程师</p>
<p>2006 年 12 月 14 日</p>
<p>&nbsp;</p>
<hr id="null" />
<p>&nbsp;</p>
<blockquote>SystemTap 是一种新颖的 Linux 内核诊断工具，提供了一种从运行中的 Linux 内核快速和安全地获取信息的能力。SystemTap 是内核开发人员和系统管理员的福音，因为这使得他们可以通过编写或者重用简单的脚本来收集内核的实时数据，而不需要再忍受修改源码、编译内核、重启系统的漫长煎熬。本文介绍了 SystemTap 的安装、使用和基本原理，并用一些有趣的例子揭示了 SystemTap 提供的强大能力。</blockquote><!--START RESERVED FOR FUTURE USE INCLUDE FILES--><!-- include java script once we verify teams wants to use this and it will work on dbcs and cyrillic characters --><!--END RESERVED FOR FUTURE USE INCLUDE FILES-->
<p>在 SystemTap 出现之前，对于 Linux 程序员或者系统管理员而言，调试内核往往是一场噩梦。例如，你怀疑传递给系统调用 read 的参数 fd 出了问题，想把它打印出来，你需要做的是：首先得到一份内核源码，找到 sys_read() 的函数体中插入 printk() 语句，接下来重新编译内核，然后用新的内核重新启动系统。谢天谢地，你总算看到了你想要看到的东西，不过你马上会发现遇到了一个新的麻烦：除非重新启动系统到原来的内核，printk() 会无休止地打印下去。</p>
<p>SystemTap 的目的就是要把人们从这种泥潭中解救出来。SystemTap 提供了一个简单的命令行接口和强大的脚本语言，同时预定义了丰富的脚本库。基于内核中的 kprobe，SystemTap允许你自由地从运行中的内核无害地收集调试信息和性能数据，来用于之后的分析和处理。你可以随时开始或者停止这种收集过程，而无需漫长的修改代码、编译内核和重启系统的悲惨循环。SystemTap 使得上面的问题变得简单了，简单得只需要一条命令就可以做到：</p>
<p><br />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td class="code-outline">
            <pre class="displaycode">stap -e 'probe syscall.read { printf(&quot;fd = %d\n&quot;,fd) }</pre>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>SystemTap的功能和Sun的DTrace和IBM的dprobe工具相似。但是和它们不同的是， SystemTap是遵循GPL的开源软件项目。它的出现使得Linux社区也拥有了功能强大而且易于使用的动态内核调试工具。目前，SystemTap的主要开发成员来自于RedHat、IBM、Intel和Hitachi，其中还包括来自IBM中国开发中心的工程师。</p>
<p><br />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td><img height="1" alt="" src="http://www.ibm.com/i/v14/rules/blue_rule.gif" width="100%" /><br />
            <img height="6" alt="" src="http://www.ibm.com/i/c.gif" width="8" border="0" /></td>
        </tr>
    </tbody>
</table>
<table class="no-print" cellspacing="0" cellpadding="0" align="right">
    <tbody>
        <tr align="right">
            <td><img height="4" alt="" src="http://www.ibm.com/i/c.gif" width="100%" /></td>
        </tr>
    </tbody>
</table>
</p>
<p><a name="N1004C"><span class="atitle">安装SystemTap</span></a></p>
<p>在安装SystemTap之前，需要确保系统中已经安装了其它两个软件包：</p>
<ul>
    <li>kernel-debuginfo RPM：SystemTap需要通过内核调试信息来定位内核函数和变量的位置。对于通常的发行版，并没有安装kernel-debuginfo RPM，我们可以到发行版的下载站点下载。对于我的ThinkPad上的Fedora Core 6，这个地址是： <a href="http://download.fedora.redhat.com/pub/fedora/linux/core/6/i386/debug/"><font color="#5c81a7">http://download.fedora.redhat.com/pub/fedora/linux/core/6/i386/debug/</font></a></li>
    <li>elfutils RPM：SystemTap需要elfutils软件包提供的库函数来分析调试信息。目前的SystemTap要求安装elfutils-0.123以上版本。目前最新的版本是0.124-0.1。如果需要，我们可以从SystemTap的站点下载RPM或者源码来升级。下载地址是： <a href="ftp://sources.redhat.com/pub/SystemTap/elfutils/i386/"><font color="#5c81a7">ftp://sources.redhat.com/pub/SystemTap/elfutils/i386/</font></a></li>
</ul>
<p>接下来就可以安装SystemTap了，这有通过RPM或者源码安装两种方式：</p>
<p>1． 通过RPM安装 Fedora Core 6缺省情况下已经安装了systemtap。如果没有，也可以从如下的地址下载： <a href="http://download.fedora.redhat.com/pub/fedora/linux/core/updates/testing/6/i386/SystemTap-0.5.10-1.fc6.i386.rpm"><font color="#5c81a7">http://download.fedora.redhat.com/pub/fedora/linux/<br />
core/updates/testing/6/i386/SystemTap-0.5.10-1.fc6.i386.rpm</font></a></p>
<p>2．通过源码安装：</p>
<p>从SystemTap的FTP站点下载最新的源码</p>
<p><a href="ftp://sources.redhat.com/pub/SystemTap/snapshots/SystemTap-20061104.tar.bz2"><font color="#5c81a7">ftp://sources.redhat.com/pub/SystemTap/snapshots/SystemTap-20061104.tar.bz2</font></a></p>
<p>然后安装如下：</p>
<p><br />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td class="code-outline">
            <pre class="displaycode">/root &gt; tar -jxf SystemTap-20061104.tar.bz2
/root &gt; cd src
/root/src&gt; ./configure
/root/src&gt; make
/root/src&gt; make install</pre>
            </td>
        </tr>
    </tbody>
</table>
<br />
<br />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td><img height="1" alt="" src="http://www.ibm.com/i/v14/rules/blue_rule.gif" width="100%" /><br />
            <img height="6" alt="" src="http://www.ibm.com/i/c.gif" width="8" border="0" /></td>
        </tr>
    </tbody>
</table>
<table class="no-print" cellspacing="0" cellpadding="0" align="right">
    <tbody>
        <tr align="right">
            <td><img height="4" alt="" src="http://www.ibm.com/i/c.gif" width="100%" /><br />
            <table cellspacing="0" cellpadding="0" border="0">
                <tbody>
                    <tr>
                        <td valign="middle"><img height="16" alt="" src="http://www.ibm.com/i/v14/icons/u_bold.gif" width="16" border="0" /></td>
                        <td valign="top" align="right">&nbsp;</td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p><a name="N10086"><span class="atitle">运行SystemTap</span></a></p>
<p>运行SystemTap首先需要root权限。</p>
<p>运行SystemTap有三种形式：</p>
<p>1． 从文件(通常以.stp作为文件名后缀)中读入并运行脚本：stap [选项] 文件名</p>
<p>2． 从标准输入中读入并运行脚本： stap [选项] -</p>
<p>3． 运行命令行中的脚本：stap [选项] -e 脚本</p>
<p>4． 直接运行脚本文件(需要可执行属性并且第一行加上#!/usr/bin/stap)：./脚本文件名使用&quot;Ctrl+C&quot;中止SystemTap的运行。</p>
<p>systemtap的选项还在不断的扩展和更新中，其中最常用的选项包括：</p>
<p>-v -- 打印中间信息</p>
<p>-p NUM -- 运行完Pass Num后停止(缺省是运行到Pass 5)</p>
<p>-k -- 运行结束后保留临时文件不删除</p>
<p>-b -- 使用RelayFS文件系统来将数据从内核空间传输到用户空间</p>
<p>-M -- 仅当使用-b选项时有效，运行结束时不合并每个CPU的单独数据文件</p>
<p>-o FILE -- 输出到文件，而不是输出到标准输出</p>
<p>-c CMD -- 启动探测后，运行CMD命令，直到命令结束后退出</p>
<p>-g -- 采用guru模式，允许脚本中嵌入C语句</p>
<p>其它更多选项请参看stap的手册。</p>
<p><br />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td><img height="1" alt="" src="http://www.ibm.com/i/v14/rules/blue_rule.gif" width="100%" /><br />
            <img height="6" alt="" src="http://www.ibm.com/i/c.gif" width="8" border="0" /></td>
        </tr>
    </tbody>
</table>
<table class="no-print" cellspacing="0" cellpadding="0" align="right">
    <tbody>
        <tr align="right">
            <td><img height="4" alt="" src="http://www.ibm.com/i/c.gif" width="100%" /></td>
        </tr>
    </tbody>
</table>
</p>
<p><a name="N100BC"><span class="atitle">SystemTap的语法</span></a></p>
<p>我们利用一个简单的systemtap脚本来介绍一下SystemTap的语法：</p>
<p><br />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td class="code-outline">
            <pre class="displaycode">#!/usr/local/bin/stap
global count
function report(stat) {
        printf(&quot;stat=%d\n&quot;, stat)
}
probe kernel.function(&quot;sys_read&quot;) {
        ++count
}
probe end {
        report()
}</pre>
            </td>
        </tr>
    </tbody>
</table>
</p>
<ul>
    <li>探测点(probe)：每个systemtap脚本中至少需要定义一个探测点，也就是指定了在内核的什么位置进行探测。探测点名称后面紧跟的一组大括号内定义了每次内核运行到该探测点时需要运行的操作，这些操作完成后再返回探测点，继续下面的指令。这里给出了systemtap目前支持的所有探测点类型。</li>
    <li>全局变量(global)：用来定义全局变量。单个探测点函数体中使用的局部变量不需要预先定义，但是如果一个变量需要在多个探测点函数体中使用，则需要定义为全局变量。</li>
    <li>函数(function)：用来定义探测点函数体中需要用到的函数。除了可以用脚本语言定义函数以外，还可以用C语言来定义函数，只是这时函数名后面的大括号对需要换成%{ %}。例如，前面的report()函数可以写成：
    <table cellspacing="0" cellpadding="0" width="100%" border="0">
        <tbody>
            <tr>
                <td class="code-outline">
                <pre class="displaycode">function report(stat) %{
		_stp_printf(&quot;stat=%d\n&quot;, THIS-&gt;stat);
	%}</pre>
                </td>
            </tr>
        </tbody>
    </table>
    </li>
</ul>
<p><br />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td><img height="1" alt="" src="http://www.ibm.com/i/v14/rules/blue_rule.gif" width="100%" /><br />
            <img height="6" alt="" src="http://www.ibm.com/i/c.gif" width="8" border="0" /></td>
        </tr>
    </tbody>
</table>
<table class="no-print" cellspacing="0" cellpadding="0" align="right">
    <tbody>
        <tr align="right">
            <td><img height="4" alt="" src="http://www.ibm.com/i/c.gif" width="100%" /></td>
        </tr>
    </tbody>
</table>
</p>
<p><a name="N100DD"><span class="atitle">SystemTap的例子</span></a></p>
<p>了解了SystemTap的基本用法，下面让我们来看几个有趣的例子。</p>
<p><a name="N100E6"><span class="smalltitle"><strong><font face="Arial" size="3">统计当前系统中调用最多的前10个系统调用</font></strong></span></a></p>
<p>在进行性能分析的时候，我们常常需要知道那些函数调用次数最多，才能有的放矢地展开分析。下面这个简单的例子可以打印出在过去的5秒钟里调用次数最多的那些系统调用。</p>
<p><br />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td class="code-outline">
            <pre class="displaycode">#!/usr/bin/env stap
#
# display the top 10 syscalls called in last 5 seconds
#
global syscalls
function print_top () {
        cnt=0
        log (&quot;SYSCALL\t\t\t\tCOUNT&quot;)
        foreach ([name] in syscalls-) {
                printf(&quot;%-20s\t\t%5d\n&quot;,name, syscalls[name])
                if (cnt++ == 10)
                        break
        }
        printf(&quot;--------------------------------------\n&quot;)
        delete syscalls
}
probe syscall.* {
        syscalls[probefunc()]++
}
probe timer.ms(5000) {
        print_top ()
}</pre>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>它的输出结果一目了然：</p>
<p><br />
<img height="247" alt="图" src="http://www.ibm.com/developerworks/cn/linux/l-systemtap/images/image002.jpg" width="370" border="0" orig_onmouseout="null" orig_onmouseover="null" /></p>
<p><a name="N1010C"><span class="smalltitle"><strong><font face="Arial" size="3">看看是谁在偷偷动我的文件</font></strong></span></a></p>
<p>有时候，我们如果中了恶意的病毒软件，会发现某些文件莫名其妙的被修改，下面这个例子可以帮你监视谁在修改你的文件。</p>
<p><br />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td class="code-outline">
            <pre class="displaycode">#!/usr/bin/env stap
#
# monitor who is messing my file of secrets
#
probe generic.fop.open {
        if(filename == &quot;secrets&quot;)
                printf(&quot;%s is opening my file: %s\n&quot;, execname(), filename)
}</pre>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>我们运行这个脚本，在另外一个窗口做一些操作，来看看它的输出结果：</p>
<p><br />
<img height="197" alt="图" src="http://www.ibm.com/developerworks/cn/linux/l-systemtap/images/image004.jpg" width="369" border="0" orig_onmouseout="null" orig_onmouseover="null" /></p>
<p><a name="N10132"><span class="smalltitle"><strong><font face="Arial" size="3">打印ANSI字符串</font></strong></span></a></p>
<p>SystemTap不仅仅是一个简单的调试工具，强大的脚本语言能力让它同样能做一些有趣的事情，下面这个例子就可以对输出的字符进行美化：</p>
<p><br />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td class="code-outline">
            <pre class="displaycode">#!/usr/bin/env stap
#
# print colorful ANSI strings
#
probe begin {
        printf(&quot;a \\ b |&quot;);
        for (c = 40; c &lt; 48; c++)
                printf(&quot;   %d   &quot;, c);
        printf(&quot;\12&quot;);
        for (l = 0; l &lt; 71; l++)
                printf(&quot;-&quot;);
        printf(&quot;\12&quot;);

        for (r = 30; r &lt; 38; r++)
                for (t = 0; t &lt; 2; t++) {
                        printf(&quot;%d    |&quot;, r);
                        for (c = 40; c &lt; 48; c++)
                                printf(&quot;\033[%d;%d%s %s \033[0;0m&quot;,
                                        r, c, !t ? &quot;m&quot; : &quot;;1m&quot;, !t ? &quot;Normal&quot; : &quot;Bold  &quot;);
                        printf(&quot;\12&quot;);
                }
        exit();
}</pre>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>来看看它的输出：</p>
<p><br />
<img height="274" alt="图" src="http://www.ibm.com/developerworks/cn/linux/l-systemtap/images/image006.jpg" width="564" border="0" orig_onmouseout="null" orig_onmouseover="null" /> <br />
<br />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td><img height="1" alt="" src="http://www.ibm.com/i/v14/rules/blue_rule.gif" width="100%" /><br />
            <img height="6" alt="" src="http://www.ibm.com/i/c.gif" width="8" border="0" /></td>
        </tr>
    </tbody>
</table>
<table class="no-print" cellspacing="0" cellpadding="0" align="right">
    <tbody>
        <tr align="right">
            <td><img height="4" alt="" src="http://www.ibm.com/i/c.gif" width="100%" /></td>
        </tr>
    </tbody>
</table>
</p>
<p><a name="N10158"><span class="atitle">SystemTap的基本原理</span></a></p>
<p><br />
<img height="323" alt="图" src="http://www.ibm.com/developerworks/cn/linux/l-systemtap/images/image008.gif" width="408" border="0" orig_onmouseout="null" orig_onmouseover="null" /></p>
<p>现在，大家已经熟悉了SystemTap的基本用法。在结束之前，让我们再来了解一下SystemTap的基本原理和工作流程以加深理解。</p>
<p>可以看出，SystemTap运行的过程依次分为五个阶段，通常称为Pass 1 - Pass 5。就像前面介绍用法的时候提到的，在命令行中加上-p NUM选项可以使得SystemTap在运行完Pass NUM之后停止，而不是运行到Pass 5。这允许你分析SystemTap在每一个阶段的输出，对于调试脚本尤其有用。</p>
<p>下面来介绍每一个阶段的主要功能：</p>
<ul>
    <li>Pass 1 - parse：这个阶段主要是检查输入脚本是否存在语法错误，例如大括号是否匹配，变量定义是否规范等</li>
    <li>Pass 2 - elaborate：这个阶段主要是对输入脚本中定义的探测点或者用到的函数展开，不但需要综合SystemTap的预定义脚本库，还需要分析内核或者内核模块的调试信息</li>
    <li>Pass 3 - translate: 在这个阶段，将展开后的脚本转换成C文件。前三个阶段的功能类似于编译器，将.stp文件编译成为完整的.c文件，因此又被合起来称为转换器(translator)</li>
    <li>Pass 4 - build：在这个阶段，将C源文件编译成内核模块，在这过程中还会用到SystemTap的运行时库函数。</li>
    <li>Pass 5 - run：这个阶段，将编译好的内核模块插入内核，开始进行数据收集和传输。</li>
</ul>
<p><br />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td><img height="1" alt="" src="http://www.ibm.com/i/v14/rules/blue_rule.gif" width="100%" /><br />
            <img height="6" alt="" src="http://www.ibm.com/i/c.gif" width="8" border="0" /></td>
        </tr>
    </tbody>
</table>
<table class="no-print" cellspacing="0" cellpadding="0" align="right">
    <tbody>
        <tr align="right">
            <td><img height="4" alt="" src="http://www.ibm.com/i/c.gif" width="100%" /></td>
        </tr>
    </tbody>
</table>
</p>
<p><a name="N1018A"><span class="atitle">小结</span></a></p>
<p>SystemTap是一个全新的工具，但已经表现出了强大的功能和广泛的适用性。SystemTap使得动态收集Linux内核信息和性能数据变得轻而易举，这就使人可以从繁琐的数据采集中解放出来，而专注于数据的处理和分析，这无疑是内核开发人员和系统管理人员的福音。随着越来越多用户的体验，越来越多的bug会被报告和修正，越来越多的新功能会被添加，SystemTap也会变得越来越稳定和完善。</p>
<p><br />
<br />
&nbsp;</p>
<p><a name="resources"><span class="atitle">参考资料 </span></a></p>
<ul>
    <li>SystemTap站点：<a href="http://sourceware.org/systemtap/"><font color="#5c81a7">http://sourceware.org/systemtap/</font></a></li>
    <li>SystemTap手册：<a href="http://sourceware.org/systemtap/man1/stap.1.html"><font color="#5c81a7">http://sourceware.org/systemtap/man1/stap.1.html</font></a></li>
    <li>更多SystemTap实例：<a href="http://sourceware.org/systemtap/wiki/WarStories"><font color="#5c81a7">http://sourceware.org/systemtap/wiki/WarStories</font></a></li>
    <li>Architecture of systemtap：<a href="http://sourceware.org/systemtap/archpaper.pdf"><font color="#5c81a7">http://sourceware.org/systemtap/archpaper.pdf</font></a></li>
    <li>Kprobes站点：<a href="http://sourceware.org/systemtap/kprobes/index.html"><font color="#5c81a7">http://sourceware.org/systemtap/kprobes/index.html</font></a></li>
</ul>
<p><br />
<br />
&nbsp;</p>
<p><a name="author"><span class="atitle">关于作者</span></a></p>
<p>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td colspan="3"><img height="5" alt="" src="http://www.ibm.com/i/c.gif" width="100%" /></td>
        </tr>
        <tr valign="top" align="left">
            <td>
            <p>&nbsp;</p>
            </td>
            <td><img height="5" alt="" src="http://www.ibm.com/i/c.gif" width="4" /></td>
            <td width="100%">
            <p>桂剑，IBM 中国开发中心 Linux Performance 项目的软件工程师，有五年的 Linux 开发经验，对编译器、调试技术、操作系统很感兴趣。</p>
            </td>
        </tr>
    </tbody>
</table>
</p>
</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-41-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-12-1.html">杂七杂八</category>
			<pubDate>2007-07-19 17:50</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1-1.html</guid>
			<title>本博简介</title>
			<author>admin</author>
			<description><![CDATA[<p>很早的时候就想写博客,只可惜的是,只是想,而没有一个比较好的实际行动.实在惭愧.</p>
<p>本人不习惯写心情日记.也懒得去写.开个博客,主要也是想收集/整理些资料.学习,工作都方便.</p>
<p>在互联网上混,也算混了有几年了.但却没混出个好成绩.算是比较失败的.</p>
<p>此次开博,已是下定决心.希望可以坚持下去.</p>
<p>主要也是想,趁这个机会,整理一下思绪,又或是来个总结. 这几年的经验,经历.和所做过的事.同时也将之前的一些文档整理上来.</p>
<p>同时,也希望能为中国的开源做点实事.推广LAMP,Linux,开源,在中国的发展与应用.</p>
<p>&nbsp;</p>]]></description>
			<link>http://meisw.wdlinux.cn//show-1-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-12-1.html">杂七杂八</category>
			<pubDate>2007-07-11 15:25</pubDate>
		</item>
	</channel>
</rss>
