07-04-2014, 02:42 AM
You'll need a profile build. gprof is slightly easier to use so is probably your best bet. After executing the profile build as normal you then run gprof in the folder to show what was executed. But if you just want to see whats using the CPU you can just use GDB. Break repeatedly and the thing that keeps coming up is what is using the most CPU.