1 .TH lcov 1 "LCOV 1.9" 2010\-08\-06 "User Manuals"
3 lcov \- a graphical GCOV front\-end
9 .RB [ \-d | \-\-directory
11 .RB [ \-k | \-\-kernel\-directory
14 .RB [ \-o | \-\-output\-file
16 .RB [ \-t | \-\-test\-name
19 .RB [ \-b | \-\-base\-directory
21 .RB [ \-i | \-\-initial ]
26 .RB [ \-\-no\-checksum ]
27 .RB [ \-\-no\-recursion ]
28 .RB [ \-f | \-\-follow ]
30 .RB [ \-\-compat\-libtool ]
31 .RB [ \-\-no\-compat\-libtool ]
32 .RB [ \-\-ignore\-errors
37 .RB [ \-\-from\-package
39 .RB [ \-q | \-\-quiet ]
41 .RB [ \-\-no\-markers ]
46 .BR \-z | \-\-zerocounters
49 .RB [ \-d | \-\-directory
51 .RB [ \-\-no\-recursion ]
52 .RB [ \-f | \-\-follow ]
54 .RB [ \-q | \-\-quiet ]
63 .RB [ \-q | \-\-quiet ]
64 .RB [ \-\-list\-full\-path ]
65 .RB [ \-\-no\-list\-full\-path ]
70 .BR \-a | \-\-add\-tracefile
74 .RB [ \-o | \-\-output\-file
77 .RB [ \-\-no\-checksum ]
79 .RB [ \-q | \-\-quiet ]
88 .RB [ \-o | \-\-output\-file
91 .RB [ \-\-no\-checksum ]
93 .RB [ \-q | \-\-quiet ]
101 .RB [ \-o | \-\-output\-file
104 .RB [ \-\-no\-checksum ]
106 .RB [ \-q | \-\-quiet ]
115 .RB [ \-o | \-\-output\-file
118 .RB [ \-\-no\-checksum ]
120 .RB [ \-\-convert\-filenames ]
125 .RB [ \-q | \-\-quiet ]
130 .RB [ \-h | \-\-help ]
131 .RB [ \-v | \-\-version ]
138 is a graphical front\-end for GCC's coverage testing tool gcov. It collects
139 line, function and branch coverage data for multiple source files and creates
140 HTML pages containing the source code annotated with coverage information.
141 It also adds overview pages for easy navigation within the file structure.
145 to collect coverage data and
147 to create HTML pages. Coverage data can either be collected from the
148 currently running Linux kernel or from a user space application. To do this,
149 you have to complete the following preparation steps:
151 For Linux kernel coverage:
153 Follow the setup instructions for the gcov\-kernel infrastructure:
154 .I http://ltp.sourceforge.net/coverage/gcov.php
159 For user space application coverage:
161 Compile the application with GCC using the options
162 "\-fprofile\-arcs" and "\-ftest\-coverage".
165 Please note that this man page refers to the output format of
167 as ".info file" or "tracefile" and that the output of GCOV
168 is called ".da file".
175 .B \-\-add\-tracefile
182 Specify several tracefiles using the \-a switch to combine the coverage data
183 contained in these files by adding up execution counts for matching test and
184 filename combinations.
186 The result of the add operation will be written to stdout or the tracefile
189 Only one of \-z, \-c, \-a, \-e, \-r, \-l and \-\-diff may be specified
197 .B \-\-base\-directory
202 as base directory for relative paths.
204 Use this option to specify the base directory of a build\-environment
205 when lcov produces error messages like:
208 ERROR: could not read source file /home/user/project/subdir1/subdir2/subdir1/subdir2/file.c
211 In this example, use /home/user/project as base directory.
213 This option is required when using lcov on projects built with libtool or
214 similar build environments that work with a base directory, i.e. environments,
215 where the current working directory when invoking the compiler is not the same
216 directory in which the source code file is located.
218 Note that this option will not work in environments where multiple base
219 directories are used. In that case repeat the lcov call for each base directory
220 while using the \-\-ignore\-errors option to prevent lcov from exiting when the
221 first source code file could not be found. This way you can get partial coverage
222 information for each base directory which can then be combined using the \-a
231 Capture coverage data.
233 By default captures the current kernel execution counts and writes the
234 resulting coverage data to the standard output. Use the \-\-directory
235 option to capture counts for a user space program.
237 The result of the capture operation will be written to stdout or the tracefile
240 Only one of \-z, \-c, \-a, \-e, \-r, \-l and \-\-diff may be specified
249 Specify whether to generate checksum data when writing tracefiles.
251 Use \-\-checksum to enable checksum generation or \-\-no\-checksum to
252 disable it. Checksum generation is
256 When checksum generation is enabled, a checksum will be generated for each
257 source code line and stored along with the coverage data. This checksum will
258 be used to prevent attempts to combine coverage data from different source
261 If you don't work with different source code versions, disable this option
262 to speed up coverage data processing and to reduce the size of tracefiles.
265 .B \-\-compat\-libtool
267 .B \-\-no\-compat\-libtool
270 Specify whether to enable libtool compatibility mode.
272 Use \-\-compat\-libtool to enable libtool compatibility mode or \-\-no\-compat\-libtool
273 to disable it. The libtool compatibility mode is
277 When libtool compatibility mode is enabled, lcov will assume that the source
278 code relating to a .da file located in a directory named ".libs" can be
279 found in its parent directory.
281 If you have directories named ".libs" in your build environment but don't use
282 libtool, disable this option to prevent problems when capturing coverage data.
285 .B \-\-convert\-filenames
288 Convert filenames when applying diff.
290 Use this option together with \-\-diff to rename the file names of processed
291 data sets according to the data provided by the diff.
299 Convert coverage data in
301 using source code diff file
304 Use this option if you want to merge coverage data from different source code
305 levels of a program, e.g. when you have data taken from an older version
306 and want to combine it with data from a more current version.
308 will try to map source code lines between those versions and adjust the coverage
311 needs to be in unified format, i.e. it has to be created using the "\-u" option
316 Note that lines which are not present in the old version will not be counted
317 as instrumented, therefore tracefiles resulting from this operation should
318 not be interpreted individually but together with other tracefiles taken
319 from the newer version. Also keep in mind that converted coverage data should
320 only be used for overview purposes as the process itself introduces a loss
323 The result of the diff operation will be written to stdout or the tracefile
326 Only one of \-z, \-c, \-a, \-e, \-r, \-l and \-\-diff may be specified
341 If you want to work on coverage data for a user space program, use this
342 option to specify the location where the program was compiled (that's
343 where the counter files ending with .da will be stored).
345 Note that you may specify this option more than once.
360 Use this switch if you want to extract coverage data for only a particular
361 set of files from a tracefile. Additional command line parameters will be
362 interpreted as shell wildcard patterns (note that they may need to be
363 escaped accordingly to prevent the shell from expanding them first).
366 which matches at least one of those patterns will be extracted.
368 The result of the extract operation will be written to stdout or the tracefile
371 Only one of \-z, \-c, \-a, \-e, \-r, \-l and \-\-diff may be specified
380 Follow links when searching for .da files.
389 instead of kernel or directory.
391 Use this option if you have separate machines for build and test and
392 want to perform the .info file creation on the build machine. See
393 \-\-to\-package for more information.
400 Specify the location of the gcov tool.
408 Print a short help text, then exit.
411 .B \-\-ignore\-errors
415 Specify a list of errors after which to continue processing.
417 Use this option to specify a list of one or more classes of errors after which
418 lcov should continue processing instead of aborting.
421 can be a comma\-separated list of the following keywords:
424 the gcov tool returned with a non\-zero return code.
427 the source code file for a data set could not be found.
434 Capture initial zero coverage data.
436 Run lcov with \-c and this option on the directories containing .bb, .bbg
437 or .gcno files before running any test case. The result is a "baseline"
438 coverage data file that contains zero coverage for every instrumented line.
439 Combine this data file (using lcov \-a) with coverage data files captured
440 after a test run to ensure that the percentage of total lines covered is
441 correct even when not all source code files were loaded during the test.
443 Recommended procedure when capturing data for a test case:
445 1. create baseline coverage data file
447 # lcov \-c \-i \-d appdir \-o app_base.info
457 3. create test coverage data file
459 # lcov \-c \-d appdir \-o app_test.info
463 4. combine baseline and test coverage data
465 # lcov \-a app_base.info \-a app_test.info \-o app_total.info
474 .B \-\-kernel\-directory
478 Capture kernel coverage data only from
481 Use this option if you don't want to get coverage data for all of the
482 kernel, but only for specific subdirectories. This option may be specified
485 Note that you may need to specify the full path to the kernel subdirectory
486 depending on the version of the kernel gcov support.
496 List the contents of the
499 Only one of \-z, \-c, \-a, \-e, \-r, \-l and \-\-diff may be specified
503 .B \-\-list\-full\-path
505 .B \-\-no\-list\-full\-path
508 Specify whether to show full paths during list operation.
510 Use \-\-list\-full\-path to show full paths during list operation
511 or \-\-no\-list\-full\-path to show shortened paths. Paths are
519 Use this option if you want to get coverage data without regard to exclusion
520 markers in the source code file. See
522 for details on exclusion markers.
528 Use this option if you want to get coverage data for the specified directory
529 only without processing subdirectories.
543 Specify "\-" as a filename to use the standard output.
545 By convention, lcov\-generated coverage data files are called "tracefiles" and
546 should have the filename extension ".info".
553 Strip path from filenames when applying diff.
555 Use this option together with \-\-diff to tell lcov to disregard the specified
556 initial path component when matching between tracefile and diff filenames.
564 Do not print progress messages.
566 This option is implied when no output filename is specified to prevent
567 progress messages to mess with coverage data which is also printed to
583 Use this switch if you want to remove coverage data for a particular
584 set of files from a tracefile. Additional command line parameters will be
585 interpreted as shell wildcard patterns (note that they may need to be
586 escaped accordingly to prevent the shell from expanding them first).
589 which matches at least one of those patterns will be removed.
591 The result of the remove operation will be written to stdout or the tracefile
594 Only one of \-z, \-c, \-a, \-e, \-r, \-l and \-\-diff may be specified
602 Strip path components when applying diff.
604 Use this option together with \-\-diff to tell lcov to disregard the specified
605 number of initial directories when matching tracefile and diff filenames.
615 Specify test name to be stored in the tracefile.
617 This name identifies a coverage data set when more than one data set is merged
618 into a combined tracefile (see option \-a).
620 Valid test names can consist of letters, decimal digits and the underscore
628 Store .da files for later processing.
630 Use this option if you have separate machines for build and test and
631 want to perform the .info file creation on the build machine. To do this,
639 \- run lcov \-c [\-d directory] \-\-to-package
648 On the build machine:
651 \- run lcov \-c \-\-from-package
653 [\-o and other options]
657 This works for both kernel and user space coverage data. Note that you might
658 have to specify the path to the build directory using \-b with
659 either \-\-to\-package or \-\-from-package. Note also that the package data
660 must be converted to a .info file before recompiling the program or it will
669 Print version number, then exit.
677 Reset all execution counts to zero.
679 By default tries to reset kernel execution counts. Use the \-\-directory
680 option to reset all counters of a user space program.
682 Only one of \-z, \-c, \-a, \-e, \-r, \-l and \-\-diff may be specified
690 The system\-wide configuration file.
695 The per\-user configuration file.
699 Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>