d1.06.01 Measuring performance (CPU) on Linux#
Summary:
There are tools to track the CPU times used (profiling).
On Linux, we use the gprof tool. The use of this tool requires compiling all sources with the « -pg » option. The additional cost of instrumentation is negligible. The result of profiling is a text file that must be interpreted.
To simplify interpretation, a tool for drawing a graph from the text file produced by the « profiled » calculation is proposed at the end of the document.
Table of Contents
- 1. Gprof
- 1.1. Building a version with gprof
- 1.2. Over-cost of instrumentation
- 1.3. Executing the instrumentated executable with waf
- 1.4. Executing the instrumentated executable with astk
- 1.5. Exploitation of results
- 1.6. Analyze profiling results
- 1.7. Analysis of the example
- 1.8. Generating a graph with gprof2dot