{"id":4725,"date":"2015-03-20T12:59:14","date_gmt":"2015-03-20T10:59:14","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=4725"},"modified":"2015-03-20T12:59:14","modified_gmt":"2015-03-20T10:59:14","slug":"perf-tools-%d0%bd%d0%be%d0%b2%d1%8b%d0%b9-%d0%bd%d0%b0%d0%b1%d0%be%d1%80-%d1%83%d1%82%d0%b8%d0%bb%d0%b8%d1%82-%d0%b4%d0%bb%d1%8f-%d0%b0%d0%bd%d0%b0%d0%bb%d0%b8%d0%b7%d0%b0-%d0%bf%d1%80%d0%be%d0%b8","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=4725","title":{"rendered":"perf-tools &#8211; \u043d\u043e\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0443\u0442\u0438\u043b\u0438\u0442 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 Linux"},"content":{"rendered":"<p>\u0411\u0440\u0435\u043d\u0434\u0430\u043d \u0413\u0440\u0435\u0433 (<a href=\"http:\/\/en.wikipedia.org\/wiki\/Brendan_Gregg\">Brendan Gregg<\/a>), \u043e\u0434\u0438\u043d \u0438\u0437 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 DTrace, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f \u043d\u0430 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 Linux \u0438 <a href=\"http:\/\/www.brendangregg.com\/blog\/2015-03-17\/linux-performance-analysis-perf-tools.html\">\u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0438\u043b<\/a> \u043d\u043e\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0443\u0442\u0438\u043b\u0438\u0442 <a href=\"https:\/\/github.com\/brendangregg\/perf-tools\">perf-tools<\/a>, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c \u044f\u0434\u0440\u0430 Linux perf_events \u0438 ftrace. \u0423\u0442\u0438\u043b\u0438\u0442\u044b \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u043e\u0441\u0442\u0438.<\/p>\n<p><!--more--><\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u0442\u0438\u043b\u0438\u0442\u0430 iosnoop \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0432\u0432\u043e\u0434\/\u0432\u044b\u0432\u043e\u0434 \u0441 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0445 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430\u0445 (latency):<\/p>\n<pre><span style=\"color: #461b7e;\">\r\n# .\/iosnoop\r\nTracing block I\/O... Ctrl-C to end.\r\nCOMM             PID    TYPE DEV      BLOCK        BYTES     LATms\r\nsupervise        1809   W    202,1    17039968     4096       1.32\r\nsupervise        1809   W    202,1    17039976     4096       1.30\r\ntar              14794  RM   202,1    8457608      4096       7.53\r\ntar              14794  RM   202,1    8470336      4096      14.90\r\ntar              14794  RM   202,1    8470368      4096       0.27\r\ntar              14794  RM   202,1    8470784      4096       7.74\r\ntar              14794  RM   202,1    8470360      4096       0.25\r\ntar              14794  RM   202,1    8469968      4096       0.24\r\ntar              14794  RM   202,1    8470240      4096       0.24\r\n<\/span><\/pre>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u044b funccount, funcslower, funcgraph \u0438 functrace \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0432\u044b\u0437\u043e\u0432\u0430\u043c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u043c\u0430\u0441\u043a\u0435:<\/p>\n<pre><span style=\"color: #461b7e;\">\r\n# .\/funccount 'ip*'\r\nTracing \"ip*\"... Ctrl-C to end.\r\nFUNC                              COUNT\r\nip_mc_sf_allow                       70\r\nipv6_chk_mcast_addr                  72\r\nip_finish_output                    108\r\nip_local_out                        108\r\nip_output                           108\r\nip_queue_xmit                       108\r\nipv4_mtu                            216\r\nip_local_deliver                    229\r\nip_local_deliver_finish             229\r\nip_rcv                              229\r\nip_rcv_finish                       229\r\nipv4_dst_check                      513\r\n<\/span><\/pre>\n<p>\u0414\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0435\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u043e\u0441\u0442\u0438, \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 iolatency.<\/p>\n<pre><span style=\"color: #461b7e;\">\r\n# .\/iolatency\r\nTracing block I\/O. Output every 1 seconds. Ctrl-C to end.\r\n&gt;=(ms) .. &lt;(ms) : I\/O |Distribution |\r\n0 -&gt; 1 : 4381 |######################################|\r\n1 -&gt; 2 : 9 |# |\r\n2 -&gt; 4 : 5 |# |\r\n4 -&gt; 8 : 0 | |\r\n8 -&gt; 16 : 1 |# |\r\n<\/span><\/pre>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u044b execsnoop, killsnoop \u0438 opensnoop \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0432\u044b\u0437\u043e\u0432\u0430\u043c exec(), kill() \u0438 open():<\/p>\n<pre><span style=\"color: #461b7e;\">\r\n# .\/execsnoop\r\nTracing exec()s. Ctrl-C to end.\r\nPID PPID ARGS\r\n22898 22004 man ls\r\n22905 22898 preconv -e UTF-8\r\n22908 22898 pager -s\r\n22907 22898 nroff -mandoc -rLL=164n -rLT=164n -Tutf8\r\n22906 22898 tbl\r\n22911 22910 locale charmap\r\n22912 22907 groff -mtty-char -Tutf8 -mandoc -rLL=164n -rLT=164n\r\n22913 22912 troff -mtty-char -mandoc -rLL=164n -rLT=164n -Tutf8\r\n22914 22912 grotty\r\n<\/span><\/pre>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 cachestat \u0432\u044b\u0434\u0430\u0451\u0442 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0439 \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043a\u044d\u0448:<\/p>\n<pre><span style=\"color: #461b7e;\">\r\n# .\/cachestat -t\r\nCounting cache functions... Output every 1 seconds.\r\nTIME HITS MISSES DIRTIES RATIO BUFFERS_MB CACHE_MB\r\n08:28:57 415 0 0 100.0% 1 191\r\n08:28:58 411 0 0 100.0% 1 191\r\n08:28:59 362 97 0 78.9% 0 8\r\n08:29:00 411 0 0 100.0% 0 9\r\n<\/span><\/pre>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 kprobe \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0432\u044b\u0437\u043e\u0432\u0430\u043c:<\/p>\n<pre><span style=\"color: #461b7e;\">\r\n# .\/kprobe p:do_sys_open\r\nTracing kprobe do_sys_open. Ctrl-C to end.\r\nkprobe-26042 [001] d... 6910441.001452: do_sys_open: (do_sys_open+0x0\/0x220)\r\nkprobe-26042 [001] d... 6910441.001475: do_sys_open: (do_sys_open+0x0\/0x220)<\/span><\/pre>\n<p>\u0412\u0437\u044f\u0442\u043e \u0441 opennet.ru<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0411\u0440\u0435\u043d\u0434\u0430\u043d \u0413\u0440\u0435\u0433 (Brendan Gregg), \u043e\u0434\u0438\u043d \u0438\u0437 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 DTrace, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f \u043d\u0430 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 Linux \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0438\u043b \u043d\u043e\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0443\u0442\u0438\u043b\u0438\u0442 perf-tools, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c \u044f\u0434\u0440\u0430 Linux perf_events \u0438 ftrace. \u0423\u0442\u0438\u043b\u0438\u0442\u044b \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u043e\u0441\u0442\u0438.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,10],"tags":[],"class_list":["post-4725","post","type-post","status-publish","format-standard","hentry","category-linux","category-others"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/4725","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4725"}],"version-history":[{"count":1,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/4725\/revisions"}],"predecessor-version":[{"id":4726,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/4725\/revisions\/4726"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}