gprof is a C++ (and more programming languages) profiler. cachegrind is another profiler.
gprof can be installed from the Ubuntu Software Center.
- 1: profiling a simple console application in Qt Creator, using Build Settings
- 2: profiling a simple console application in Qt Creator, using Qt project file
- Answer of exercise #7: AddOne
gprof and multi-threaded programs
gprof does not appear to profile multi-threaded programs under Lubuntu:
- View a gprof results file of a multithreaded application: 0.0% of the total time is spent non-idle. But actually, 0.0% of the total time is spent non-idle in the main thread only! The application profiled was GTST, version 0.50
oprofile is said to profile multi-threaded programs under Lubuntu correctly.
- C++ profiling summary, using gprof and Travis CI: YouTube Download (OGV)
- C++ profiling preparation, using gprof and Travis CI: YouTube Download (OGV)
- C++ profiling process 1/2, using gprof and Travis CI (incomplete video): YouTube Download (OGV)
- C++ profiling process 2/2, using gprof and Travis CI (incomplete video): YouTube Download (OGV)