LINUX¼ÆËãCPU¡¢ÄÚ´æµÄʹÓÃÂÊ
"procÎļþϵͳÊÇÒ»¸öαÎļþϵͳ£¬ËüÖ»´æÔÚÄÚ´æµ±ÖУ¬¶ø²»Õ¼ÓÃÍâ´æ¿Õ¼ä¡£ËüÒÔÎļþϵͳµÄ·½Ê½Îª·ÃÎÊϵͳÄÚºËÊý¾ÝµÄ²Ù×÷Ìṩ½Ó¿Ú¡£Óû§ºÍÓ¦ÓóÌÐò¿ÉÒÔͨ¹ýprocµÃµ½ÏµÍ³µÄÐÅÏ¢£¬²¢¿ÉÒԸıäÄں˵ÄijЩ²ÎÊý¡£"
ÕâÀォ½éÉÜÈçºÎ´Ó/procÎļþϵͳÖлñÈ¡Óë·À»ðǽÏà¹ØµÄһЩÐÔÄܲÎÊý£¬ÒÔ¼°ÈçºÎͨ¹ý/procÎļþϵͳÐÞ¸ÄÄں˵ÄÏà¹ØÅäÖá£
1¡¢´Ó/procÎļþϵͳ»ñÈ¡Ïà¹ØµÄÐÔÄܲÎÊý
cpuʹÓÃÂÊ£º /proc/stat
ÄÚ´æÊ¹ÓÃÇé¿ö£º /proc/meminfo
ÍøÂç¸ºÔØÐÅÏ¢£º /proc/net/dev
ÏàÓ¦µÄ¼ÆËã·½·¨£º(Õª×Ô£ºÊ²Ã´ÊÇprocÎļþϵͳ£¬¼û²Î¿¼×ÊÁÏ)
£¨1£© ´¦ÀíÆ÷ʹÓÃÂÊ
£¨2£© ÄÚ´æÊ¹ÓÃÂÊ
£¨3£© Á÷ÈëÁ÷³öÊý¾Ý°ü
£¨4£© ÕûÌåÍøÂç¸ºÔØ
ÕâЩÊý¾Ý·Ö±ðÒª´Ó/proc/stat¡¢/proc/net/dev¡¢/proc/meminfoÈý¸öÎļþÖÐÌáÈ¡¡£ÈçÀïÓÐÎÊÌâ»ò¶ÔÒªÌáÈ¡µÄÊý¾Ý²»Ì«Çå³þ£¬¿ÉÒÔʹÓÃman procÀ´²é¿´procÎļþϵͳµÄÁª»úÊֲᡣ
£¨1£© ´¦ÀíÆ÷ʹÓÃÂÊ
ÕâÀïÒª´Ó/proc/statÖÐÌáÈ¡ËĸöÊý¾Ý£ºÓû§Ä£Ê½£¨user£©¡¢µÍÓÅÏȼ¶µÄÓû§Ä£Ê½£¨nice£©¡¢ÄÚºËģʽ£¨system£©ÒÔ¼°¿ÕÏеĴ¦ÀíÆ÷ʱ¼ä£¨idle£©¡£ËüÃǾùλÓÚ/proc/statÎļþµÄµÚÒ»ÐС£CPUµÄÀûÓÃÂÊʹÓÃÈçϹ«Ê½À´¼ÆËã¡£
CPUÀûÓÃÂÊ = 100 *£¨user + nice + system£©/£¨user + nice + system + idle£©
£¨2£© ÄÚ´æÊ¹ÓÃÂÊ
ÕâÀïÐèÒª´Ó/proc/meminfoÎļþÖÐÌáÈ¡Á½¸öÊý¾Ý£¬µ±Ç°ÄÚ´æµÄʹÓÃÁ¿(cmem)ÒÔ¼°ÄÚ´æ×ÜÁ¿(amem)¡£
ÄÚ´æÊ¹ÓÃ°Ù·Ö±È = 100 * (cmem /&
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌá¹©ÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
ÓÐÐí¶àÊ£¬ÐèÒª»Øµ½u-boot²ÅÄÜ˵Çå³þ……
include\configs\XXXX.hÖУ¨XXXXÊÓ¾ßÌåÆ½Ì¨¶ø¶¨£©£¬Ò»°ã»á×÷ÀàËÆÈç϶¨Ò壺
#define CONFIG_BOOTCOMMAND "mmcinit; fatload mmc 0 0x81c00000 uImage; bootm 0x81c00000"
±àÒëʱ¸ÃºêCONFIG_BOOTCOMMAND´«µÝ¸øÒ»¸öENVÏîbootcmd£¬¶øÔÚcommon\main.cÖУ¬º¯Êýmain_loopÈ ......
Linuxϲ鿴CPUʹÓÃÂÊ!
2008Äê03ÔÂ20ÈÕ ÐÇÆÚËÄ ÏÂÎç 07:02
¡¡¡¡ÔÚϵͳά»¤µÄ¹ý³ÌÖУ¬ËæÊ±¿ÉÄÜÓÐÐèÒª²é¿´ CPU ʹÓÃÂÊ£¬²¢¸ù¾ÝÏàÓ¦ÐÅÏ¢·ÖÎöϵͳ״¿öµÄÐèÒª¡£ÔÚ CentOS ÖУ¬¿ÉÒÔͨ¹ý top ÃüÁîÀ´²é¿´ CPU ʹÓÃ×´¿ö¡£ÔËÐÐ top ÃüÁîºó£¬CPU ʹÓÃ״̬»áÒÔÈ«ÆÁµÄ·½Ê½ÏÔʾ£¬²¢ÇһᴦÔÚ¶Ô»°µÄģʽ -- ÓûùÓÚ top µÄÃüÁ¿ÉÒÔ¿ØÖÆÏÔ ......
New things to learn about Linux Scheduler):
1. Rotating Staircase Deadline cpu scheduler policy
2. CFS (Completely Fair Scheduler)
3. BFS (Brain Fuck Scheduler)
http://lwn.net/Articles/
http://kerneltrap.org/
......