Implementation of the Touch Exploration Mode - Part II (ash)
[chromium-blink-merge.git] / third_party / lcov / man / lcov.1
blob092d86560bcbebfb87985d9ae7086ec399485709
1 .TH lcov 1 "LCOV 1.10" 2012\-10\-10 "User Manuals"
2 .SH NAME
3 lcov \- a graphical GCOV front\-end
4 .SH SYNOPSIS
5 .B lcov
6 .BR \-c | \-\-capture
7 .RS 5
8 .br
9 .RB [ \-d | \-\-directory
10 .IR directory ]
11 .RB [ \-k | \-\-kernel\-directory
12 .IR directory ]
13 .br
14 .RB [ \-o | \-\-output\-file
15 .IR tracefile ]
16 .RB [ \-t | \-\-test\-name
17 .IR testname ]
18 .br
19 .RB [ \-b | \-\-base\-directory
20 .IR directory ]
21 .RB [ \-i | \-\-initial ]
22 .RB [ \-\-gcov\-tool
23 .IR tool ]
24 .br
25 .RB [ \-\-checksum ]
26 .RB [ \-\-no\-checksum ]
27 .RB [ \-\-no\-recursion ]
28 .RB [ \-f | \-\-follow ]
29 .br
30 .RB [ \-\-compat\-libtool ]
31 .RB [ \-\-no\-compat\-libtool ]
32 .RB [ \-\-ignore\-errors
33 .IR errors ]
34 .br
35 .RB [ \-\-to\-package
36 .IR package ]
37 .RB [ \-\-from\-package
38 .IR package ]
39 .RB [ \-q | \-\-quiet ]
40 .br
41 .RB [ \-\-no\-markers ]
42 .RB [ \-\-external ]
43 .RB [ \-\-no\-external ]
44 .br
45 .RB [ \-\-config\-file
46 .IR config\-file ]
47 .RB [ \-\-rc
48 .IR keyword = value ]
49 .br
50 .RB [ \-\-compat
51 .IR  mode =on|off|auto]
52 .br
53 .RE
55 .B lcov
56 .BR \-z | \-\-zerocounters
57 .RS 5
58 .br
59 .RB [ \-d | \-\-directory
60 .IR directory ]
61 .RB [ \-\-no\-recursion ]
62 .RB [ \-f | \-\-follow ]
63 .br
64 .RB [ \-q | \-\-quiet ]
65 .br
66 .RE
68 .B lcov
69 .BR \-l | \-\-list
70 .I tracefile
71 .RS 5
72 .br
73 .RB [ \-q | \-\-quiet ]
74 .RB [ \-\-list\-full\-path ]
75 .RB [ \-\-no\-list\-full\-path ]
76 .br
77 .RB [ \-\-config\-file
78 .IR config\-file ]
79 .RB [ \-\-rc
80 .IR keyword = value ]
81 .br
82 .RE
84 .B lcov
85 .BR \-a | \-\-add\-tracefile
86 .I tracefile
87 .RS 5
88 .br
89 .RB [ \-o | \-\-output\-file
90 .IR tracefile ]
91 .RB [ \-\-checksum ]
92 .RB [ \-\-no\-checksum ]
93 .br
94 .RB [ \-q | \-\-quiet ]
95 .RB [ \-\-config\-file
96 .IR config\-file ]
97 .RB [ \-\-rc
98 .IR keyword = value ]
99 .br
102 .B lcov
103 .BR \-e | \-\-extract
104 .I tracefile pattern
105 .RS 5
107 .RB [ \-o | \-\-output\-file
108 .IR tracefile ]
109 .RB [ \-\-checksum ]
110 .RB [ \-\-no\-checksum ]
112 .RB [ \-q | \-\-quiet ]
113 .RB [ \-\-config\-file
114 .IR config\-file ]
115 .RB [ \-\-rc
116 .IR keyword = value ]
120 .B lcov
121 .BR \-r | \-\-remove
122 .I tracefile pattern
123 .RS 5
125 .RB [ \-o | \-\-output\-file
126 .IR tracefile ]
127 .RB [ \-\-checksum ]
128 .RB [ \-\-no\-checksum ]
130 .RB [ \-q | \-\-quiet ]
131 .RB [ \-\-config\-file
132 .IR config\-file ]
133 .RB [ \-\-rc
134 .IR keyword = value ]
138 .B lcov
139 .BR \-\-diff
140 .IR "tracefile diff"
141 .RS 5
143 .RB [ \-o | \-\-output\-file
144 .IR tracefile ]
145 .RB [ \-\-checksum ]
146 .RB [ \-\-no\-checksum ]
148 .RB [ \-\-convert\-filenames ]
149 .RB [ \-\-strip
150 .IR depth ]
151 .RB [ \-\-path
152 .IR path ]
153 .RB [ \-q | \-\-quiet ]
155 .RB [ \-\-config\-file
156 .IR config\-file ]
157 .RB [ \-\-rc
158 .IR keyword = value ]
162 .B lcov
163 .BR \-\-summary
164 .I tracefile
165 .RS 5
167 .RB [ \-q | \-\-quiet ]
171 .B lcov
172 .RB [ \-h | \-\-help ]
173 .RB [ \-v | \-\-version ]
174 .RS 5
178 .SH DESCRIPTION
179 .B lcov
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.
186 .B lcov
187 to collect coverage data and
188 .B genhtml
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
208 .B lcov
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
216 .BR gcov (1)
217 tool.
219 .SH OPTIONS
222 .B \-a
223 .I tracefile
225 .B \-\-add\-tracefile
226 .I tracefile
229 Add contents of
230 .IR 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
237 specified with \-o.
239 Only one of  \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
240 specified at a time.
244 .B \-b
245 .I directory
247 .B \-\-base\-directory
248 .I directory
251 .RI "Use " 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
271 (see
272 .BR lcovrc (5)).
275 .B \-c
277 .B \-\-capture
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
287 specified with \-o.
289 Only one of  \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
290 specified at a time.
293 .B \-\-checksum
295 .B \-\-no\-checksum
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
302 .B disabled
303 by default.
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
308 code versions.
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.
314 .B \-\-compat
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.
324 Valid
325 .I values
326 are:
328 .B on
330 Enable compatibility mode.
332 .B off
334 Disable compatibility mode.
336 .B auto
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.
344 Valid
345 .I modes
346 are:
348 .B libtool
350 Enable this mode if you are capturing coverage data for a project that
351 was built using the libtool mechanism. See also
352 \-\-compat\-libtool.
354 The default value for this setting is 'on'.
357 .B hammer
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'.
368 .B split_crc
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
390 .B enabled
391 by default.
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.
401 .B \-\-config\-file
402 .I config\-file
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
411 instances of
412 .B lcov
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.
425 .B \-\-diff
426 .I tracefile
427 .I difffile
430 Convert coverage data in
431 .I tracefile
432 using source code diff file
433 .IR difffile .
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.
438 .B lcov
439 will try to map source code lines between those versions and adjust the coverage
440 data respectively.
441 .I difffile
442 needs to be in unified format, i.e. it has to be created using the "\-u" option
443 of the
444 .B diff
445 tool.
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
452 of accuracy.
454 The result of the diff operation will be written to stdout or the tracefile
455 specified with \-o.
457 Only one of  \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
458 specified at a time.
461 .B \-d
462 .I directory
464 .B \-\-directory
465 .I  directory
468 Use .da files in
469 .I directory
470 instead of kernel.
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.
479 .B \-\-external
481 .B \-\-no\-external
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
489 ignore this data.
491 Data for external source files is
492 .B included
493 by default.
496 .B \-e
497 .I tracefile
498 .I pattern
500 .B \-\-extract
501 .I tracefile
502 .I pattern
505 Extract data from
506 .IR tracefile .
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).
512 Every file entry in
513 .I tracefile
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
517 specified with \-o.
519 Only one of  \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
520 specified at a time.
523 .B \-f
525 .B \-\-follow
528 Follow links when searching for .da files.
531 .B \-\-from\-package
532 .I package
535 Use .da files in
536 .I package
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.
544 .B \-\-gcov\-tool
545 .I tool
548 Specify the location of the gcov tool.
551 .B \-h
553 .B \-\-help
556 Print a short help text, then exit.
559 .B \-\-ignore\-errors
560 .I 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.
568 .I errors
569 can be a comma\-separated list of the following keywords:
571 .B gcov:
572 the gcov tool returned with a non\-zero return code.
574 .B source:
575 the source code file for a data set could not be found.
578 .B \-i
580 .B \-\-initial
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
599 2. perform test
601 # appdir/test
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
619 .B \-k
620 .I subdirectory
622 .B \-\-kernel\-directory
623 .I subdirectory
626 Capture kernel coverage data only from
627 .IR subdirectory .
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
631 more than once.
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.
637 .B \-l
638 .I tracefile
640 .B \-\-list
641 .I tracefile
644 List the contents of the
645 .IR tracefile .
647 Only one of  \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
648 specified at a time.
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
660 .B shortened
661 by default.
664 .B \-\-no\-markers
667 Use this option if you want to get coverage data without regard to exclusion
668 markers in the source code file. See
669 .BR "geninfo " (1)
670 for details on exclusion markers.
673 .B \-\-no\-recursion
676 Use this option if you want to get coverage data for the specified directory
677 only without processing subdirectories.
680 .B \-o
681 .I tracefile
683 .B \-\-output\-file
684 .I tracefile
687 Write data to
688 .I tracefile
689 instead of stdout.
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".
697 .B \-\-path
698 .I path
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.
707 .B \-q
709 .B \-\-quiet
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
716 the standard output.
719 .B \-\-rc
720 .IR keyword = value
723 Override a configuration directive.
725 Use this option to specify a
726 .IR keyword = value
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.
731 .BR lcovrc (5)
732 for a list of available keywords and their meaning.
735 .B \-r
736 .I tracefile
737 .I pattern
739 .B \-\-remove
740 .I tracefile
741 .I pattern
744 Remove data from
745 .IR tracefile .
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).
751 Every file entry in
752 .I tracefile
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
756 specified with \-o.
758 Only one of  \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
759 specified at a time.
762 .B \-\-strip
763 .I depth
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.
772 .B \-\-summary
773 .I tracefile
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
781 specified at a time.
784 .B \-t
785 .I testname
787 .B \-\-test\-name
788 .I testname
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
797 character ("_").
800 .B \-\-to\-package
801 .I package
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,
808 follow these steps:
810 On the test machine:
813 \- run the test
815 \- run lcov \-c [\-d directory] \-\-to-package
816 .I file
818 \- copy
819 .I file
820 to the build machine
824 On the build machine:
827 \- run lcov \-c \-\-from-package
828 .I file
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
837 become invalid.
840 .B \-v
842 .B \-\-version
845 Print version number, then exit.
848 .B \-z
850 .B \-\-zerocounters
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
859 specified at a time.
862 .SH FILES
864 .I /etc/lcovrc
866 The system\-wide configuration file.
869 .I ~/.lcovrc
871 The per\-user configuration file.
874 .SH AUTHOR
875 Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
877 .SH SEE ALSO
878 .BR lcovrc (5),
879 .BR genhtml (1),
880 .BR geninfo (1),
881 .BR genpng (1),
882 .BR gendesc (1),
883 .BR gcov (1)