linux /proc/stat Îļþ½éÉܼ°Ó¦ÓÃ
Ò»
°ãÀ´Ëµ¶ÔÓÚÐèÒª´óÁ¿cpu¼ÆËãµÄ½ø³Ì£¬µ±Ç°¶ËѹÁ¦Ô½´óʱ£¬CPUÀûÓÃÂÊÔ½¸ß¡£µ«¶ÔÓÚI/OÍøÂçÃܼ¯Ð͵Ľø³Ì£¬¼´Ê¹ÇëÇóºÜ¶à£¬·þÎñÆ÷µÄCPUÒ²²»Ò»¶¨ºÜµ½£¬
ÕâʱµÄ·þÎñÆ¿¾±Ò»°ãÊÇÔÚ´ÅÅ̵ÄI/OÉÏ¡£±È½Ï³¤¼ûµÄ¾ÍÊÇ£¬´óÎļþƵ·±¶ÁдµÄcpu¿ªÏúԶСÓÚСÎļþƵ·±¶ÁдµÄ¿ªÏú¡£ÒòΪÔÚI/OÍÌÍÂÁ¿Ò»¶¨Ê±£¬Ð¡ÎļþµÄ¶Á
д¸ü¼ÓƵ·±£¬ÐèÒª¸ü¶àµÄcpuÀ´´¦ÀíI/OµÄÖжϡ£
ÔÚLinux/UnixÏ£¬CPUÀûÓÃÂÊ·ÖΪÓû§Ì¬£¬ÏµÍ³Ì¬ºÍ¿ÕÏÐ̬£¬·Ö±ð±íʾCPU´¦ÓÚÓû§Ì¬Ö´ÐеÄʱ¼ä£¬ÏµÍ³ÄÚºËÖ´ÐеÄʱ¼ä£¬ºÍ¿ÕÏÐϵͳ½ø³ÌÖ´ÐеÄʱ¼ä¡£Æ½Ê±Ëù˵µÄCPUÀûÓÃÂÊÊÇÖ¸£º
CPUÖ´ÐзÇϵͳ¿ÕÏнø³ÌµÄʱ¼ä / CPU×ܵÄÖ´ÐÐʱ¼ä¡£
ÔÚ
LinuxµÄÄÚºËÖУ¬ÓÐÒ»¸öÈ«¾Ö±äÁ¿£ºJiffies¡£
Jiffies´ú±íʱ¼ä¡£ËüµÄµ¥Î»ËæÓ²¼þƽ̨µÄ²»Í¬¶ø²»Í¬¡£ÏµÍ³ÀﶨÒåÁËÒ»¸ö³£ÊýHZ£¬´ú±íÿÃëÖÖ×îСʱ¼ä¼ä¸ôµÄÊýÄ¿¡£ÕâÑùjiffiesµÄµ¥Î»¾ÍÊÇ
1/HZ¡£Intelƽ̨jiffiesµÄµ¥Î»ÊÇ1/100Ã룬Õâ¾ÍÊÇϵͳËùÄÜ·Ö±æµÄ×îСʱ¼ä¼ä¸ôÁË¡£Ã¿¸öCPUʱ¼äƬ£¬Jiffies¶¼Òª¼Ó1¡£
CPUµÄÀûÓÃÂʾÍÊÇÓÃÖ´ÐÐÓû§Ì¬+ϵͳ̬µÄJiffies³ýÒÔ×ܵÄJifffiesÀ´±íʾ¡£
ÔÚLinuxϵͳÖУ¬¿ÉÒÔÓÃ/proc/statÎļþÀ´¼ÆËãcpuµÄÀûÓÃÂÊ(ÏêϸµÄ½âÊͿɲο¼£ºhttp://www.linuxhowtos.org/System/procstat.htm
)¡£Õâ¸öÎļþ°üº¬ÁËËùÓÐCPU»î¶¯µÄÐÅÏ¢£¬¸ÃÎļþÖеÄËùÓÐÖµ¶¼ÊÇ´ÓϵͳÆô¶¯¿ªÊ¼ÀۼƵ½µ±Ç°Ê±¿Ì¡£
È磺
[sailorhzr@builder ~]$ cat /proc/stat
cpu 432661 13295 86656 422145968 171474 233 5346
cpu0 123075 2462 23494 105543694 16586 0 4615
cpu1 111917 4124 23858 105503820 69697 123 371
cpu2 103164 3554 21530 105521167 64032 106 334
cpu3 94504 3153 17772 105577285 21158 4 24
intr 1065711094 1057275779 92 0 6 6 0 4 0 3527 0 0 0 70 0 20 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 7376958 0 0 0 0 0 0 0 1054602 0 0 0 0 0 0 0 30 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
ctxt 19067887
btime 1139187531
processes 270014
procs_running 1
procs_blocked 0
Êä³ö½âÊÍ
CPU ÒÔ¼°
Ïà¹ØÎĵµ£º
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
USB Äںˣ¨USBÇý¶¯£¬USBD £©´¦ÓÚϵͳµÄÖÐÐÄ£¬¶ÔÓÚËü½øÐÐÑо¿ÊÇÄܹ»½øÐÐUSBÇý¶¯¿ª·¢£¨°üÀ¨¿Í»§Çý¶¯ºÍÖ÷»úÇý¶¯£©µÄµÚÒ»²½¡£ËüΪ¿Í»§¶ËÇý¶¯ºÍÖ÷»ú¿ØÖÆÆ÷Çý¶¯ÌṩÁËÖ÷ÒªÊý¾Ý½á¹¹ºÍ½Ó¿Úº¯Êý£¬Ö÷ÒªÓÐËÄÀ๦ÄÜ£º¿Í»§¶ËÇý¶¯¹ÜÀí£¬USBÉ豸µÄÅäÖú͹ÜÀí£¬Ö÷»ú¿ØÖÆÆ÷µÄ¹ÜÀí£¬ÐÒé¿ØÖÆÃüÁºÍÊý¾Ý´«ÊäµÄ¹ÜÀí¡£¾ßÌå´úÂëÖ÷Òª¼¯ÖÐÔÚ linux ......
if you come from the world of Windows, you undoubtedly understand the concept of a shortcut. In the Linux world, shortcuts do exist, but they're generally referred to as symbolic links, or symlinks. They are so named because, like shortcuts, a symlink is really just a symbolic placeholder or link to ......
¡¡¡¡Ê¹Óà Squid ´úÀí·þÎñÆ÷
¡¡¡¡Squid ÊÇÒ»ÖÖ´úÀí·þÎñÆ÷£¬ËüʵÏÖÁË¶Ô HTTP¡¢FTP ºÍ Gopher ÐÒéµÄ»º´æ¡£Squid Äܹ»Ê¹Ó÷ÃÎÊ¿ØÖÆÁÐ±í£¨Access Control List£¬ACL£©À´ÔÊÐí»ò¾Ü¾ø·ÃÎÊ¡£Squid ¾ß±¸Ç¿´óµÄ¿ÉÅäÖÃÄÜÁ¦ÒÔ¼°Â³°ôÐÔ£¬¶øÇÒÓû§»á·¢ÏÖ£¬¸ÃÈí¼þ·Ç³£ÈÝÒ×ѧϰ¡£¸üºÃµÄÊÇ£¬¿É½« Squid ÅäÖÃΪ͸Ã÷´úÀí£¬¼´ºÃÏñÓû§¸ù±¾²» ......
Gcc¼ò½é
LinuxϵͳϵÄgcc£¨GNU C Compiler£©ÊÇGNUÍƳöµÄ¹¦ÄÜÇ¿´ó¡¢ÐÔÄÜÓÅÔ½µÄ¶àƽ̨±àÒëÆ÷£¬ÊÇGNUµÄ´ú±í×÷Æ·Ö®Ò»¡£gccÊÇ¿ÉÒÔÔÚ¶àÖÖÓ²Ìåƽ̨ÉϱàÒë³ö¿ÉÖ´ÐгÌÐòµÄ³¬¼¶±àÒëÆ÷£¬ÆäÖ´ÐÐЧÂÊÓëÒ»°ãµÄ±àÒëÆ÷Ïà±Èƽ¾ùЧÂÊÒª¸ß20%~30%¡£
gcc ±àÒëÆ÷Äܽ«C¡¢C++ÓïÑÔÔ´³ÌÐò¡¢»ã³Ìʽ»¯ÐòºÍÄ¿±ê³ÌÐò±àÒë¡¢Á¬½Ó³É¿ÉÖ´ÐÐÎļþ£¬Èç¹ûûÓи ......