{"id":211,"date":"2010-01-10T23:57:15","date_gmt":"2010-01-10T13:57:15","guid":{"rendered":"http:\/\/anton.ozlabs.org\/blog\/?p=211"},"modified":"2010-10-21T09:13:29","modified_gmt":"2010-10-20T23:13:29","slug":"using-perf-the-linux-performance-analysis-tool-on-ubuntu-karmic","status":"publish","type":"post","link":"https:\/\/anton.ozlabs.org\/blog\/2010\/01\/10\/using-perf-the-linux-performance-analysis-tool-on-ubuntu-karmic\/","title":{"rendered":"Using perf, the Linux Performance Analysis tool on Ubuntu Karmic"},"content":{"rendered":"<p>A lot has been going on with Linux performance counters (now called performance events), but there is enough functionality in the 2.6.31 kernel that ships with Ubuntu karmic to be able to use some of the features available in perf. I recently found it useful when debugging a performance issue on my mythtv frontend.<\/p>\n<p>To build perf, first install the dependencies:<\/p>\n<pre>sudo apt-get install libelf-dev binutils-dev<\/pre>\n<p>Then grab a recent kernel source tree and build perf:<\/p>\n<pre>\r\nwget http:\/\/www.kernel.org\/pub\/linux\/kernel\/v2.6\/testing\/linux-2.6.33-rc3.tar.bz2\r\ntar xjf linux-2.6.33-rc3.tar.bz2\r\ncd linux-2.6.33-rc3\/tools\/perf\r\nmake\r\nmake install\r\n<\/pre>\n<p>It will warn that libdwarf-dev is not installed, but the version in karmic is too old and regardless libdwarf is only required for event tracing that appeared in more recent kernels. perf installs into ~\/bin\/perf. You should then be able to use the top, stat, list, record, report and annotate options.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A lot has been going on with Linux performance counters (now called performance events), but there is enough functionality in the 2.6.31 kernel that ships with Ubuntu karmic to be able to use some of the features available in perf. I recently found it useful when debugging a performance issue on my mythtv frontend. To &hellip; <a href=\"https:\/\/anton.ozlabs.org\/blog\/2010\/01\/10\/using-perf-the-linux-performance-analysis-tool-on-ubuntu-karmic\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Using perf, the Linux Performance Analysis tool on Ubuntu Karmic&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/anton.ozlabs.org\/blog\/wp-json\/wp\/v2\/posts\/211"}],"collection":[{"href":"https:\/\/anton.ozlabs.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anton.ozlabs.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anton.ozlabs.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/anton.ozlabs.org\/blog\/wp-json\/wp\/v2\/comments?post=211"}],"version-history":[{"count":12,"href":"https:\/\/anton.ozlabs.org\/blog\/wp-json\/wp\/v2\/posts\/211\/revisions"}],"predecessor-version":[{"id":240,"href":"https:\/\/anton.ozlabs.org\/blog\/wp-json\/wp\/v2\/posts\/211\/revisions\/240"}],"wp:attachment":[{"href":"https:\/\/anton.ozlabs.org\/blog\/wp-json\/wp\/v2\/media?parent=211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anton.ozlabs.org\/blog\/wp-json\/wp\/v2\/categories?post=211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anton.ozlabs.org\/blog\/wp-json\/wp\/v2\/tags?post=211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}