Problems with oprofile

from http://newbiedoc.sourceforge.net/
Image via Wikipedia

For one-last-thing with my report I want to profile the kernel in a specific configuration and so thought I would try oprofile instead of the cruder profile=X command line options.

Big mistake.

Essentially I could not get it to run under KVM at all. KVM hides many hardware details from the profiler and set up is notoriously difficult (I now know). Apparently this is fixable, but not simply and there is very little information out there about how to do it. If I had days to learn maybe I would persevere, but I don’t.

But I did come across one feature/bug in oprofile that I will document a fix for in the hope it proves useful to someone.

To start oprofile off (to profile the kernel), one has to specify where a vmlinux file (note, not a compressed vmlinuz or bzImage etc) or similar is.

Mine were of the format vmlinux-3.0.0-sched+ but oprofile consistently failed to let me specify that: again I did not have time to go into the details but is was clear it was the + that was the issue. I renamed the file and all was fine.