LinuxϵͳÐÔÄÜÖ¸±ê½éÉÜ
http://andrew913.javaeye.com/blog/431259
Àí½âLinuxµ÷ÓŲÎÊý
ÔÚÎÒÃǽéÉÜLinuxϵͳµÄ¸÷ÖÖµ÷ÓŲÎÊýºÍÐÔÄܼà²â¹¤¾ß֮ǰ£¬ÐèÒªÏÈÌÖÂÛһЩ¹ØÓÚÐÔÄܵ÷ÓŵIJÎÊý¡£ÒòΪLinuxÊÇÒ»¸ö¿ªÔ´²Ù×÷ϵͳ£¬ËùÒÔÓÖ´óÁ¿¿ÉÓõÄÐÔÄܼà²â¹¤¾ß¡£¶ÔÕâЩ¹¤¾ßµÄÑ¡ÔñÈ¡¾öÓÚÄãµÄ¸öÈËϲºÃºÍ¶ÔÊý¾Ýϸ½ÚµÄÒªÇó¡£ËùÓеÄÐÔÄܼà²â¹¤¾ß¶¼ÊÇ°´ÕÕͬÑùµÄ¹æÔòÀ´¹¤×÷µÄ£¬ËùÒÔÎÞÂÛÄãʹÓÃÄÄÖÖ¼à²â¹¤¾ß¶¼ÐèÒªÀí½âÕâЩ²ÎÊý¡£ÏÂÃæÁгöÁËһЩÖØÒªµÄ²ÎÊý£¬ÓÐЧµÄÀí½âËüÃÇÊǺÜÓÐÓô¦µÄ¡£
£¨1£©´¦ÀíÆ÷²ÎÊý
CPU utilization
ÕâÊÇÒ»¸öºÜ¼òµ¥µÄ²ÎÊý£¬ËüÖ±¹ÛµÄÃèÊöÁËÿ¸öCPUµÄÀûÓÃÂÊ¡£ÔÚxSeries¼Ü¹¹ÖУ¬Èç¹ûCPUµÄÀûÓÃÂʳ¤Ê±¼äµÄ³¬¹ý80£¥£¬¾Í¿ÉÄÜÊdzöÏÖÁË´¦ÀíÆ÷µÄÆ¿¾±¡£
Runable processes
Õâ¸öÖµÃèÊöÁËÕýÔÚ×¼±¸±»Ö´ÐеĽø³Ì£¬ÔÚÒ»¸ö³ÖÐøʱ¼äÀïÕâ¸öÖµ²»Ó¦¸Ã³¬¹ýÎïÀíCPUÊýÁ¿µÄ10±¶£¬·ñÔòCPU·½Ãæ¾Í¿ÉÄÜ´æÔÚÆ¿¾±¡£
Blocked
ÃèÊöÁËÄÇЩÒòΪµÈ´ýI/O²Ù×÷½áÊø¶ø²»Äܱ»Ö´ÐеĽø³Ì£¬Blocked¿ÉÄÜÖ¸³öÄãÕýÃæÁÙI/OÆ¿¾±¡£
User time
ÃèÊöÁË´¦ÀíÓû§½ø³ÌµÄ°Ù·Ö±È£¬°üÀ¨nice time¡£Èç¹ûUser timeµÄÖµºÜ¸ß£¬ËµÃ÷ϵͳÐÔÄÜÓÃÔÚ´¦Àíʵ¼ÊµÄ¹¤×÷¡£
System time
ÃèÊöÁËCPU»¨·ÑÔÚ´¦ÀíÄں˲Ù×÷°üÀ¨IRQºÍÈí¼þÖжÏÉÏÃæµÄ°Ù·Ö±È¡£Èç¹ûsystem timeºÜ¸ß˵Ã÷ϵͳ¿ÉÄÜ´æÔÚÍøÂç»òÕßÇý¶¯¶ÑÕ»·½ÃæµÄÆ¿¾±¡£Ò»¸öϵͳͨ³£Ö»»¨·ÑºÜÉÙµÄʱ¼äÈ¥´¦ÀíÄں˵IJÙ×÷¡£
Idle time
ÃèÊöÁËCPU¿ÕÏеİٷֱȡ£
Nice time
ÃèÊöÁËCPU»¨·ÑÔÚ´¦Àíre-nicing½ø³ÌµÄ°Ù·Ö±È¡£
Context switch
ϵͳÖÐÏß³ÌÖ®¼ä½øÐн»»»µÄÊýÁ¿¡£
Waiting
CPU»¨·ÑÔڵȴýI/O²Ù×÷ÉϵÄ×Üʱ¼ä£¬ÓëblockedÏàËÆ£¬Ò»¸öϵͳ²»Ó¦¸Ã»¨·ÑÌ«¶àµÄʱ¼äÔڵȴýI/O²Ù×÷ÉÏ£¬·ñÔòÄãÓ¦¸Ã½øÒ»²½¼ì²âI/O×ÓϵͳÊÇ·ñ´æÔÚÆ¿¾±¡£
Interrupts
InterruptsÖµ°üÀ¨Ó²InterruptsºÍÈíInterrupts£¬Ó²Interrupts»á¶ÔϵͳÐÔÄÜ´øÀ´¸ü¶àµÄ²»ÀûÓ°Ïì¡£¸ßµÄInterruptsÖµÖ¸³öϵͳ¿ÉÄÜ´æÔÚÒ»¸öÈí¼þµÄÆ¿¾±£¬¿ÉÄÜÊÇÄں˻òÕßÇý¶¯³ÌÐò¡£×¢ÒâInterruptsÖµÖаüÀ¨CPUʱÖÓµ¼ÖµÄÖжϣ¨ÏÖ´úµÄxServerϵͳÿÃë1000¸öInterruptsÖµ£©¡£
£¨2£©ÄÚ´æ²ÎÊý
Free memory
Ïà±ÈÆäËû²Ù×÷ϵͳ£¬Linux¿ÕÏÐÄÚ´æµÄÖµ²»Ó¦¸Ã×öΪһ¸öÐÔÄܲο¼µÄÖØÒªÖ¸±ê£¬ÒòΪ¾ÍÏñÎÒÃÇ֮ǰÌáµ½¹ýµÄ£¬LinuxÄں˻á·ÖÅä´óÁ¿Ã»Óб»Ê¹ÓõÄÄÚ´æ×÷ΪÎļþϵͳµÄ»º´æ£¬ËùÒÔÕâ¸öֵͨ³£¶¼±È½ÏС¡£
Swap usage
Õâ¸öÖµÃèÊöÁËÒѾ±»Ê¹ÓõÄswap¿Õ¼ä¡£Swap usageÖ»±íʾÁËLinux¹ÜÀíÄÚ´æµÄÓÐЧÐÔ¡£¶Ôʶ±ðÄÚ´æÆ¿¾±À´Ëµ£¬Swap In/Out²ÅÊÇÒ»¸ö±È½ÏÓÖ
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
1. Òý×Ó
int a;
int size = 8;
Èç¹ûÈÃaΪ(size =8)µÄÕûÊý±¶±íʾ³É¶þ½øÖÆÓ¦ÊÇʲôÑù×ÓÄØ£¿ÄǾÍÊÇÈÃÕâ¸öÊý±íʾ³É¶þ½øÖÆʱµÄ×îºóÈýλΪ0.
¶øÒª´ïµ½ÕâһĿ±ê£¬Ö»ÒªÏÂÃæÕâ¸öÊýÓëËü½øÐÐÓëÔËËã¾Í¿ÉÒÔÁË:
11111111 11111111 11111111 11111000
¶øÉÏÃæÕâ¸öÊýʵ¼ÊϾÍÊ ......
Linux Òýµ¼¹ý³ÌÄÚÄ»
Òýµ¼ Linux® ϵͳµÄ¹ý³Ì°üÀ¨ºÜ¶à½×¶Î¡£²»¹ÜÄúÊÇÒýµ¼Ò»¸ö±ê×¼µÄ x86 ×ÀÃæϵͳ£¬»¹ÊÇÒýµ¼Ò»Ì¨Ç¶ÈëʽµÄ PowerPC® »úÆ÷£¬ºÜ¶àÁ÷³Ì¶¼¾ªÈ˵ØÏàËÆ¡£±¾ÎĽ«Ì½Ë÷ Linux µÄÒýµ¼¹ý³Ì£¬´Ó×î³õµÄÒýµ¼µ½Æô¶¯µÚÒ»¸öÓû§¿Õ¼äÓ¦ÓóÌÐò¡£ÔÚ±¾ÎĽéÉܵĹý³ÌÖУ¬Äú½«Ñ§Ï°µ½¸÷ÖÖÓëÒýµ¼ÓйصÄÖ÷Ì⣬ ......
ÔÎÄÍøÖ·£ºhttp://blog.chinaunix.net/u1/51562/showart_1341707.html
Ò»:Ç°ÑÔ
RCU»úÖƳöÏֵıȽÏÔç,Ö»ÊÇÔÚlinux kernelÖÐÒ»Ö±µ½2.5°æ±¾µÄʱºò²Å±»²ÉÓÃ.¹ØÓÚRCU»úÖÆ,ÕâÀï¾Í²»×ö¹ý¶àµÄ½éÉÜÁË,ÍøÉÏÓкܶàÓйØRCU½éÉܺÍʹÓõÄÎĵµ.Çë×ÔÐвéÔÄ.±¾ÎÄÖ÷ÒªÊÇ´Ólinux kernelÔ´´úÂëµÄ½Ç¶È.À´·ÖÎöRCUµÄʵÏÖ.
ÔÚÌÖÂÛRCUµÄʵ ......
Chapter 1: Thread
¢Ù thread functions
1. pthread_self();
2. thread existing
you can get the value of rval_ptr just by pthread_join(pthread_t tht, void ** rval_ptr)
cancel a thread as the thread exits with PTHREAD_CANCELED in pthread_exit, this functio ......