I'm a high-school student doing some C things where I'd like to profile my code to see where the actual performance bottlenecks are. I don't have much money, so I'd prefer free tools.
I like to use the MinGW/GCC compiler toolchain. This is not something I'm stuck with, but I'd prefer tools that are capable of working with this.
Features I need:
- See how much total time is spent in a certain function.
Features I'd like:
- See how much time a line of code takes.
- Cross-platform (being able to use the same software on Linux & Mac)
- See how often a function gets called (and how long each call takes on average).
- See what causes the time spent (cache misses, branch mispredictions, etc).
I've tried using gprof
, but I couldn't get it to work (it only shows main
in the profile), and I've heard bad things about it, so what are my options?