/proc/profile

/proc/profile is a standard kernel feature which provides simple kernel profiling based on instruction pointer sampling in the periodic timer interrupt routine. It's simplistic but effective, and low overhead since the interrupt is going to happen anyway. The data is processed with readprofile(1) utility which looks up the System.map to show which kernel functions are using the most CPU time.

You need to enable this at boot time by passing profile=2 on the command line. The number gives the power of 2 granularity used for the counters - 2 will give you a separate counter for each instruction (4 bytes). Higher numbers consume less memory and give less precise results.