1Chinese translated version of Documentation/basic_profiling 2 3If you have any comment or update to the content, please post to LKML directly. 4However, if you have problem communicating in English you can also ask the 5Chinese maintainer for help. Contact the Chinese maintainer, if this 6translation is outdated or there is problem with translation. 7 8Chinese maintainer: Liang Xie <xieliang@xiaomi.com> 9--------------------------------------------------------------------- 10Documentation/basic_profilingçä¸æç¿»è¯ 11 12妿æ³è¯è®ºææ´æ°æ¬æçå 容ï¼è¯·ç´æ¥åä¿¡å°LKMLãå¦æä½ ä½¿ç¨è±æäº¤æµæå°é¾çè¯ï¼ä¹å¯ 13以å䏿çç»´æ¤è æ±å©ã妿æ¬ç¿»è¯æ´æ°ä¸åæ¶æè ç¿»è¯åå¨é®é¢ï¼è¯·èç³»ä¸æçç»´æ¤è ã 14 15䏿çç»´æ¤è ï¼ è°¢è¯ Liang Xie <xieliang007@gmail.com> 16䏿çç¿»è¯è ï¼ è°¢è¯ Liang Xie <xieliang007@gmail.com> 17ä¸æçæ ¡è¯è ï¼ 18以ä¸ä¸ºæ£æ 19--------------------------------------------------------------------- 20 21ä¸é¢è¿äºè¯´ææä»¤é½æ¯é常åºç¡çï¼å¦æä½ æ³è¿ä¸æ¥äºè§£è¯·é 读ç¸å ³ä¸ä¸ææ¡£ï¼ï¼ 22请ä¸è¦å卿¬ææ¡£å¢å æ°çå 容ï¼ä½å¯ä»¥ä¿®å¤ææ¡£ä¸çé误ï¼ï¼(mbligh@aracnet.com) 23æè°¢John Levonï¼Dave Hansenç卿°åæ¶çå¸®å© 24 25<test> ç¨äºè¡¨ç¤ºè¦æµéçç®æ 26请å ç¡®ä¿æ¨å·²ç»ææ£ç¡®çSystem.map / vmlinuxé ç½®ï¼ 27 28对äºlinuxç³»ç»æ¥è¯´ï¼é ç½®vmlinuzæå®¹æçæ¹æ³å¯è½å°±æ¯ä½¿ç¨âmake installâï¼ç¶åä¿®æ¹ 29/sbin/installkernelå°vmlinuxæ·è´å°/bootç®å½ï¼èSystem.mapé常æ¯é»è®¤å®è£ 好ç 30 31Readprofile 32----------- 332.6ç³»åå æ ¸éè¦çæ¬ç¸å¯¹è¾æ°çreadprofileï¼æ¯å¦util-linux 2.12aä¸å å«çï¼å¯ä»¥ä»: 34 35http://www.kernel.org/pub/linux/utils/util-linux/ ä¸è½½ 36 37大é¨ålinuxåè¡çå·²ç»å å«äº. 38 39å¯ç¨readprofileéè¦å¨kernelå¯å¨å½ä»¤è¡å¢å âprofile=2â 40 41clear readprofile -r 42 <test> 43dump output readprofile -m /boot/System.map > captured_profile 44 45Oprofile 46-------- 47 48ä»http://oprofile.sourceforge.net/è·åæºä»£ç ï¼è¯·åèChanges以è·åå¹é ççæ¬ï¼ 49å¨kernelå¯å¨å½ä»¤è¡å¢å âidle=pollâ 50 51é ç½®CONFIG_PROFILING=yåCONFIG_OPROFILE=yç¶åéå¯è¿å ¥æ°kernel 52 53./configure --with-kernel-support 54make install 55 56æ³å¾å°å¥½çæµéç»æï¼è¯·ç¡®ä¿å¯ç¨äºæ¬å°APICç¹æ§ã妿opreportæ¾ç¤ºæ0Hz CPUï¼ 57说æAPICç¹æ§æ²¡æå¼å¯ãå¦å¤æ³¨æidle=pollé项å¯è½æææ§è½ã 58 59One time setup: 60 opcontrol --setup --vmlinux=/boot/vmlinux 61 62clear opcontrol --reset 63start opcontrol --start 64 <test> 65stop opcontrol --stop 66dump output opreport > output_file 67 68妿åªçkernelç¸å ³çæ¥åç»æï¼è¯·è¿è¡å½ä»¤ opreport -l /boot/vmlinux > output_file 69 70éè¿reseté项å¯ä»¥æ¸ çè¿æç»è®¡æ°æ®ï¼ç¸å½äºéå¯çææã 71 72

