1 .TH lcov 1 "LCOV 1.10" 2012\-10\-10 "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 ]
43 .RB [ \-\-no\-external ]
45 .RB [ \-\-config\-file
51 .IR mode =on|off|auto]
56 .BR \-z | \-\-zerocounters
59 .RB [ \-d | \-\-directory
61 .RB [ \-\-no\-recursion ]
62 .RB [ \-f | \-\-follow ]
64 .RB [ \-q | \-\-quiet ]
73 .RB [ \-q | \-\-quiet ]
74 .RB [ \-\-list\-full\-path ]
75 .RB [ \-\-no\-list\-full\-path ]
77 .RB [ \-\-config\-file
85 .BR \-a | \-\-add\-tracefile
89 .RB [ \-o | \-\-output\-file
92 .RB [ \-\-no\-checksum ]
94 .RB [ \-q | \-\-quiet ]
95 .RB [ \-\-config\-file
103 .BR \-e | \-\-extract
107 .RB [ \-o | \-\-output\-file
110 .RB [ \-\-no\-checksum ]
112 .RB [ \-q | \-\-quiet ]
113 .RB [ \-\-config\-file
116 .IR keyword = value ]
125 .RB [ \-o | \-\-output\-file
128 .RB [ \-\-no\-checksum ]
130 .RB [ \-q | \-\-quiet ]
131 .RB [ \-\-config\-file
134 .IR keyword = value ]
143 .RB [ \-o | \-\-output\-file
146 .RB [ \-\-no\-checksum ]
148 .RB [ \-\-convert\-filenames ]
153 .RB [ \-q | \-\-quiet ]
155 .RB [ \-\-config\-file
158 .IR keyword = value ]
167 .RB [ \-q | \-\-quiet ]
172 .RB [ \-h | \-\-help ]
173 .RB [ \-v | \-\-version ]
180 is a graphical front\-end for GCC's coverage testing tool gcov. It collects
181 line, function and branch coverage data for multiple source files and creates
182 HTML pages containing the source code annotated with coverage information.
183 It also adds overview pages for easy navigation within the file structure.
187 to collect coverage data and
189 to create HTML pages. Coverage data can either be collected from the
190 currently running Linux kernel or from a user space application. To do this,
191 you have to complete the following preparation steps:
193 For Linux kernel coverage:
195 Follow the setup instructions for the gcov\-kernel infrastructure:
196 .I http://ltp.sourceforge.net/coverage/gcov.php
201 For user space application coverage:
203 Compile the application with GCC using the options
204 "\-fprofile\-arcs" and "\-ftest\-coverage".
207 Please note that this man page refers to the output format of
209 as ".info file" or "tracefile" and that the output of GCOV
210 is called ".da file".
212 Also note that when printing percentages, 0% and 100% are only printed when
213 the values are exactly 0% and 100% respectively. Other values which would
214 conventionally be rounded to 0% or 100% are instead printed as nearest
215 non-boundary value. This behavior is in accordance with that of the
225 .B \-\-add\-tracefile
232 Specify several tracefiles using the \-a switch to combine the coverage data
233 contained in these files by adding up execution counts for matching test and
234 filename combinations.
236 The result of the add operation will be written to stdout or the tracefile
239 Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
247 .B \-\-base\-directory
252 as base directory for relative paths.
254 Use this option to specify the base directory of a build\-environment
255 when lcov produces error messages like:
258 ERROR: could not read source file /home/user/project/subdir1/subdir2/subdir1/subdir2/file.c
261 In this example, use /home/user/project as base directory.
263 This option is required when using lcov on projects built with libtool or
264 similar build environments that work with a base directory, i.e. environments,
265 where the current working directory when invoking the compiler is not the same
266 directory in which the source code file is located.
268 Note that this option will not work in environments where multiple base
269 directories are used. In that case use configuration file setting
270 .B geninfo_auto_base=1
280 Capture coverage data.
282 By default captures the current kernel execution counts and writes the
283 resulting coverage data to the standard output. Use the \-\-directory
284 option to capture counts for a user space program.
286 The result of the capture operation will be written to stdout or the tracefile
289 Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
298 Specify whether to generate checksum data when writing tracefiles.
300 Use \-\-checksum to enable checksum generation or \-\-no\-checksum to
301 disable it. Checksum generation is
305 When checksum generation is enabled, a checksum will be generated for each
306 source code line and stored along with the coverage data. This checksum will
307 be used to prevent attempts to combine coverage data from different source
310 If you don't work with different source code versions, disable this option
311 to speed up coverage data processing and to reduce the size of tracefiles.
315 .IR mode = value [, mode = value ,...]
318 Set compatibility mode.
320 Use \-\-compat to specify that lcov should enable one or more compatibility
321 modes when capturing coverage data. You can provide a comma-separated list
322 of mode=value pairs to specify the values for multiple modes.
330 Enable compatibility mode.
334 Disable compatibility mode.
338 Apply auto-detection to determine if compatibility mode is required. Note that
339 auto-detection is not available for all compatibility modes.
342 If no value is specified, 'on' is assumed as default value.
350 Enable this mode if you are capturing coverage data for a project that
351 was built using the libtool mechanism. See also
354 The default value for this setting is 'on'.
359 Enable this mode if you are capturing coverage data for a project that
360 was built using a version of GCC 3.3 that contains a modification
361 (hammer patch) of later GCC versions. You can identify a modified GCC 3.3
362 by checking the build directory of your project for files ending in the
363 extension '.bbg'. Unmodified versions of GCC 3.3 name these files '.bb'.
365 The default value for this setting is 'auto'.
370 Enable this mode if you are capturing coverage data for a project that
371 was built using a version of GCC 4.6 that contains a modification
372 (split function checksums) of later GCC versions. Typical error messages
373 when running lcov on coverage data produced by such GCC versions are
374 \'out of memory' and 'reached unexpected end of file'.
376 The default value for this setting is 'auto'
381 .B \-\-compat\-libtool
383 .B \-\-no\-compat\-libtool
386 Specify whether to enable libtool compatibility mode.
388 Use \-\-compat\-libtool to enable libtool compatibility mode or \-\-no\-compat\-libtool
389 to disable it. The libtool compatibility mode is
393 When libtool compatibility mode is enabled, lcov will assume that the source
394 code relating to a .da file located in a directory named ".libs" can be
395 found in its parent directory.
397 If you have directories named ".libs" in your build environment but don't use
398 libtool, disable this option to prevent problems when capturing coverage data.
405 Specify a configuration file to use.
407 When this option is specified, neither the system\-wide configuration file
408 /etc/lcovrc, nor the per\-user configuration file ~/.lcovrc is read.
410 This option may be useful when there is a need to run several
413 with different configuration file options in parallel.
416 .B \-\-convert\-filenames
419 Convert filenames when applying diff.
421 Use this option together with \-\-diff to rename the file names of processed
422 data sets according to the data provided by the diff.
430 Convert coverage data in
432 using source code diff file
435 Use this option if you want to merge coverage data from different source code
436 levels of a program, e.g. when you have data taken from an older version
437 and want to combine it with data from a more current version.
439 will try to map source code lines between those versions and adjust the coverage
442 needs to be in unified format, i.e. it has to be created using the "\-u" option
447 Note that lines which are not present in the old version will not be counted
448 as instrumented, therefore tracefiles resulting from this operation should
449 not be interpreted individually but together with other tracefiles taken
450 from the newer version. Also keep in mind that converted coverage data should
451 only be used for overview purposes as the process itself introduces a loss
454 The result of the diff operation will be written to stdout or the tracefile
457 Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
472 If you want to work on coverage data for a user space program, use this
473 option to specify the location where the program was compiled (that's
474 where the counter files ending with .da will be stored).
476 Note that you may specify this option more than once.
484 Specify whether to capture coverage data for external source files.
486 External source files are files which are not located in one of the directories
487 specified by \-\-directory or \-\-base\-directory. Use \-\-external to include
488 external source files while capturing coverage data or \-\-no\-external to
491 Data for external source files is
508 Use this switch if you want to extract coverage data for only a particular
509 set of files from a tracefile. Additional command line parameters will be
510 interpreted as shell wildcard patterns (note that they may need to be
511 escaped accordingly to prevent the shell from expanding them first).
514 which matches at least one of those patterns will be extracted.
516 The result of the extract operation will be written to stdout or the tracefile
519 Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
528 Follow links when searching for .da files.
537 instead of kernel or directory.
539 Use this option if you have separate machines for build and test and
540 want to perform the .info file creation on the build machine. See
541 \-\-to\-package for more information.
548 Specify the location of the gcov tool.
556 Print a short help text, then exit.
559 .B \-\-ignore\-errors
563 Specify a list of errors after which to continue processing.
565 Use this option to specify a list of one or more classes of errors after which
566 lcov should continue processing instead of aborting.
569 can be a comma\-separated list of the following keywords:
572 the gcov tool returned with a non\-zero return code.
575 the source code file for a data set could not be found.
582 Capture initial zero coverage data.
584 Run lcov with \-c and this option on the directories containing .bb, .bbg
585 or .gcno files before running any test case. The result is a "baseline"
586 coverage data file that contains zero coverage for every instrumented line.
587 Combine this data file (using lcov \-a) with coverage data files captured
588 after a test run to ensure that the percentage of total lines covered is
589 correct even when not all source code files were loaded during the test.
591 Recommended procedure when capturing data for a test case:
593 1. create baseline coverage data file
595 # lcov \-c \-i \-d appdir \-o app_base.info
605 3. create test coverage data file
607 # lcov \-c \-d appdir \-o app_test.info
611 4. combine baseline and test coverage data
613 # lcov \-a app_base.info \-a app_test.info \-o app_total.info
622 .B \-\-kernel\-directory
626 Capture kernel coverage data only from
629 Use this option if you don't want to get coverage data for all of the
630 kernel, but only for specific subdirectories. This option may be specified
633 Note that you may need to specify the full path to the kernel subdirectory
634 depending on the version of the kernel gcov support.
644 List the contents of the
647 Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
651 .B \-\-list\-full\-path
653 .B \-\-no\-list\-full\-path
656 Specify whether to show full paths during list operation.
658 Use \-\-list\-full\-path to show full paths during list operation
659 or \-\-no\-list\-full\-path to show shortened paths. Paths are
667 Use this option if you want to get coverage data without regard to exclusion
668 markers in the source code file. See
670 for details on exclusion markers.
676 Use this option if you want to get coverage data for the specified directory
677 only without processing subdirectories.
691 Specify "\-" as a filename to use the standard output.
693 By convention, lcov\-generated coverage data files are called "tracefiles" and
694 should have the filename extension ".info".
701 Strip path from filenames when applying diff.
703 Use this option together with \-\-diff to tell lcov to disregard the specified
704 initial path component when matching between tracefile and diff filenames.
712 Do not print progress messages.
714 This option is implied when no output filename is specified to prevent
715 progress messages to mess with coverage data which is also printed to
723 Override a configuration directive.
725 Use this option to specify a
727 statement which overrides the corresponding configuration statement in
728 the lcovrc configuration file. You can specify this option more than once
729 to override multiple configuration statements.
732 for a list of available keywords and their meaning.
747 Use this switch if you want to remove coverage data for a particular
748 set of files from a tracefile. Additional command line parameters will be
749 interpreted as shell wildcard patterns (note that they may need to be
750 escaped accordingly to prevent the shell from expanding them first).
753 which matches at least one of those patterns will be removed.
755 The result of the remove operation will be written to stdout or the tracefile
758 Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
766 Strip path components when applying diff.
768 Use this option together with \-\-diff to tell lcov to disregard the specified
769 number of initial directories when matching tracefile and diff filenames.
776 Show summary coverage information for the specified tracefile.
778 Note that you may specify this option more than once.
780 Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
791 Specify test name to be stored in the tracefile.
793 This name identifies a coverage data set when more than one data set is merged
794 into a combined tracefile (see option \-a).
796 Valid test names can consist of letters, decimal digits and the underscore
804 Store .da files for later processing.
806 Use this option if you have separate machines for build and test and
807 want to perform the .info file creation on the build machine. To do this,
815 \- run lcov \-c [\-d directory] \-\-to-package
824 On the build machine:
827 \- run lcov \-c \-\-from-package
829 [\-o and other options]
833 This works for both kernel and user space coverage data. Note that you might
834 have to specify the path to the build directory using \-b with
835 either \-\-to\-package or \-\-from-package. Note also that the package data
836 must be converted to a .info file before recompiling the program or it will
845 Print version number, then exit.
853 Reset all execution counts to zero.
855 By default tries to reset kernel execution counts. Use the \-\-directory
856 option to reset all counters of a user space program.
858 Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
866 The system\-wide configuration file.
871 The per\-user configuration file.
875 Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>