linux½ø³Ì״̬dzÎö
ÖÚËùÖÜÖª£¬ÏÖÔڵķÖʱ²Ù×÷ϵͳÄܹ»ÔÚÒ»¸öCPUÉÏÔËÐжà¸ö³ÌÐò£¬ÈÃÕâЩ³ÌÐò±íÃæÉÏ¿´ÆðÀ´ÊÇÔÚͬʱÔËÐеġ£linux¾ÍÊÇÕâÑùµÄÒ»¸ö²Ù×÷ϵͳ¡£
¡¡¡¡ÔÚlinuxϵͳÖУ¬Ã¿¸ö±»ÔËÐеijÌÐòʵÀý¶ÔÓ¦Ò»¸ö»ò¶à¸ö½ø³Ì¡£linuxÄÚºËÐèÒª¶ÔÕâЩ½ø³Ì½øÐйÜÀí£¬ÒÔʹËüÃÇÔÚϵͳÖГͬʱ”ÔËÐС£
linuxÄں˶Խø³ÌµÄÕâÖÖ¹ÜÀí·ÖÁ½¸ö·½Ã棺½ø³Ì״̬¹ÜÀí£¬ºÍ½ø³Ìµ÷¶È¡£±¾ÎÄÖ÷Òª½éÉܽø³Ì״̬¹ÜÀí£¬½ø³Ìµ÷¶È¼û¡¶linux½ø³Ìµ÷¶ÈdzÎö¡·¡£
¡¡¡¡½ø³Ì״̬
¡¡¡¡ÔÚlinuxÏ£¬Í¨¹ýpsÃüÁîÎÒÃÇÄܹ»²é¿´µ½ÏµÍ³ÖдæÔڵĽø³Ì£¬ÒÔ¼°ËüÃǵÄ״̬£º
¡¡¡¡R (TASK_RUNNING)£¬¿ÉÖ´ÐÐ״̬¡£
¡¡¡¡Ö»ÓÐÔÚ¸Ã״̬µÄ½ø³Ì²Å¿ÉÄÜÔÚCPUÉÏÔËÐС£¶øͬһʱ¿Ì¿ÉÄÜÓжà¸ö½ø³Ì´¦ÓÚ¿ÉÖ´ÐÐ״̬£¬ÕâЩ½ø³ÌµÄtask_struct½á¹¹£¨½ø³Ì¿ØÖƿ飩±»·Å
Èë¶ÔÓ¦
CPUµÄ¿ÉÖ´ÐжÓÁÐÖУ¨Ò»¸ö½ø³Ì×î¶àÖ»ÄܳöÏÖÔÚÒ»¸öCPUµÄ¿ÉÖ´ÐжÓÁÐÖУ©¡£½ø³Ìµ÷¶ÈÆ÷µÄÈÎÎñ¾ÍÊÇ´Ó¸÷¸öCPUµÄ¿ÉÖ´ÐжÓÁÐÖзֱðÑ¡ÔñÒ»¸ö½ø³ÌÔÚ¸ÃCPU
ÉÏÔËÐС£
¡¡¡¡Ö»Òª¿ÉÖ´ÐжÓÁв»Îª¿Õ£¬Æä¶ÔÓ¦µÄCPU¾Í²»ÄÜ͵ÀÁ£¬¾ÍÒªÖ´ÐÐÆäÖÐij¸ö½ø³Ì¡£Ò»°ã³Æ´ËʱµÄCPU“æµ”¡£¶ÔÓ¦µÄ£¬CPU“¿ÕÏД¾ÍÊÇÖ¸Æä¶ÔÓ¦µÄ
¿ÉÖ´ÐжÓÁÐΪ¿Õ£¬ÒÔÖÂÓÚCPUÎÞÊ¿É×ö¡£
¡¡¡¡ÓÐÈËÎÊ£¬ÎªÊ²Ã´ËÀÑ»·³ÌÐò»áµ¼ÖÂCPUÕ¼ÓøßÄØ£¿ÒòΪËÀÑ»·³ÌÐò»ù±¾ÉÏ×ÜÊÇ´¦ÓÚTASK_RUNNING״̬£¨½ø³Ì´¦ÓÚ¿ÉÖ´ÐжÓÁÐÖУ©¡£³ý·ÇÒ»
Щ·Ç³£¼«¶ËÇé¿ö£¨±ÈÈçϵͳÄÚ´æÑÏÖؽôȱ£¬µ¼Ö½ø³ÌµÄijЩÐèҪʹÓõÄÒ³Ãæ±»»»³ö£¬²¢ÇÒÔÚÒ³ÃæÐèÒª»»ÈëʱÓÖÎÞ·¨·ÖÅäµ½ÄÚ´æ……£©£¬·ñÔòÕâ¸ö½ø³Ì²»»á˯Ãß¡£ËùÒÔ
CPUµÄ¿ÉÖ´ÐжÓÁÐ×ÜÊDz»Îª¿Õ£¨ÖÁÉÙÓÐÕâô¸ö½ø³Ì´æÔÚ£©£¬CPUÒ²¾Í²»»á“¿ÕÏД¡£
¡¡¡¡ºÜ¶à²Ù×÷ϵͳ½Ì¿ÆÊ齫ÕýÔÚCPUÉÏÖ´ÐеĽø³Ì¶¨ÒåΪRUNNING״̬¡¢¶ø½«¿ÉÖ´Ðе«ÊÇÉÐδ±»µ÷¶ÈÖ´ÐеĽø³Ì¶¨ÒåΪREADY״̬£¬ÕâÁ½ÖÖ״̬
ÔÚlinuxÏÂͳһΪ TASK_RUNNING״̬¡£
¡¡¡¡S (TASK_INTERRUPTIBLE)£¬¿ÉÖжϵÄ˯Ãß״̬¡£
¡¡¡¡´¦ÓÚÕâ¸ö״̬µÄ½ø³ÌÒòΪµÈ´ýijijʼþµÄ·¢Éú£¨±ÈÈçµÈ´ýsocketÁ¬½Ó¡¢µÈ´ýÐźÅÁ¿£©£¬¶ø±»¹ÒÆð¡£ÕâЩ½ø³ÌµÄtask_struct½á¹¹±»·ÅÈë
¶ÔӦʼþµÄµÈ´ý¶ÓÁÐÖС£µ±ÕâЩʼþ·¢Éúʱ£¨ÓÉÍⲿÖжϴ¥·¢¡¢»òÓÉÆäËû½ø³Ì´¥·¢£©£¬¶ÔÓ¦µÄµÈ´ý¶ÓÁÐÖеÄÒ»¸ö»ò¶à¸ö½ø³Ì½«±»»½ÐÑ¡£
¡¡¡¡Í¨¹ýpsÃüÁîÎÒÃǻῴµ½£¬Ò»°ãÇé¿öÏ£¬½ø³ÌÁбíÖеľø´ó¶àÊý½ø³Ì¶¼´¦ÓÚTASK_INTERRUPTIBLE״̬£¨³ý·Ç»úÆ÷µÄ¸ºÔغܸߣ©¡£±Ï¾¹
CPU¾ÍÕâôһÁ½¸ö£¬½ø³Ì¶¯éü¼¸Ê®ÉÏ°Ù¸ö£¬Èç¹û²»ÊǾø´ó¶àÊý½ø³Ì¶¼ÔÚ˯Ãߣ¬CPUÓ
Ïà¹ØÎĵµ£º
×î½üÔÚ¿´Ò»¸ö¿ªÔ´µÄ´úÂ룬һ¶Î´úÂë¿´Á˺ܾö¼Ã»Óп´¶®£¬GoogleÁËһϣ¬¾¡È»ÊÇlinuxÖÐÁ´±íµÄ±éÀú¡£
±éÀúÁ´±í£º
±éÀúÁ´±ílist_for_eachÊÇÒ»¸öºê£¬Õ¹¿ªÁ˾ÍÊÇÒ»¸öforÑ»·
#define list_for_each(pos, head) \
for (pos = (head)->next; prefetch(pos->next), pos != ( ......
LinuxÖն˻·¾³Ï£¬ÀûÓÃÖÕ¶ËÃüÁîÐòÁпÉÒÔÉèÖÃ×ÖÌåµÄÑÕÉ«£¬Æä¸ñʽÈçÏ£º
<ESC>[<C1>;<C2>;<C3>m
ÆäÖÐ<ESC>µÄֵΪ ......
Covtool
ÊÇÒ»¸öÓöÔ
C++
´úÂë½øÐÐÔËÐÐʱ¸²¸ÇÂʼì²éµÄ¹¤¾ß£¬¿ÉÒÔÒÔÐÐΪµ¥Î»¼ì²é³öÄÇЩ´úÂëÔÚÔËÐÐÖб»Ê¹Óã¬ÄÇЩûÓÐʹÓá£
1.
°²×°
make
make tests
make install
½«
/usr/local/covtool
Ìí¼Óµ½
PATH
½«
/usr/local/covtools
Ìí¼Óµ½
MANPATH£¨´Ë²½ºÜÖØÒª£¬ËüµÄman±ÈÎ ......
£¨1£©Óû§Ä£Ê½USB
usbfsÐéÄâÎļþϵͳÔÊÐí´ÓÓû§¿Õ¼äÒÔÔʼ·½Ê½·ÃÎÊUSBÉ豸¡£usbfsͨ³£¹ÒÔØÔÚ/proc/bus/usb/ÉÏ£¬usbfsÊ÷°üº¬ÁËϵͳÖÐÓëÿ¸öUSB¿ØÖÆÆ÷£¨»ò×ÜÏߣ©¶ÔÓ¦µÄĿ¼£¬Ã¿¸öĿ¼ÒÀ´Î°üº¬ÁËÓë¸Ã×ÜÏßÉϵÄUSBÉ豸Ïà¶ÔÓ¦µÄ½áµã¡£
ΪÁ˸üºÃµØÀí½âusbfs£¬ÎÒà ......