1 .TH geninfo 1 "LCOV 1.9" 2010\-08\-06 "User Manuals"
3 geninfo \- Generate tracefiles from .da files
7 .RB [ \-v | \-\-version ]
8 .RB [ \-q | \-\-quiet ]
11 .RB [ \-i | \-\-initial ]
12 .RB [ \-t | \-\-test\-name
15 .RB [ \-o | \-\-output\-filename
17 .RB [ \-f | \-\-follow ]
19 .RB [ \-b | \-\-base\-directory
23 .RB [ \-\-no\-checksum ]
25 .RB [ \-\-compat\-libtool ]
26 .RB [ \-\-no\-compat\-libtool ]
30 .RB [ \-\-ignore\-errors
33 .RB [ \-\-no\-recursion ]
38 converts all GCOV coverage data files found in
40 into tracefiles, which the
42 tool can convert to HTML output.
44 Unless the \-\-output\-filename option is specified,
47 output to one file per .da file, the name of which is generated by simply
48 appending ".info" to the respective .da file name.
50 Note that the current user needs write access to both
52 as well as to the original source code location. This is necessary because
53 some temporary files have to be created there during the conversion process.
59 so that there is usually no need to call it directly.
63 To exclude specific lines of code from a tracefile, you can add exclusion
64 markers to the source code. Exclusion markers are keywords which can for
65 example be added in the form of a comment.
67 The following markers are recognized by geninfo:
71 Lines containing this marker will be excluded.
76 Marks the beginning of an excluded section. The current line is part of this
82 Marks the end of an excluded section. The current line not part of this
92 .B \-\-base\-directory
97 as base directory for relative paths.
99 Use this option to specify the base directory of a build\-environment
100 when geninfo produces error messages like:
103 ERROR: could not read source file /home/user/project/subdir1/subdir2/subdir1/subdir2/file.c
106 In this example, use /home/user/project as base directory.
108 This option is required when using geninfo on projects built with libtool or
109 similar build environments that work with a base directory, i.e. environments,
110 where the current working directory when invoking the compiler is not the same
111 directory in which the source code file is located.
113 Note that this option will not work in environments where multiple base
114 directories are used. In that case repeat the geninfo call for each base
115 directory while using the \-\-ignore\-errors option to prevent geninfo from
116 exiting when the first source code file could not be found. This way you can
117 get partial coverage information for each base directory which can then be
118 combined using the \-a option.
126 Specify whether to generate checksum data when writing tracefiles.
128 Use \-\-checksum to enable checksum generation or \-\-no\-checksum to
129 disable it. Checksum generation is
133 When checksum generation is enabled, a checksum will be generated for each
134 source code line and stored along with the coverage data. This checksum will
135 be used to prevent attempts to combine coverage data from different source
138 If you don't work with different source code versions, disable this option
139 to speed up coverage data processing and to reduce the size of tracefiles.
142 .B \-\-compat\-libtool
144 .B \-\-no\-compat\-libtool
147 Specify whether to enable libtool compatibility mode.
149 Use \-\-compat\-libtool to enable libtool compatibility mode or \-\-no\-compat\-libtool
150 to disable it. The libtool compatibility mode is
154 When libtool compatibility mode is enabled, geninfo will assume that the source
155 code relating to a .da file located in a directory named ".libs" can be
156 found in its parent directory.
158 If you have directories named ".libs" in your build environment but don't use
159 libtool, disable this option to prevent problems when capturing coverage data.
166 Follow links when searching .da files.
173 Specify the location of the gcov tool.
180 Print a short help text, then exit.
183 .B \-\-ignore\-errors
187 Specify a list of errors after which to continue processing.
189 Use this option to specify a list of one or more classes of errors after which
190 geninfo should continue processing instead of aborting.
193 can be a comma\-separated list of the following keywords:
196 the gcov tool returned with a non\-zero return code.
199 the source code file for a data set could not be found.
206 Capture initial zero coverage data.
208 Run geninfo with this option on the directories containing .bb, .bbg or .gcno
209 files before running any test case. The result is a "baseline" coverage data
210 file that contains zero coverage for every instrumented line and function.
211 Combine this data file (using lcov \-a) with coverage data files captured
212 after a test run to ensure that the percentage of total lines covered is
213 correct even when not all object code files were loaded during the test.
215 Note: currently, the \-\-initial option does not generate branch coverage
222 Use this option if you want to get coverage data for the specified directory
223 only without processing subdirectories.
226 .BI "\-o " output\-filename
228 .BI "\-\-output\-filename " output\-filename
231 .IR output\-filename .
233 If you want to have all data written to a single file (for easier
234 handling), use this option to specify the respective filename. By default,
235 one tracefile will be created for each processed .da file.
242 Do not print progress messages.
244 Suppresses all informational progress output. When this switch is enabled,
245 only error or warning messages are printed.
250 .BI "\-\-test\-name " testname
254 for resulting data. Valid test case names can consist of letters, decimal
255 digits and the underscore character ('_').
257 This proves useful when data from several test cases is merged (i.e. by
258 simply concatenating the respective tracefiles) in which case a test
259 name can be used to differentiate between data from each test case.
266 Print version number, then exit.
274 The system\-wide configuration file.
279 The per\-user configuration file.
282 Following is a quick description of the tracefile format as used by
283 .BR genhtml ", " geninfo " and " lcov .
285 A tracefile is made up of several human\-readable lines of text,
286 divided into sections. If available, a tracefile begins with the
288 which is stored in the following format:
292 For each source file referenced in the .da file, there is a section containing
293 filename and coverage data:
295 SF:<absolute path to the source file>
297 Following is a list of line numbers for each function name found in the
300 FN:<line number of function start>,<function name>
302 Next, there is a list of execution counts for each instrumented function:
304 FNDA:<execution count>,<function name>
306 This list is followed by two lines containing the number of functions found
309 FNF:<number of functions found>
310 FNH:<number of function hit>
312 Branch coverage information is stored which one line per branch:
314 BRDA:<line number>,<block number>,<branch number>,<taken>
316 Block number and branch number are gcc internal IDs for the branch. Taken is
317 either '-' if the basic block containing the branch was never executed or
318 a number indicating how often that branch was taken.
320 Branch coverage summaries are stored in two lines:
322 BRF:<number of branches found>
323 BRH:<number of branches hit>
325 Then there is a list of execution counts for each instrumented line
326 (i.e. a line which resulted in executable code):
328 DA:<line number>,<execution count>[,<checksum>]
330 Note that there may be an optional checksum present for each instrumented
333 implementation uses an MD5 hash as checksumming algorithm.
335 At the end of a section, there is a summary about how many lines
336 were found and how many were actually instrumented:
338 LH:<number of lines with a non\-zero execution count>
339 LF:<number of instrumented lines>
341 Each sections ends with:
345 In addition to the main source code file there are sections for all
346 #included files which also contain executable code.
348 Note that the absolute path of a source file is generated by interpreting
349 the contents of the respective .bb file (see
351 for more information on this file type). Relative filenames are prefixed
352 with the directory in which the .bb file is found.
354 Note also that symbolic links to the .bb file will be resolved so that the
355 actual file path is used instead of the path to a link. This approach is
356 necessary for the mechanism to work with the /proc/gcov files.
359 Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>