First you have to enable oprofile in your kernel, i.e. you must have
1 | CONFIG_PROFILING=y |
in your kernel config. Then you need userspace utilities to use it. I used oprofile 0.9.4. First of all you need to setup it with something like
1 | opcontrol --init |
After that, here is the script I used to do profiling against a program:
1 | john@buddha:~$ cat bin/profile |
Use profile <the name of your executable>
to get the profile. Use opreport
to read the result. opreport -l
might be more meaningful. You can use opreport <the name of your executable>
to only get the result related to your program, but personally I prefer to check the whole system.