Gprof
lastmod 2022-05-15created 2015-04-047 edits
Profiling a program tells you which parts of the program consume the most execution time, as well as the call relationships between the functions in the program. Because this information shows the programmer which parts of the program run slower than expected, it provides guidelines on which parts to change to make the program run faster. Profiling information can also tell you whether a function runs more or less often than you thought, and can help you find bugs you might have missed without profiling.
Because a profiler uses information obtained from actually running the program, it can be used on complex or large programs whose source code is too much to analyze by eye. However, the information in the profile data can vary depending on how the program is run. That is, if a particular feature of the program you want to profile is not used during profiling, you cannot analyze profile information for that feature.
Example
You must compile with the -pg option added to gcc.
See also
Favorite site
- Wikipedia (en) description of gprof
- GNU profiler Korean manual 1
- Measuring performance with gprof (GNU gprof)
References
-
Isilab.kaist.ac.kr-gprof_ko_manual.zip ↩