1
2
3lcov(1) User Manuals lcov(1)
4
5
6
8 lcov - a graphical GCOV front-end
9
11 Capture coverage data tracefile (from compiler-generated data):
12 lcov -c|--capture
13 [-d|--directory directory] [-k|--kernel-directory directory]
14 [-o|--output-file tracefile] [-t|--test-name testname]
15 [-b|--base-directory directory]
16 [--build-directory directory]
17 [-i|--initial]
18 [--gcov-tool tool]
19 [--branch-coverage]
20 [--checksum] [--no-checksum] [--no-recursion] [-f|--follow]
21 [--compat-libtool] [--no-compat-libtool]
22 [--ignore-errors errors]
23 [--preserve] [--to-package package] [--from-package package]
24 [--no-markers] [--external] [--no-external]
25 [--compat mode=on|off|auto]
26 [--version-script script_file]
27
28 Generate tracefile (from compiler-generated data) with all counter val‐
29 ues set to zero:
30 lcov -z|--zerocounters
31 [-d|--directory directory] [--no-recursion] [-f|--follow]
32
33 Show coverage counts recorded in previously generated tracefile:
34 lcov -l|--list tracefile
35 [--list-full-path] [--no-list-full-path]
36
37 Aggregate multiple coverage tracefiles into one
38 lcov -a|--add-tracefile tracefile_pattern
39 [-o|--output-file tracefile]
40 [--prune-tests]
41 [--forget-test-names]
42 [--map-functions]
43 [--branch-coverage]
44 [--checksum] [--no-checksum]
45
46 Generate new tracefile from existing tracefile, keeping only data from
47 files matching pattern
48 lcov -e|--extract tracefile pattern
49 [-o|--output-file tracefile] [--checksum] [--no-checksum]
50
51 Generate new tracefile from existing tracefile, removing data from
52 files matching pattern
53 lcov -r|--remove tracefile pattern
54 [-o|--output-file tracefile] [--checksum] [--no-checksum]
55
56 Generate new tracefile from existing tracefile, modifying line numbers
57 as indicated in diff file
58 lcov --diff tracefile diff
59 [-o|--output-file tracefile] [--checksum] [--no-checksum]
60 [--convert-filenames] [--strip depth] [--path path]
61
62 Summarize tracefile content:
63 lcov --summary tracefile
64 [--fail-under-lines percentage]
65
66 Print help message and exit
67 lcov --summary
68
69 Common lcov options - supported by all the above use cases:
70 lcov ...
71 [--keep-going]
72 [--filter type]
73 [-q|--quiet]
74 [-v|--verbose]
75 [--debug]
76 [(--parallel|-j) [integer]]
77 [--memory integer_num_Mb]
78 [--branch-coverage]
79 [--config-file config-file] [--rc keyword=value]
80 [--include glob_pattern]
81 [--exclude glob_pattern]
82 [--erase-functions regexp_pattern]
83 [--substitute regexp_pattern]
84 [--omit-lines regexp_pattern]
85
86
88 lcov is a graphical front-end for GCC's coverage testing tool gcov. It
89 collects line, function and branch coverage data for multiple source
90 files and creates HTML pages containing the source code annotated with
91 coverage information. It also adds overview pages for easy navigation
92 within the file structure.
93
94 Use lcov to collect coverage data and genhtml to create HTML pages.
95 Coverage data can either be collected from the currently running Linux
96 kernel or from a user space application. To do this, you have to com‐
97 plete the following preparation steps:
98
99 For Linux kernel coverage:
100 Follow the setup instructions for the gcov-kernel infrastruc‐
101 ture: https://docs.kernel.org/dev-tools/gcov.html
102
103 For user space application coverage:
104 Compile the application with GCC using the options "-fprofile-arcs"
105 and "-ftest-coverage" or "--coverage".
106
107 Please note that this man page refers to the output format of lcov as
108 ".info file" or "tracefile" and that the output of GCOV is called ".da
109 file".
110
111 Also note that when printing percentages, 0% and 100% are only printed
112 when the values are exactly 0% and 100% respectively. Other values
113 which would conventionally be rounded to 0% or 100% are instead printed
114 as nearest non-boundary value. This behavior is in accordance with that
115 of the gcov(1) tool.
116
117
119 -a tracefile_pattern
120 --add-tracefile tracefile_pattern
121 Add contents of all files matching glob pattern tracefile_pat‐
122 tern.
123
124 Specify several tracefiles using the -a switch to combine the
125 coverage data contained in these files by adding up execution
126 counts for matching test and filename combinations.
127
128 The result of the add operation will be written to stdout or the
129 tracefile specified with -o.
130
131 Only one of -z, -c, -a, -e, -r, -l, --diff or --summary may be
132 specified at a time.
133
134
135 -b directory
136 --base-directory directory
137 Use directory as base directory for relative paths.
138
139 Use this option to specify the base directory of a build-envi‐
140 ronment when lcov produces error messages like:
141
142 ERROR: could not read source file /home/user/project/sub‐
143 dir1/subdir2/subdir1/subdir2/file.c
144
145 In this example, use /home/user/project as base directory.
146
147 This option is required when using lcov on projects built with
148 libtool or similar build environments that work with a base di‐
149 rectory, i.e. environments, where the current working directory
150 when invoking the compiler is not the same directory in which
151 the source code file is located.
152
153 Note that this option will not work in environments where multi‐
154 ple base directories are used. In that case use configuration
155 file setting geninfo_auto_base=1 (see lcovrc(5)).
156
157
158 --build-directory build_directory
159 Searchfor.gcnodatafilesfrombuild_directoryratherthan adjacent to
160 the corresponding .gcda file.
161
162 See man geninfo(1)) for details.
163
164 -c
165 --capture
166 Capture coverage data.
167
168 By default captures the current kernel execution counts and
169 writes the resulting coverage data to the standard output. Use
170 the --directory option to capture counts for a user space pro‐
171 gram.
172
173 The result of the capture operation will be written to stdout or
174 the tracefile specified with -o.
175
176 Only one of -z, -c, -a, -e, -r, -l, --diff or --summary may be
177 specified at a time.
178
179 --branch-coverage
180 Collect and/or retain branch coverage data.
181
182 This is equivalent to using the option "--rc lcov_branch_cover‐
183 age=1"; the option was added to better match the genhml inter‐
184 face.
185
186
187 --checksum
188 --no-checksum
189 Specify whether to generate checksum data when writing trace‐
190 files and/or to verify matching checksums when combining trace
191 files.
192
193 Use --checksum to enable checksum generation or --no-checksum to
194 disable it. Checksum generation is disabled by default.
195
196 When checksum generation is enabled, a checksum will be gener‐
197 ated for each source code line and stored along with the cover‐
198 age data. This checksum will be used to prevent attempts to com‐
199 bine coverage data from different source code versions.
200
201 If you don't work with different source code versions, disable
202 this option to speed up coverage data processing and to reduce
203 the size of tracefiles.
204
205 Note that this options is somewhat subsumed by the --ver‐
206 sion-script option - which does something similar, but at the
207 'whole file' level.
208
209 --compat mode=value[,mode=value,...]
210 Set compatibility mode.
211
212 Use --compat to specify that lcov should enable one or more com‐
213 patibility modes when capturing coverage data. You can provide a
214 comma-separated list of mode=value pairs to specify the values
215 for multiple modes.
216
217 Valid values are:
218
219 on
220 Enable compatibility mode.
221 off
222 Disable compatibility mode.
223 auto
224 Apply auto-detection to determine if compatibility mode
225 is required. Note that auto-detection is not available
226 for all compatibility modes.
227
228 If no value is specified, 'on' is assumed as default value.
229
230 Valid modes are:
231
232 libtool
233 Enable this mode if you are capturing coverage data for a
234 project that was built using the libtool mechanism. See
235 also --compat-libtool.
236
237 The default value for this setting is 'on'.
238
239 hammer
240 Enable this mode if you are capturing coverage data for a
241 project that was built using a version of GCC 3.3 that
242 contains a modification (hammer patch) of later GCC ver‐
243 sions. You can identify a modified GCC 3.3 by checking
244 the build directory of your project for files ending in
245 the extension '.bbg'. Unmodified versions of GCC 3.3 name
246 these files '.bb'.
247
248 The default value for this setting is 'auto'.
249
250 split_crc
251 Enable this mode if you are capturing coverage data for a
252 project that was built using a version of GCC 4.6 that
253 contains a modification (split function checksums) of
254 later GCC versions. Typical error messages when running
255 lcov on coverage data produced by such GCC versions are
256 ´out of memory' and 'reached unexpected end of file'.
257
258 The default value for this setting is 'auto'
259
260
261 --compat-libtool
262 --no-compat-libtool
263 Specify whether to enable libtool compatibility mode.
264
265 Use --compat-libtool to enable libtool compatibility mode or
266 --no-compat-libtool to disable it. The libtool compatibility
267 mode is enabled by default.
268
269 When libtool compatibility mode is enabled, lcov will assume
270 that the source code relating to a .da file located in a direc‐
271 tory named ".libs" can be found in its parent directory.
272
273 If you have directories named ".libs" in your build environment
274 but don't use libtool, disable this option to prevent problems
275 when capturing coverage data.
276
277 --config-file config-file
278 Specify a configuration file to use. See the lcovrc man page
279 for details of the file format and options.
280
281 When this option is specified, neither the system-wide configu‐
282 ration file /etc/lcovrc, nor the per-user configuration file
283 ~/.lcovrc is read.
284
285 This option may be useful when there is a need to run several
286 instances of lcov with different configuration file options in
287 parallel.
288
289 Note that this option must be specified in full - abbreviations
290 are not supported.
291
292
293 --convert-filenames
294 Convert filenames when applying diff.
295
296 Use this option together with --diff to rename the file names of
297 processed data sets according to the data provided by the diff.
298
299 --diff tracefile difffile
300 Convert coverage data in tracefile using source code diff file
301 difffile.
302
303 Use this option if you want to merge coverage data from differ‐
304 ent source code levels of a program, e.g. when you have data
305 taken from an older version and want to combine it with data
306 from a more current version. lcov will try to map source code
307 lines between those versions and adjust the coverage data re‐
308 spectively. difffile needs to be in unified format, i.e. it has
309 to be created using the "-u" option of the diff tool.
310
311 Note that lines which are not present in the old version will
312 not be counted as instrumented, therefore tracefiles resulting
313 from this operation should not be interpreted individually but
314 together with other tracefiles taken from the newer version.
315 Also keep in mind that converted coverage data should only be
316 used for overview purposes as the process itself introduces a
317 loss of accuracy.
318
319 The result of the diff operation will be written to stdout or
320 the tracefile specified with -o.
321
322 Only one of -z, -c, -a, -e, -r, -l, --diff or --summary may be
323 specified at a time.
324
325 -d directory
326 --directory directory
327 Use .da files in directory instead of kernel.
328
329 If you want to work on coverage data for a user space program,
330 use this option to specify the location where the program was
331 compiled (that's where the counter files ending with .da will be
332 stored).
333
334 Note that you may specify this option more than once.
335
336 --exclude pattern
337 Exclude source files matching pattern.
338
339 Use this switch if you want to exclude coverage data for a par‐
340 ticular set of source files matching any of the given patterns.
341 Multiple patterns can be specified by using multiple --exclude
342 command line switches. The patterns will be interpreted as shell
343 wildcard patterns (note that they may need to be escaped accord‐
344 ingly to prevent the shell from expanding them first).
345
346 Note: The pattern must be specified to match the absolute path
347 of each source file. If you specify a pattern which does not
348 seem to be correctly applied - files that you expected to be ex‐
349 cluded still appear in the output - you can look for warning
350 messages in the log file. lcov will emit a warning for every
351 pattern which is not applied at least once.
352
353 Can be combined with the --include command line switch. If a
354 given file matches both the include pattern and the exclude pat‐
355 tern, the exclude pattern will take precedence.
356
357 --erase-functions regexp
358 Exclude coverage data from lines which fall within a function
359 whose name matches the supplied regexp. Note that this is a
360 mangled or demangled name, depending on whether the --deman‐
361 gle-cpp option is used or not.
362
363 Note that this option requires that you use a gcc version which
364 is new enough to support function begin/end line reports.
365
366 --substitute regexp_pattern
367 Apply Perl regexp regexp_pattern to source file names found dur‐
368 ing processing. This is useful when the path name reported by
369 gcov does not match your source layout and the file is not
370 found, or when the paths found in the extracted .info file does
371 not match your source code layout.
372
373 Use this option in situations where geninfo cannot find the cor‐
374 rect path to source code files of a project. By providing a reg‐
375 exp_pattern in Perl regular expression format (see perlre(1)) ,
376 you can instruct geninfo to remove or change parts of the incor‐
377 rect source path.
378
379 Example:
380
381 1. When geninfo reports that it cannot find source file
382
383 /path/to/src/.libs/file.c
384
385 while the file is actually located in
386
387 /path/to/src/file.c
388
389 use the following parameter:
390
391 --substitute 's#/.libs##g'
392
393 This will remove all "/.libs" strings from the path.
394
395 2. When geninfo reports that it cannot find source file
396
397 /tmp/build/file.c
398
399 while the file is actually located in
400
401 /usr/src/file.c
402
403 use the following parameter:
404
405 --substitute 's#/tmp/build#/usr/src#g'
406
407 This will change all "/tmp/build" strings in the path to
408 "/usr/src".
409
410 --omit-lines regexp
411 Exclude coverage data from lines whose content matches regexp.
412
413 Use this switch if you want to exclude line and branch coverage
414 data for some particular constructs in your code (e.g., some
415 complicated macro). Multiple patterns can be specified by using
416 multiple --omit-lines command line switches. The regexp will be
417 interpreted as perl regular expressions (note that they may need
418 to be escaped accordingly to prevent the shell from expanding
419 them first). If you want the pattern to explicitly match from
420 the start or end of the line, your regexp should start and/or
421 end with "^" and/or "$".
422
423
424 --external
425 --no-external
426 Specify whether to capture coverage data for external source
427 files.
428
429 External source files are files which are not located in one of
430 the directories specified by --directory or --base-directory.
431 Use --external to include external source files while capturing
432 coverage data or --no-external to ignore this data.
433
434 Data for external source files is included by default.
435
436
437 --forget-test-names
438 If non-zero, ignore testcase names in .info file - i.e., treat
439 all coverage data as if it came from the same testcase. This
440 may improve performance and reduce memory consumption if user
441 does not need per-testcase coverage summary in coverage reports.
442
443 This option can also be configured permanently using the config‐
444 uration file option forget_testcase_names.
445
446
447 --prune-tests
448 Determine list of unique tracefiles.
449
450 Use this option to determine a list of unique tracefiles from
451 the list specified by --add-tracefile. A tracefile is consid‐
452 ered to be unique if it is the only tracefile that:
453
454
455
456 1. contains data for a specific source file
457
458 2. contains data for a specific test case name
459
460 3. contains non-zero coverage data for a specific line,
461 function or branch
462
463 Note that the list of retained files may depend on the order
464 they are processed. For example, if A and B contain identical
465 coverage data, then the first one we see will be retained and
466 the second will be pruned. The file processing order is nonde‐
467 terministic when the --parallel option is used - implying that
468 the pruned result may differ from one execution to the next in
469 this case.
470
471 --prune-testsmustbespecifiedtogetherwith --add-tracefile. When
472 specified, lcov will emit the list of unique files rather than
473 combined tracefile data.
474
475
476 --map-functions
477 List tracefiles with non-zero coverage for each function.
478
479 Use this option to determine the list of tracefiles that contain
480 non-zero coverage data for each function from the list of trace‐
481 files specified by --add-tracefile.
482
483 This option must be specified together with --add-tracefile.
484 When specified, lcov will emit the list of functions and associ‐
485 ated tracefiles rather than combined tracefile data.
486
487 --version-script script
488
489 Use script to get a source file's version ID from revision con‐
490 trol when extracting data and to compare version IDs for the
491 purpose of error checking when merging .info files.
492
493 See the genhtml man page for more details on the version script.
494
495 -e tracefile pattern
496 --extract tracefile pattern
497 Extract data from tracefile.
498
499 Use this switch if you want to extract coverage data for only a
500 particular set of files from a tracefile. Additional command
501 line parameters will be interpreted as shell wildcard patterns
502 (note that they may need to be escaped accordingly to prevent
503 the shell from expanding them first). Every file entry in
504 tracefile which matches at least one of those patterns will be
505 extracted.
506
507 Note: The pattern must be specified to match the absolute path
508 of each source file.
509
510 The result of the extract operation will be written to stdout or
511 the tracefile specified with -o.
512
513 Only one of -z, -c, -a, -e, -r, -l, --diff or --summary may be
514 specified at a time.
515
516 -f
517 --follow
518 Follow links when searching for .da files.
519
520 --from-package package
521 Use .da files in package instead of kernel or directory.
522
523 Use this option if you have separate machines for build and test
524 and want to perform the .info file creation on the build ma‐
525 chine. See --to-package for more information.
526
527 --gcov-tool tool
528 Specify the location of the gcov tool.
529
530 See the geninfo man page for more details.
531
532 -h
533 --help
534 Print a short help text, then exit.
535
536 --include pattern
537 Include source files matching pattern.
538
539 Use this switch if you want to include coverage data for only a
540 particular set of source files matching any of the given pat‐
541 terns. Multiple patterns can be specified by using multiple
542 --include command line switches. The patterns will be inter‐
543 preted as shell wildcard patterns (note that they may need to be
544 escaped accordingly to prevent the shell from expanding them
545 first).
546
547 Note: The pattern must be specified to match the absolute path
548 of each source file.
549
550 If you specify a pattern which does not seem to be correctly ap‐
551 plied - files that you expected to be included in the output do
552 not appear - lcov will generate an error message of type 'un‐
553 used'. See the --ignore-errors option for how to make lcov ig‐
554 nore the error or turn it into a warning.
555
556 --ignore-errors errors
557 Specify a list of errors after which to continue processing.
558
559 Use this option to specify a list of one or more classes of er‐
560 rors after which lcov should continue processing instead of
561 aborting. Note that the tool will generate a warning (rather
562 than a fatal error) unless you ignore the error two (or more)
563 times:
564 lcov ... --ignore-errors source,source ...
565
566 errors can be a comma-separated list of the following keywords:
567
568 branch: branch ID (2nd field in the .info file 'BRDA' entry)
569 does not follow expected integer sequence.
570
571 callback: Version script error.
572
573 corrupt: corrupt/unreadable file found.
574
575 count: An excessive number of messages of some class have been
576 reported - subsequent messages of that type will be suppressed.
577 The limit can be controlled by the 'max_message_count' variable.
578 See the lcovrc man page.
579
580 deprecated: You are using a deprecated option. This option will
581 be removed in an upcoming release - so you should change your
582 scripts now.
583
584 empty: the .info data file is empty (e.g., because all the code
585 was 'removed' or excluded.
586
587 format: unexpected syntax found in .info file.
588
589 gcov: the gcov tool returned with a non-zero return code.
590
591 graph: the graph file could not be found or is corrupted.
592
593 mismatch: Inconsistent entries found in trace file:
594 - branch expression (3rd field in the .info file 'BRDA' entry)
595 of merge data does not match, or
596 - function execution count (FNDA:...) but no function declara‐
597 tion (FN:...).
598
599 negative: negative 'hit' count found.
600
601 Note that negative counts may be caused by a known GCC bug - see
602
603 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68080
604
605 and try compiling with "-fprofile-update=atomic". You will need
606 to recompile, re-run your tests, and re-capture coverage data.
607
608 package: a required perl package is not installed on your sys‐
609 tem. In some cases, it is possible to ignore this message and
610 continue - however, certain features will be disabled in that
611 case.
612
613 parallel: various types of errors related to parallelism - e.g.,
614 child process died due to some error. If you see an error re‐
615 lated to parallel execution, it may be a good idea to remove the
616 --parallel flag and try again.
617
618 source: the source code file for a data set could not be found.
619
620 unsupported: the requested feature is not supported for this
621 tool configuration. For example, function begin/end line range
622 exclusions use some GCOV features that are not available in
623 older GCC releases.
624
625 unused: the include/exclude/erase/omit/substitute pattern did
626 not match any file pathnames.
627
628 version: revision control IDs of the file which we are trying to
629 merge are not the same - line numbering and other information
630 may be incorrect.
631
632 Also see man lcovrc for a discussion of the 'max_message_count'
633 parameter which can be used to control the number of warnings
634 which are emitted before all subsequent messages are suppressed.
635 This can be used to reduce log file volume.
636
637
638 --keep-going
639 Do not stop if error occurs: attempt to generate a result, how‐
640 ever flawed.
641
642 This command line option corresponds to the stop_on_error [0|1]
643 lcovrc option. See the lcovrc man page for more details.
644
645 --preserve
646 Preserve intermediate data files generated by various steps in
647 the tool - e.g., for debugging. By default, these files are
648 deleted.
649
650 --filter filters
651 Specify a list of coverpoint filters to apply to input data.
652 See the genhtml man page for details.
653
654
655 --demangle-cpp [param]
656 Demangle C++ function names. See the genhtml man page for de‐
657 tails.
658
659
660
661 -i
662 --initial
663 Capture initial zero coverage data.
664
665 Run lcov with -c and this option on the directories containing
666 .bb, .bbg or .gcno files before running any test case. The re‐
667 sult is a "baseline" coverage data file that contains zero cov‐
668 erage for every instrumented line. Combine this data file (us‐
669 ing lcov -a) with coverage data files captured after a test run
670 to ensure that the percentage of total lines covered is correct
671 even when not all source code files were loaded during the test.
672
673 Recommended procedure when capturing data for a test case:
674
675 1. create baseline coverage data file
676 # lcov -c -i -d appdir -o app_base.info
677
678 2. perform test
679 # appdir/test
680
681 3. create test coverage data file
682 # lcov -c -d appdir -o app_test.info
683
684 4. combine baseline and test coverage data
685 # lcov -a app_base.info -a app_test.info -o app_to‐
686 tal.info
687
688
689 -k subdirectory
690 --kernel-directory subdirectory
691 Capture kernel coverage data only from subdirectory.
692
693 Use this option if you don't want to get coverage data for all
694 of the kernel, but only for specific subdirectories. This option
695 may be specified more than once.
696
697 Note that you may need to specify the full path to the kernel
698 subdirectory depending on the version of the kernel gcov sup‐
699 port.
700
701 -l tracefile
702 --list tracefile
703 List the contents of the tracefile.
704
705 Only one of -z, -c, -a, -e, -r, -l, --diff or --summary may be
706 specified at a time.
707
708 --list-full-path
709 --no-list-full-path
710 Specify whether to show full paths during list operation.
711
712 Use --list-full-path to show full paths during list operation or
713 --no-list-full-path to show shortened paths. Paths are shortened
714 by default.
715
716 --no-markers
717 Use this option if you want to get coverage data without regard
718 to exclusion markers in the source code file. See geninfo (1)
719 for details on exclusion markers.
720
721 --no-recursion
722 Use this option if you want to get coverage data for the speci‐
723 fied directory only without processing subdirectories.
724
725 -o tracefile
726 --output-file tracefile
727 Write data to tracefile instead of stdout.
728
729 Specify "-" as a filename to use the standard output.
730
731 By convention, lcov-generated coverage data files are called
732 "tracefiles" and should have the filename extension ".info".
733
734 --path path
735 Strip path from filenames when applying diff.
736
737 Use this option together with --diff to tell lcov to disregard
738 the specified initial path component when matching between
739 tracefile and diff filenames.
740
741 -v
742 --verbose
743 Increment informational message verbosity. This is mainly used
744 for script and/or flow debugging - e.g., to figure out which
745 data file are found, where. Also see the --quiet flag.
746
747 Messages are sent to stdout unless there is no output file
748 (i.e., if the coverage data is written to stdout rather than to
749 a file) and to stderr otherwise.
750
751 -q
752 --quiet
753 Decrement informational message verbosity.
754
755 Decreased verbosity will suppress 'progress' messages for exam‐
756 ple - while error and warning messages will continue to be
757 printed.
758
759 --debug
760 Increment 'debug messages' verbosity. This is useful primarily
761 to developers who want to enhance the lcov tool suite.
762
763
764 --parallel [ integer ]
765 -j [ integer ]
766 Specify parallelism to use during processing (maximum number of
767 forked child processes). If the optional integer parallelism
768 parameter is zero or is missing, then use to use up the number
769 of cores on the machine. Default is not to use a single process
770 (no parallelism).
771
772 Currently - parallelism is used with the --add-tracefile and
773 --capture options.
774
775 --memory integer
776 Specify the maximum amount of memory to use during parallel pro‐
777 cessing, in Mb. Effectively, the process will not fork() if
778 this limit would be exceeded. Default is 0 (zero) - which means
779 that there is no limit.
780
781 This option may be useful if the compute farm environment im‐
782 poses strict limits on resource utilization such that the job
783 will be killed if it tries to use too many parallel children -
784 but the user does now know a priori what the permissible maximum
785 is. This option enables the tool to use maximum parallelism -
786 up to the limit imposed by the memory restriction.
787
788
789
790 --rc keyword=value
791 Override a configuration directive.
792
793 Use this option to specify a keyword=value statement which over‐
794 rides the corresponding configuration statement in the lcovrc
795 configuration file. You can specify this option more than once
796 to override multiple configuration statements. See lcovrc(5)
797 for a list of available keywords and their meaning.
798
799 -r tracefile pattern
800 --remove tracefile pattern
801 Remove data from tracefile.
802
803 Use this switch if you want to remove coverage data for a par‐
804 ticular set of files from a tracefile. Additional command line
805 parameters will be interpreted as shell wildcard patterns (note
806 that they may need to be escaped accordingly to prevent the
807 shell from expanding them first). Every file entry in tracefile
808 which matches at least one of those patterns will be removed.
809
810 Note: The pattern must be specified to match the absolute path
811 of each source file.
812
813 The result of the remove operation will be written to stdout or
814 the tracefile specified with -o.
815
816 Only one of -z, -c, -a, -e, -r, -l, --diff or --summary may be
817 specified at a time.
818
819 --strip depth
820 Strip path components when applying diff.
821
822 Use this option together with --diff to tell lcov to disregard
823 the specified number of initial directories when matching trace‐
824 file and diff filenames.
825
826 --summary tracefile
827 Show summary coverage information for the specified tracefile.
828
829 Note that you may specify this option more than once.
830
831 Only one of -z, -c, -a, -e, -r, -l, --diff or --summary may be
832 specified at a time.
833
834 --fail-under-lines percentage
835 Use this option together with --summary to tell lcov to exit
836 with a status of 1 if the total line coverage is less than per‐
837 centage.
838
839 -t testname
840 --test-name testname
841 Specify test name to be stored in the tracefile.
842
843 This name identifies a coverage data set when more than one data
844 set is merged into a combined tracefile (see option -a).
845
846 Valid test names can consist of letters, decimal digits and the
847 underscore character ("_").
848
849 --to-package package
850 Store .da files for later processing.
851
852 Use this option if you have separate machines for build and test
853 and want to perform the .info file creation on the build ma‐
854 chine. To do this, follow these steps:
855
856 On the test machine:
857 - run the test
858 - run lcov -c [-d directory] --to-package file
859 - copy file to the build machine
860
861 On the build machine:
862 - run lcov -c --from-package file [-o and other options]
863
864 This works for both kernel and user space coverage data. Note
865 that you might have to specify the path to the build directory
866 using -b with either --to-package or --from-package. Note also
867 that the package data must be converted to a .info file before
868 recompiling the program or it will become invalid.
869
870 --version
871 Print version number, then exit.
872
873 -z
874 --zerocounters
875 Reset all execution counts to zero.
876
877 By default tries to reset kernel execution counts. Use the --di‐
878 rectory option to reset all counters of a user space program.
879
880 Only one of -z, -c, -a, -e, -r, -l, --diff or --summary may be
881 specified at a time.
882
883 --tempdir dirname
884 Write temporary and intermediate data to indicated directory.
885 Default is "/tmp".
886
887
889 /etc/lcovrc
890 The system-wide configuration file.
891
892 ~/.lcovrc
893 The per-user configuration file.
894
895
897 Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
898
899 Henry Cox <henry.cox@mediatek.com>
900 Filtering, error management, parallel execution sections.
901
902
904 lcovrc(5), genhtml(1), geninfo(1), genpng(1), gendesc(1), gcov(1)
905
906 https://github.com/linux-test-project/lcov
907
908
909
9102023-11-27 LCOV 2.0 lcov(1)