What would you suggest the best tool to profile C/C++ code and determine which parts are taking the most time. Currently, I'm just relying on logs but ofcourse the information is not accurate since unnecessary delays are introduced.
Preferrably, the tool would also be able to detect/suggest areas which could be optimized, if such tool exist.
Platform: Linux
The application shall be used on an embedded environment so it should be lightweight and external (not a plugin on some IDE).
I can heartily recommend callgrind
in combination with KCachegrind.
"gprof" on linux/freebsd is a quite simple and efficient tool to identify which routines are hogging the cPU at runtime. It gives both nested and flat profile of functions. It gives you the percentage of CPU time taken by each function executed during the runtime of the profiler, and also the percentage taken within the function itself, and the percentage taken by its child functions. That helps you easily segregate the offending functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With