Using perf, the Linux Performance Analysis tool on Ubuntu Karmic
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 build perf, first install the dependencies:
sudo apt-get install libelf-dev binutils-dev
Then grab a recent kernel source tree and build perf:
wget http://www.kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.33-rc3.tar.bz2 tar xjf linux-2.6.33-rc3.tar.bz2 cd linux-2.6.33-rc3/tools/perf make make install
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.
This entry was posted in Uncategorized on January 10, 2010.