pfmon on Ubuntu 9.04

In this blog, I write about my experiences getting pfmon to run on my system (Intel Core 2 running Ubuntu 9.04).


1. The first step is to patch the kernel with perfmon2.
  • I First checked the most recent kernel patch that is supported by perfmon2. You will be able to find this in http://perfmon2.sourceforge.net. In my case it was 2.6.28 2nd release.
  • I installed the kernel (2.6.28) the old fashioned way (without git). I first installed the necessary packages required for building kernels, and then downloaded the kernel with instructions from https://help.ubuntu.com/community/Kernel/Compile.
  • I then patched the kernel with the perfmon2 patch I downloaded. Instructions for patching the kernel were from http://www.linuxheadquarters.com/howto/tuning/kernelpatch.shtml. There was a bit of a problem with the patching since I used a kernel from the Ubuntu distribution and not the original kernel.org kernel (for which the patch was made). These problems were easily rectified by manually (and carefully) patching the files which gave errors.
  • ... and rebooted  to the new kernel :)

2. The second step is to install libpfm and pfmon
  •  Although Ubuntu's package manager supported it. The versions of pfmon present in Ubuntu conflicted with the kernel patch I had installed. So when I ran the command
                   $ pfmon date
         I got the error

                     can't create perfmon context: Invalid argument(22)

  • I then realized that for the 2.6.28 patch, I needed libpfm 3.8 and pfmon 3.8. So I downloaded these from  http://perfmon2.sourceforge.net and installed them. First installed the libpfm and then the pfmon.
  • It now works :) :). The command '$pfmon date' gives
                     Wed Apr 28 13:53:52 IST 2010
                     760973 UNHALTED_CORE_CYCLES

1 comment:

  1. Thanks for the post. I am doing a project on Perfmon2. Your blog post gave me the overview of what I have to do to get perfmon2 up and running

    ReplyDelete

Followers