I'm attempting to profile some c++ code on my mac (os x Lion) and I haven't been able to find anything useful. I'm looking for a profiler that will tell me what functions are taking up my cpu time (similar to the matlab profiler).
Here is what I have tried
Instruments is the tool to use. A full explanation of Instruments is outside the scope of this answer, but here's a quick start guide:
Of the tools available, the ones that will be most frequently useful are:
You can also start an invocation of instruments
on the command line:
instruments -l 30000 -t Time\ Profiler -p 5773
see instructions.
1 One easy way to open Instruments is to use Spotlight: Just click on the magnifying glass in the upper right corner of the taskbar (next to the clock) and type "Instruments".
2 Click "Choose Target..." and navigate to the path of your executable.