̽ÌÖLinux ÖÐCPUºÍSysÕ¼ÓÃÒì³£µÄ½â¾ö¼Æ»®
¡¾ÎÊÌ⡿̽ÌÖLinuxÖÐCPUºÍSysÕ¼ÓÃÒì³£µÄ½â¾ö¼Æ»®
ÔÚLinuxϵͳÖУ¬CPUºÍSysÕ¼ÓÃÒì¾³£³£»áÈÃϵͳÔËÐбäµÃ»ºÂý»òÕß²»Îȹ̣¬¸øÓû§´øÀ´À§ÈÅ¡£±¾ÎĽ«Ì½ÌÖÕâЩÒì³£Õ÷ÏóµÄÔµ¹ÊÔÓÉ£¬²¢ÌṩһЩ½â¾ö¼Æ»®£¬Í¬Ê±»á¸ø³öÏêϸµÄ´úÂëʾÀý¡£
CPUÕ¼ÓÃÒì³£
CPUÕ¼ÓÃÒ쳣ͨ³£ÊÇÓÉÓÚÔËÐеÄÀú³Ì¹ý¶à»òÕßij¸öÀú³ÌÕ¼Óùý¶àCPU×ÊÔ´µ¼Öµġ£Òª½â¾öÕâ¸öÎÊÌ⣬¿ÉÒÔͨ¹ýÉó²éϵͳÖÐÔËÐеÄÀú³ÌÒÔ¼°ËüÃǵÄCPUÕ¼ÓÃÇéÐΣ¬È»ºóƾ֤ÐèÒª¾ÙÐе÷½â»òÓÅ»¯¡£
ÒÔÏÂÊÇһЩ³£ÓõÄÏÂÁîÀ´Éó²éCPUÕ¼ÓÃÇéÐÎÒÔ¼°¿¢ÊÂÕ¼Óùý¸ßCPU×ÊÔ´µÄÀú³Ì£º
# Éó²éÄ¿½ñCPUÕ¼ÓÃÇéÐÎ top # Éó²éËùÓÐÀú³ÌµÄCPUÕ¼ÓÃÇéÐÎ ps aux # ¿¢ÊÂÖ¸¶¨Àú³Ì£¨ÆäÖÐPIDΪÀú³ÌID£© kill -9 PID
µÇ¼ºó¸´ÖÆ
ÈôÊÇ·¢Ã÷ij¸öÀú³ÌÒ»Ö±Õ¼ÓøßCPU×ÊÔ´£¬¿ÉÒÔͨ¹ýÒÔÉÏÏÂÁλ²¢¿¢Ê¸ÃÀú³Ì£¬´Ó¶ø½â¾öCPUÕ¼ÓÃÒì³£µÄÎÊÌâ¡£
SysÕ¼ÓÃÒì³£
SysÕ¼ÓÃÒ쳣ͨ³£ÊÇָϵͳŲÓÃÕ¼Óùý¸ßµÄÇéÐΣ¬Õâ¿ÉÄÜÊÇÓÉÓÚϵͳÄÚºËÖеÄij¸öÄ£¿é»òÕßÇý¶¯³ÌÐò·ºÆðÁËÎÊÌâ¡£Òª½â¾öÕâ¸öÎÊÌ⣬¿ÉÒÔʵÑéÉý¼¶ÏµÍ³Äں˻òÕßÐÞ¸´Ïà¹ØµÄÎÊÌâÇý¶¯³ÌÐò¡£
ÒÔÏÂÊÇһЩ³£ÓõÄÏÂÁîÀ´Éó²éϵͳŲÓÃÇéÐÎÒÔ¼°ÊµÑé½â¾öSysÕ¼ÓÃÒì³£µÄÎÊÌ⣺
# Éó²éϵͳŲÓÃÇéÐÎ strace -p PID # ʵÑéÉý¼¶ÏµÍ³ÄÚºË sudo apt-get update sudo apt-get upgrade # ʵÑéÐÞ¸´ÎÊÌâÇý¶¯³ÌÐò sudo modprobe -r driver_module sudo modprobe driver_module
µÇ¼ºó¸´ÖÆ
ͨ¹ýÒÔÉÏÏÂÁî¿ÉÒÔÉó²éϵͳŲÓÃÇéÐΡ¢Éý¼¶ÏµÍ³ÄÚºËÒÔ¼°ÐÞ¸´ÎÊÌâÇý¶¯³ÌÐò£¬´Ó¶ø½â¾öSysÕ¼ÓÃÒì³£µÄÎÊÌâ¡£
×ÛÉÏËùÊö£¬CPUºÍSysÕ¼ÓÃÒì³£ÊÇLinuxϵͳÖг£¼ûµÄÎÊÌ⣬¿ÉÊÇͨ¹ýºÏÀíµÄµ÷½âºÍÓÅ»¯£¬¿ÉÒÔÓÐÓýâ¾öÕâЩÒì³£ÇéÐΡ£Ï£Íû±¾ÎÄÌṩµÄ½â¾ö¼Æ»®ºÍ´úÂëʾÀýÄܹ»×ÊÖú¶ÁÕß½â¾öÏà¹ØÎÊÌ⣬ÌáÉýϵͳµÄÎȹÌÐÔºÍÐÔÄÜ¡£
ÒÔÉϾÍÊÇ̽ÌÖLinux ÖÐCPUºÍSysÕ¼ÓÃÒì³£µÄ½â¾ö¼Æ»®µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡