[An Introduction to GCC 学习笔记] 16 gprof, gcov

Posted 漫小牛

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[An Introduction to GCC 学习笔记] 16 gprof, gcov相关的知识,希望对你有一定的参考价值。

Compiler-related Tools

  • The GNU profiler gprof is a useful tool for measuring the performance of a program - it records the number of calls to each function and the amount of time spent there, on a perfunction basis. Functions which consume a large fraction of the run-time can be identified easily from the output of gprof. Efforts to speed up a program should concentrate first on those functions which dominate the total run-time.
  • The GNU coverage testing tool gcov analysis the number of times each line of a program is executed during a run. This makes it possible to find areas of the code which are not used, or which are note exercised in testing. When combined with profiling information from gprof, the information from coverage testing allows efforts to speed up a program to be concentrated on specific lines of the source code.

Summary

In this lesson, you should have learned:

  • The history and major features of GCC.
  • The basic skills of GCC.
  • How the compiler works.

以上是关于[An Introduction to GCC 学习笔记] 16 gprof, gcov的主要内容,如果未能解决你的问题,请参考以下文章

[An Introduction to GCC 学习笔记] 09 -Wall

[An Introduction to GCC 学习笔记] 14 优化问题3

[An Introduction to GCC 学习笔记] 14 优化问题3

[An Introduction to GCC 学习笔记] 13 优化问题2

[An Introduction to GCC 学习笔记] 10 Warn预编译

[An Introduction to GCC 学习笔记] 07 链接外部静态库