Friday, June 27, 2008

Oprofile setup on ubuntu

Installing oprofile on ubuntu goes like this
sudo apt-get install linux-kernel-devel fakeroot build-essential
sudo apt-get source linux-image-`uname -r`
sudo apt-get build-dep linux-image-`uname -r`
cd linux-source-`uname -r`
sudo make oldconfig
sudo make vmlinux
sudo apt-get install oprofile
sudo opcontrol --setup --vmlinux=`pwd`/vmlinux
sudo opcontrol --start

and then you should see something like this
Using 2.6+ OProfile kernel interface.
Reading module info.
Using log file /var/lib/oprofile/oprofiled.log
Daemon started.
Profiler running.

If you see some error's check if you sh is pointing to bash.
cd /bin
sudo rm sh
sudo ln -s -T bash sh

1 comment:

Anonymous said...

Checkout the linux-image-debug packages
that have the required vmlinux. They are available from http://ddebs.ubuntu.com/pool/main/l/linux/
No need for make vmlinux anymore!