1 .TH geninfo 1 "LCOV 1.10" 2012\-10\-10 "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 ]
36 .RB [ \-\-no\-external ]
38 .RB [ \-\-config\-file
40 .RB [ \-\-no\-markers ]
42 .RB [ \-\-derive\-func\-data ]
44 .IR mode =on|off|auto]
51 converts all GCOV coverage data files found in
53 into tracefiles, which the
55 tool can convert to HTML output.
57 Unless the \-\-output\-filename option is specified,
60 output to one file per .da file, the name of which is generated by simply
61 appending ".info" to the respective .da file name.
63 Note that the current user needs write access to both
65 as well as to the original source code location. This is necessary because
66 some temporary files have to be created there during the conversion process.
72 so that there is usually no need to call it directly.
76 To exclude specific lines of code from a tracefile, you can add exclusion
77 markers to the source code. Exclusion markers are keywords which can for
78 example be added in the form of a comment.
80 The following markers are recognized by geninfo:
84 Lines containing this marker will be excluded.
89 Marks the beginning of an excluded section. The current line is part of this
95 Marks the end of an excluded section. The current line not part of this
105 .B \-\-base\-directory
110 as base directory for relative paths.
112 Use this option to specify the base directory of a build\-environment
113 when geninfo produces error messages like:
116 ERROR: could not read source file /home/user/project/subdir1/subdir2/subdir1/subdir2/file.c
119 In this example, use /home/user/project as base directory.
121 This option is required when using geninfo on projects built with libtool or
122 similar build environments that work with a base directory, i.e. environments,
123 where the current working directory when invoking the compiler is not the same
124 directory in which the source code file is located.
126 Note that this option will not work in environments where multiple base
127 directories are used. In that case use configuration file setting
128 .B geninfo_auto_base=1
138 Specify whether to generate checksum data when writing tracefiles.
140 Use \-\-checksum to enable checksum generation or \-\-no\-checksum to
141 disable it. Checksum generation is
145 When checksum generation is enabled, a checksum will be generated for each
146 source code line and stored along with the coverage data. This checksum will
147 be used to prevent attempts to combine coverage data from different source
150 If you don't work with different source code versions, disable this option
151 to speed up coverage data processing and to reduce the size of tracefiles.
155 .IR mode = value [, mode = value ,...]
158 Set compatibility mode.
160 Use \-\-compat to specify that geninfo should enable one or more compatibility
161 modes when capturing coverage data. You can provide a comma-separated list
162 of mode=value pairs to specify the values for multiple modes.
170 Enable compatibility mode.
174 Disable compatibility mode.
178 Apply auto-detection to determine if compatibility mode is required. Note that
179 auto-detection is not available for all compatibility modes.
182 If no value is specified, 'on' is assumed as default value.
190 Enable this mode if you are capturing coverage data for a project that
191 was built using the libtool mechanism. See also
194 The default value for this setting is 'on'.
199 Enable this mode if you are capturing coverage data for a project that
200 was built using a version of GCC 3.3 that contains a modification
201 (hammer patch) of later GCC versions. You can identify a modified GCC 3.3
202 by checking the build directory of your project for files ending in the
203 extension '.bbg'. Unmodified versions of GCC 3.3 name these files '.bb'.
205 The default value for this setting is 'auto'.
210 Enable this mode if you are capturing coverage data for a project that
211 was built using a version of GCC 4.6 that contains a modification
212 (split function checksums) of later GCC versions. Typical error messages
213 when running geninfo on coverage data produced by such GCC versions are
214 \'out of memory' and 'reached unexpected end of file'.
216 The default value for this setting is 'auto'
221 .B \-\-compat\-libtool
223 .B \-\-no\-compat\-libtool
226 Specify whether to enable libtool compatibility mode.
228 Use \-\-compat\-libtool to enable libtool compatibility mode or \-\-no\-compat\-libtool
229 to disable it. The libtool compatibility mode is
233 When libtool compatibility mode is enabled, geninfo will assume that the source
234 code relating to a .da file located in a directory named ".libs" can be
235 found in its parent directory.
237 If you have directories named ".libs" in your build environment but don't use
238 libtool, disable this option to prevent problems when capturing coverage data.
245 Specify a configuration file to use.
247 When this option is specified, neither the system\-wide configuration file
248 /etc/lcovrc, nor the per\-user configuration file ~/.lcovrc is read.
250 This option may be useful when there is a need to run several
253 with different configuration file options in parallel.
256 .B \-\-derive\-func\-data
259 Calculate function coverage data from line coverage data.
261 Use this option to collect function coverage data, even if the version of the
262 gcov tool installed on the test system does not provide this data. lcov will
263 instead derive function coverage data from line coverage data and
264 information about which lines belong to a function.
272 Specify whether to capture coverage data for external source files.
274 External source files are files which are not located in one of the directories
275 specified by \-\-directory or \-\-base\-directory. Use \-\-external to include
276 external source files while capturing coverage data or \-\-no\-external to
279 Data for external source files is
288 Follow links when searching .da files.
295 Specify the location of the gcov tool.
302 Print a short help text, then exit.
305 .B \-\-ignore\-errors
309 Specify a list of errors after which to continue processing.
311 Use this option to specify a list of one or more classes of errors after which
312 geninfo should continue processing instead of aborting.
315 can be a comma\-separated list of the following keywords:
318 the gcov tool returned with a non\-zero return code.
321 the source code file for a data set could not be found.
328 Capture initial zero coverage data.
330 Run geninfo with this option on the directories containing .bb, .bbg or .gcno
331 files before running any test case. The result is a "baseline" coverage data
332 file that contains zero coverage for every instrumented line and function.
333 Combine this data file (using lcov \-a) with coverage data files captured
334 after a test run to ensure that the percentage of total lines covered is
335 correct even when not all object code files were loaded during the test.
337 Note: currently, the \-\-initial option does not generate branch coverage
344 Use this option if you want to get coverage data without regard to exclusion
345 markers in the source code file.
351 Use this option if you want to get coverage data for the specified directory
352 only without processing subdirectories.
355 .BI "\-o " output\-filename
357 .BI "\-\-output\-filename " output\-filename
360 .IR output\-filename .
362 If you want to have all data written to a single file (for easier
363 handling), use this option to specify the respective filename. By default,
364 one tracefile will be created for each processed .da file.
371 Do not print progress messages.
373 Suppresses all informational progress output. When this switch is enabled,
374 only error or warning messages are printed.
381 Override a configuration directive.
383 Use this option to specify a
385 statement which overrides the corresponding configuration statement in
386 the lcovrc configuration file. You can specify this option more than once
387 to override multiple configuration statements.
390 for a list of available keywords and their meaning.
395 .BI "\-\-test\-name " testname
399 for resulting data. Valid test case names can consist of letters, decimal
400 digits and the underscore character ('_').
402 This proves useful when data from several test cases is merged (i.e. by
403 simply concatenating the respective tracefiles) in which case a test
404 name can be used to differentiate between data from each test case.
411 Print version number, then exit.
419 The system\-wide configuration file.
424 The per\-user configuration file.
427 Following is a quick description of the tracefile format as used by
428 .BR genhtml ", " geninfo " and " lcov .
430 A tracefile is made up of several human\-readable lines of text,
431 divided into sections. If available, a tracefile begins with the
433 which is stored in the following format:
437 For each source file referenced in the .da file, there is a section containing
438 filename and coverage data:
440 SF:<absolute path to the source file>
442 Following is a list of line numbers for each function name found in the
445 FN:<line number of function start>,<function name>
447 Next, there is a list of execution counts for each instrumented function:
449 FNDA:<execution count>,<function name>
451 This list is followed by two lines containing the number of functions found
454 FNF:<number of functions found>
455 FNH:<number of function hit>
457 Branch coverage information is stored which one line per branch:
459 BRDA:<line number>,<block number>,<branch number>,<taken>
461 Block number and branch number are gcc internal IDs for the branch. Taken is
462 either '-' if the basic block containing the branch was never executed or
463 a number indicating how often that branch was taken.
465 Branch coverage summaries are stored in two lines:
467 BRF:<number of branches found>
468 BRH:<number of branches hit>
470 Then there is a list of execution counts for each instrumented line
471 (i.e. a line which resulted in executable code):
473 DA:<line number>,<execution count>[,<checksum>]
475 Note that there may be an optional checksum present for each instrumented
478 implementation uses an MD5 hash as checksumming algorithm.
480 At the end of a section, there is a summary about how many lines
481 were found and how many were actually instrumented:
483 LH:<number of lines with a non\-zero execution count>
484 LF:<number of instrumented lines>
486 Each sections ends with:
490 In addition to the main source code file there are sections for all
491 #included files which also contain executable code.
493 Note that the absolute path of a source file is generated by interpreting
494 the contents of the respective .bb file (see
496 for more information on this file type). Relative filenames are prefixed
497 with the directory in which the .bb file is found.
499 Note also that symbolic links to the .bb file will be resolved so that the
500 actual file path is used instead of the path to a link. This approach is
501 necessary for the mechanism to work with the /proc/gcov files.
504 Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>