LinuxÆô¶¯Ê±¼äµÄ¼«ÏÞÓÅ»¯
£¨1£©Ê×ÏÈÊǶÔLinuxÆô¶¯¹ý³ÌµÄ¸ú×ٺͷÖÎö£¬Éú³ÉÏêϸµÄÆô¶¯Ê±¼ä±¨¸æ¡£
¡¡¡¡½ÏΪ¼òµ¥¿ÉÐеķ½Ê½ÊÇͨ¹ýPrintkTime¹¦ÄÜΪÆô¶¯¹ý³ÌµÄËùÓÐÄÚºËÐÅÏ¢Ôö¼Óʱ¼ä´Á£¬±ãÓÚ»ã×Ü·ÖÎö¡£PrintkTime×îÔçΪCELFËùÌṩµÄÒ»¸öÄں˲¹¶¡£¬ÔÚºóÀ´µÄKernel 2.6.11°æ±¾ÖÐÕýʽÄÉÈë±ê×¼Äںˡ£ËùÒÔ´ó¼Ò¿ÉÄÜÔÚа汾µÄÄÚºËÖÐÖ±½ÓÆôÓøù¦ÄÜ¡£Èç¹ûÄãµÄLinuxÄÚºËÒòΪijЩÔÒò²»ÄܸüÐÂΪ2.6.11Ö®ºóµÄ°æ±¾£¬ÄÇô¿ÉÒԲο¼CELFÌṩµÄ·½·¨Ð޸ĻòÖ±½ÓÏÂÔØËüÃÇÌṩµÄ²¹¶¡£ºhttp://tree.celinuxforum.org/CelfPubWiki/PrintkTimes
¡¡¡¡¿ªÆôPrintkTime¹¦Äܵķ½·¨ºÜ¼òµ¥£¬Ö»ÐèÔÚÄÚºËÆô¶¯²ÎÊýÖÐÔö¼Ó“time”¼´¿É¡£µ±È»£¬ÄãÒ²¿ÉÒÔÑ¡ÔñÔÚ±àÒëÄÚºËʱֱ½ÓÖ¸¶¨“Kernel hacking”ÖеēShow timing information on printks”À´Ç¿ÖÆÿ´ÎÆô¶¯¾ùΪÄÚºËÐÅÏ¢Ôö¼Óʱ¼ä´Á¡£ÕâÒ»ÖÖ·½Ê½»¹ÓÐÁíÒ»¸öºÃ´¦£ºÄã¿ÉÒԵõ½ÄÚºËÔÚ½âÎöÆô¶¯²ÎÊýÇ°ËùÓÐÐÅÏ¢µÄʱ¼ä¡£Òò´Ë£¬ÎÒÑ¡ÔñºóÒ»ÖÖ·½Ê½¡£
¡¡¡¡µ±Íê³ÉÉÏÊöÅäÖúó£¬ÖØÐÂÆô¶¯Linux£¬È»ºóͨ¹ýÒÔÏÂÃüÁÄÚºËÆô¶¯ÐÅÏ¢Êä³öµ½Îļþ£º
dmesg -s 131072 > ktime
¡¡¡¡È»ºóÀûÓÃÒ»¸ö½Å±¾“show_delta”£¨Î»ÓÚLinuxÔ´ÂëµÄscriptsÎļþ¼ÐÏ£©½«ÉÏÊöÊä³öµÄÎļþת»»ÎªÊ±¼äÔöÁ¿ÏÔʾ¸ñʽ£º
/usr/src/linux-x.xx.xx/scripts/show_delta ktime > dtime
¡¡¡¡ÕâÑù£¬Äã¾ÍµÃµ½ÁËÒ»·Ý¹ØÓÚLinuxÆô¶¯Ê±¼äÏûºÄµÄÏêϸ±¨¸æ¡£
£¨2£©È»ºó£¬ÎÒÃǾÍÀ´Í¨¹ýÕâ·Ý±¨¸æ£¬ÕÒ³öÆô¶¯ÖÐÏà¶ÔºÄʱµÄ¹ý³Ì¡£
¡¡¡¡±ØÐëÃ÷È·Ò»µã£º±¨¸æÖеÄʱ¼äÔöÁ¿ºÍÄÚºËÐÅÏ¢Ö®¼äûÓбØÈ»µÄ¶ÔÓ¦¹Øϵ£¬ÕæÕýµÄʱ¼äÏûºÄ±ØÐë´ÓÄÚºËÔ´ÂëÈëÊÖ·ÖÎö¡£
¡¡¡¡ÕâÒ»µã¶ÔÓÚÉÔ΢ÊìϤ±à³ÌµÄÅóÓÑÀ´Ëµ¶¼²»ÄÑÀí½â£¬ÒòΪʱ¼äÔöÁ¿Ö»ÊÇÁ½´Îµ÷ÓÃprintkÖ®¼äµÄʱ¼ä²îÖµ¡£Í¨³£À´Ëµ£¬ÄÚºËÆô¶¯¹ý³ÌÖÐÔÚÍê³ÉһЩºÄʱµÄÈÎÎñ£¬Èç´´½¨hashË÷Òý¡¢probeÓ²¼þÉ豸µÈ²Ù×÷ºó»áͨ¹ýprintk½«½á¹û´òÓ¡³öÀ´£¬ÕâÖÖÇé¿öÏ£¬Ê±¼äÔöÁ¿ÍùÍù·´Ó³µÄÊÇÐÅÏ¢¶ÔÓ¦¹ý³ÌµÄºÄʱ£»µ«ÓÐЩʱºò£¬ÄÚºËÊÇÔÚµ÷ÓÃprintkÊä³öÐÅÏ¢ºó²Å¿ªÊ¼ÏàÓ¦µÄ¹ý³Ì£¬ÄÇô±¨¸æÖÐÄÚºËÐÅÏ¢ÏàÓ¦¹ý³ÌµÄʱ¼äÏûºÄ¶ÔÓ¦µÄÊÇÆäÏÂÒ»ÐеÄʱ¼äÔöÁ¿£»»¹ÓÐһЩʱºò£¬Ê±¼äÏûºÄÔÚÁËÁ½´ÎÄÚºËÐÅÏ¢Êä³öÖ®¼äµÄij¸ö²»È·¶¨µÄʱ¶Î£¬ÕâÑùʱ¼äÔöÁ¿¿ÉÄܾÍÍêÈ«ÎÞ·¨Í¨¹ýÄÚºËÐÅÏ¢·´Ó¦³öÀ´ÁË¡£
¡¡¡¡ËùÒÔ£¬ÎªÁË׼ȷÅжÏÕæÕýµÄʱ¼äÏûºÄ£¬ÎÒÃÇÐèÒª½áºÏÄÚºËÔ´Âë½øÐзÖÎö¡£±ØÒªµÄʱºò£¬ÀýÈçÉÏÊöµÚÈýÖÖÇéÐÎÏ£¬»¹µÃ×Ô¼ºÔÚÔ´ÂëÖвåÈëprintk´òÓ¡£¬ÒÔ½øÒ»²½È·¶¨Êµ¼ÊµÄʱ¼äÏûºÄ¹ý³Ì¡£
¡¡¡¡ÒÔÏÂÊÇÎÒÉϴβüõºóLi
Ïà¹ØÎĵµ£º
µ±Éϲã×¼±¸ºÃÒ»¸ö°üÖ®ºó£¬½»¸øÏÂÃæÕâ¸öº¯Êý´¦Àí
int dev_queue_xmit(struct sk_buff *skb)
{
struct net_device *dev = skb->dev;
struct netdev_queue *txq;
struct Qdisc *q;
int rc = -ENOMEM;
/* GSO will handle the following emulations directly. */
if (netif_needs_gso(dev, skb))
goto gso; ......
from: http://cc.byexamples.com/20070520/tap-the-interrupt-signal/
When you hit control+c, you are actually send a SIGINT ( Interrupt signal ) to your program. By default, your program will be terminated after receiving SIGINT. But you can change the way of handling Interrupt signal.
Some of the a ......
ÓÐÕâôһϵÁеÄÎÊÌ⣬ÊÇ·ñÔÚÀ§ÈÅ×ÅÄ㣺Óû§³ÌÐò±àÒëÁ¬½ÓÐγɵĵØÖ·¿Õ¼äÔÚʲô·¶Î§ÄÚ£¿Äں˱àÒëºóµØÖ·¿Õ¼äÔÚʲô·¶Î§ÄÚ£¿Òª¶ÔÍâÉè½øÐзÃÎÊ£¬I/OµÄµØÖ·¿Õ¼äÓÖÊÇʲôÑùµÄ£¿
ÏȻشðµÚÒ»¸öÎÊÌâ¡£Linux×î³£¼ûµÄ¿ÉÖ´ÐÐÎļþ¸ñʽΪelf(Executable and Linkable Format)¡£ÔÚelf¸ñʽµÄ¿ÉÖ´ÐдúÂëÖУ¬ld×ÜÊÇ´Ó0x8000000¿ªÊ¼°²ÅųÌÐòµÄ& ......
×¢Òâ×Ô¼ºµÄÄں˰汾 ÓÚ jdk °æ±¾ÎÊÌâ £»»¹ÓÐ ¾ÍÊÇ Òª½âѹµ½ /usr/javaĿ¼Ï ºÜÖØÒª£¬Òª²»È»µÈ×ųԿàÍ·£»
Ò»¡¢ÏÂÔØJDK
×Ô¼ºÏÂÔØ°É£¬²½Öè²»ÓÃдÁË°É£»ÎÒÏÂÔصÄÊÇjdk
-1_6_0_11-linux-i586.bin
¶þ¡¢°²×°
(1)ÔÚusrÏÂн¨Ò»¸öjavaÎļþ¼Ð
#mkdir /usr/java
(2)ÎÒÓõÄWinSCP½«JDK
Îļþ·ÅÈ ......
Linux patchµÄÓ÷¨
http://hi.baidu.com/issaria/blog/item/b04527ec816967d72f2e2184.html
2008-08-14 14:50
Ò²ÐíÖ»ÊÇÎÒÒ»¸öÈ˱Ƚϱ¿£¬Ã¿´ÎÅöµ½bug£¬ËäÈ»ÓÐÈ˸ø³ö²¹¶¡£¨patch£©£¬µ«ÊÇÈ´²»ÖªµÀÔõôʹÓá£Manual Page ( man patch )Ò²Ö»¸ø³ö patch -p(num) <patchfileÕâÑùµÄÓ÷¨£¬¾ßÌåÒ²²»ÖªµÀÔõÑùÈ·¶¨num£¬Èç¹ûÄãÒ²ÓÐ ......