OSã¬ãã«ã§ sys ã®CPU使ç¨çãé«ãå ´åã« perf*1 ã使ã£ã¦ãä½ã®å¦çã®å²åãé«ãã調ã¹ãæ¹æ³ã§ãã perf 㯠ç¹å®ã®ããã»ã¹ã ãã§ãªãOSå ¨ä½ã®çµ±è¨ãè¦ãã ã«ã¼ãã«ï¼sysï¼ã¨ã¦ã¼ã¶ã¼ï¼userï¼ã®ä¸¡æ¹ãè¦ãã ã¨ãããé常ã«ä¾¿å©ã ã¨æã*2ã æºå ã²ããã write ã·ã¹ãã ã³ã¼ã«ãçºè¡ãç¶ããããã°ã©ã ãä½æãã $ cat write_loop.c #include <unistd.h> int main(void) { while(1) { write(1, "foo\n", 4); } } ã³ã³ãã¤ã«ãã $ gcc write_loop.c -o write_loop å®è¡æ¨©éãä»ä¸ãã $ chmod u+x write_loop æ¤è¨¼ ã²ãããwriteã·ã¹ãã ã³ã¼ã«ãçºè¡ããããã°ã©ã ãå®è¡ãã $ ./write_loop > /dev/null
{{#tags}}- {{label}}
{{/tags}}