I need to profile some code running C++ on Linux. Can you guys recommend some profilers?
Linux Profiling tools and techniques. Profiling is an alternative to benchmarking that is often more effective, as it gives you more fine grained measurements for the components of the system you're measuring, thus minimising external influences from consideration.
The C Profiler tool enables the collection and display of execution profile data on C software source code bases of arbitrary size. It is a member of SD's family of Profiler tools.
Code Profiling in Linux Using Gprof - Open Source For You.
Use gprof.
Just compile with -pg
flag (I think (but am not sure) you have to turn of optimizations though.) and use gprof to analyze the gmon.out file that your executable will then produce.
eg:
gcc -pg -o whatever whatever.c ./whatever gprof whatever gmon.out
Same thing with g++ and cpp.
valgrind is a well-know linux profiler
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