Structure of profile output file

The name of the file corresponding to a source file is formed simply by changing file suffix to .da, e.g. for test.c the corresponding file is test.da.

As mentioned before, the file consists of several sections, each represening single run. The structure of each section is shown on figure [*]

Figure: Structure of a section in profile data file
\scalebox{1.0}{
\includegraphics{profile_record.ps}}

The function name in the figure is stored as a $ -1$ (4 bytes), the length (4 bytes), the name itself (padded to 4-byte boundary) followed by a $ -1$ (4 bytes).

The extension block is used for storage of other important data which may be emited by future versions of gcc. This allows use of particular profile with different versions of gcc.

In current version, extension block contains the following information:

  1. number of instrumented arcs in whole program (4-byte number)
  2. sum all of instrumented arcs in whole program (8-byte number)
  3. maximal value of counter in whole program (8-byte number)
  4. number of instrumented arcs in the object file (4-byte number)
  5. sum all of instrumented arcs in the object file (8-byte number)
  6. maximal value of counter in the object file (8-byte number)

The content of the file can be examined by utility gcov, which outputs the corresponding source file together with execution counts for each line (so-called line coverage). There is currently no utility for manipulating the profile output file structure, e.g. removing runs or merging two files together.

Jan Hubicka 2003-05-04