LCOV(1) LCOV LCOV(1) (NAME) lcov - GCOV (SYNOPSIS) ( ). lcov ( <<.info>>) geninfo(1) . lcov -c | --capture [ -d | --directory *directory* ] [ -k | --kernel-directory *directory* ] [ -o | --output-file *tracefile* ] [ -t | --test-name *testname* ] [ -b | --base-directory *directory* ] [ --build-directory *directory* ] [ --source-directory *directory* ] [ -i | --initial ] [ --all ] [ --gcov-tool *tool* ] [ --branch-coverage ] [ --mcdc-coverage ] [ --demangle-cpp [ *param* ] ] [ --checksum ] [ --no-checksum ] [ --no-recursion ] [ -f | --follow ] [ --sort-input ] [ --compat-libtool ] [ --no-compat-libtool ] [ --msg-log [ *log_file_name* ] ] [ --ignore-errors *errors* ] [ --expect-message-count *message_type=expr[,message_type=expr..]* ] [ --preserve ] [ --to-package *package* ] [ --from-package *package* ] [ --no-markers ] [ --external ] [ --no-external ] [ --compat *mode*\ =on|off|auto] [ --context-script *script_file* ] [ --criteria-script *script_file* ] [ --history-script *callback* ] [ --resolve-script *script_file* ] [ --version-script *script_file* ] [ --unreachable-script *callback* ] [ --comment *comment_string* ] [ --large-file *regexp* ] ( ) : lcov -z | --zerocounters [ -d | --directory *directory* ] [ --no-recursion ] [ -f | --follow ] : lcov -l | --list *tracefile* [ --list-full-path ] [ --no-list-full-path ] : lcov -a | --add-tracefile *tracefile_patterns* [ -o | --output-file *tracefile* ] [ --prune-tests ] [ --forget-test-names ] [ --map-functions ] [ --branch-coverage ] [ --mcdc-coverage ] [ --checksum ] [ --no-checksum ] [ --sort-input ] . (suite) . genhtml glob - . genhtml . : lcov -e | --extract *tracefile pattern* [ -o | --output-file *tracefile* ] [ --checksum ] [ --no-checksum ] : lcov -r | --remove *tracefile pattern* [ -o | --output-file *tracefile* ] [ --checksum ] [ --no-checksum ] : lcov --intersect *rh_glob_pattern* [ -o | --output-file *tracefile* ] lh_glob_pattern ( lh_glob_patterns) ( rh_glob_patterns) (coverpoints) () . (branch blocks) . . lcov --subtract *rh_glob_pattern* [ -o | --output-file *tracefile* ] lh_glob_pattern ( lh_glob_patterns) ( rh_glob_patterns) . : lcov --summary *tracefile* : lcov [ -h | --help ] [ --version ] lcov - : lcov [ --keep-going ] [ --filter *type* ] [ -q | --quiet ] [ -v | --verbose ] [ --comment *comment_string* ] [ --debug ] [ --parallel | -j [*integer*] ] [ --memory *integer_num_Mb* ] [ --tempdir *dirname* ] [ --branch-coverage ] [ --mcdc-coverage ] [ --config-file *config-file* ] [ --rc *keyword*\ =\ *value* ] [ --profile [ *profile-file* ] ] [ --include *glob_pattern* ] [ --exclude *glob_pattern* ] [ --erase-functions *regexp_pattern* ] [ --substitute *regexp_pattern* ] [ --omit-lines *regexp_pattern* ] [ --fail-under-branches *percentage* ] [ --fail-under-lines *percentage* ] (DESCRIPTION) lcov gcov GCC . HTML . . lcov genhtml HTML . . : : gcov-kernel : https://docs.kernel.org/dev-tools/gcov.html : GCC <<-fprofile-arcs>> <<-ftest-coverage>> <<-coverage>> . lcov << .info>> <> GCOV << .da>> . 0% 100% 0% 100% . 0% 100% . gcov(1) . lcov . --branch-coverage --mcdc-coverage MC/DC - lcov . lcovrc(5) . (OPTIONS) () lcov - lcovrc(5) . -a tracefile_patterns --add-tracefile tracefile_patterns tracefile_patterns. -a (tracefile) . (stdout) -o . -z -c -a -e -r -l -summary . -b directory --base-directory directory directory . (build-environment) lcov : ERROR: could not read source file /home/user/project/subdir1/subdir2/subdir1/subdir2/file.c /home/user/project . lcov libtool . . geninfo_auto_base=1 ( lcovrc(5) ). --build-directory build_directory .gcno build_directory .gcda. geninfo(1) . --source-directory dirname `dirname' . tracefile gcov -capture - - lcov `cwd' ( genhtml ) . . . -c --capture (runtime). . -directory . stdout -o . --all . --initial . geninfo(1) ) . -z -c -a -e -r -l -diff -summary . --branch-coverage / (branch coverage). "-rc branch_coverage=1" genhtml . --mcdc-coverage MC/DC. "-rc mcdc_coverage=1" . MC/DC GCC 14.2 LLVM 18.1 . MC/DC LLVM llvm2lcov -help . MC/DC genhtml(1) . --checksum --no-checksum / . -checksum -no-checksum . . . . . --version-script - << >>. --compat mode=value*[,*mode=value,] . -compat lcov . mode=value . : on . off . auto . . `on' . : libtool libtool . -compat-libtool . `on' . hammer GCC 3.3 ( hammer) GCC . GCC 3.3 `.bbg' . GCC 3.3 `.bb' . `auto' . split_crc GCC 4.6 ( split function checksums) GCC . lcov GCC `out of memory' `reached unexpected end of file'. `auto' . --compat-libtool --no-compat-libtool libtool . -compat-libtool libtool -no-compat-libtool . libtool . libtool lcov .da ".libs" . ".libs" libtool . --config-file config-file . lcovrc(5) . config_file . /etc/lcovrc ~/.lcovrc . lcov . - . --profile [profile-data-file] . profile-data-file -output-filename ".json" . lcov ( $LCOV_ROOT/share/lcov/support-scripts/spreadsheet.py ) -parallel ( "-history-script" ). --history-script callback callback . genhtml(1) . -z -c -a -e -r -l -diff -summary . -d directory --directory directory .da directory . ( .da ). . --exclude pattern pattern. . --exclude . pattern ( ). : (absolute) . - - . lcov . --include . include exclude exclude . --erase-functions regexp (regexp) . -demangle-cpp (mangled) (demangled) . gcc / - derive_function_end_line lcovrc(5) . --substitute regexp_pattern regexp_pattern . gcov . geninfo . regexp_pattern ( perlre(1) ) geninfo . --resolve-script . -substitution / -resolve-script . resolve. : 1. (). : . 2. - . : . 3. `resolve' . : . 4. : () . . lcov/genhtml/geninfo : o -capture gcov ( gcov(1) ). o -capture -build-dir .gcno ( ) .gcda ( ). o lcov ( ".info") - lcov HTML. ( -filter ) -version-script -annotate-script -criteria-script . o -diff-file genhtml. : 1. geninfo : /path/to/src/.libs/file.c : /path/to/src/file.c : --substitute 's#/.libs##g' "/.libs" . 2. geninfo : /tmp/build/file.c : /usr/src/file.c : --substitute 's#/tmp/build#/usr/src#g' "/tmp/build" "/usr/src" . --omit-lines regexp regexp . ( ) . --omit-lines . regexp ( ). regexp "^" / "$" / . lcovrc lcov_excl_line = regexp --omit-lines . --omit-lines . --omit-lines lcov_excl_line - . --external --no-external . -directory -base-directory . (coverpoints) -external -no-external . -directory -base-directory (soft link) <<>> -follow . -no-external -exclude -include / -no-external . (included). --forget-test-names (testcase) info. - . . forget_testcase_names . --prune-tests (tracefiles) . --add-tracefile . : 1. 2. 3. . A B (prune) . --parallel (nondeterministic) - . --prune-tests --add-tracefile . lcov . --map-functions . --add-tracefile . --add-tracefile . lcov . --context-script script script - / . (context script) genhtml . --criteria-script script script . genhtml . lcov ( -annotate-script genhtml ) - (callback) lcov . --resolve-script script script -substitute -source-directory . resolve_script . lcovrc(5) . --version-script script script .info. genhtml . --unreachable-script module module / MC/DC . unreachable_script . lcovrc(5) . "module" Perl . genhtml . --comment comment_string comment_string . . . : . lcov : -list -summary -prune-tests -map-functions. geninfo . -e tracefile pattern --extract tracefile pattern tracefile. . ( ). tracefile . : . stdout -o . -z -c -a -e -r -l -diff -summary . -f --follow .da. --large-file regexp -large-file geninfo(1) . --from-package package .da package . .info . -to-package . --sort-input / . . sort_input lcovrc(5) . --gcov-tool tool gcov. geninfo . -h --help . --include pattern pattern. . --include . patterns ( ). : . - - lcov `unused' . lcov -ignore-errors . --msg-log [log_file_name] ( STDERR). log_file_name . --ignore-errors errors . lcov . ( ) ( ) : lcov ... --ignore-errors source,source ... errors : branch ( `BRDA' .info) . callback . child -parallel . : . : parallel / - `' lcov. corrupt / . count - . `max_message_count' . lcovrc(5) . deprecated . - . empty .info ( `' ). excessive (`hit') - . excessive_count_threshold lcovrc(5) . fork -parallel. ( -ignore-errors fork ) genhtml . . format .info - . gcov gcov . graph . inconsistent : . . ( genhtml(1) ). internal . . mismatch : o ( `BRDA' .info) o (FNDA:) (FN:) . missing . negative (`hit') . GCC - : "-fprofile-update=atomic" . . package . - . parallel - . parallel . -parallel . ( ) . parent -parallel . - . - . range . gcov . source . unreachable ( MC/DC) "" (hit ) . retain_unreachable_coverpoints_if_executed ( ) . lcovrc(5) "Exclusion markers" geninfo(1) . unsupported . / GCOV GCC . unused include/exclude/erase/omit/substitute . usage - . utility ( `find' ). version - . `max_message_count' lcovrc(5) . . --expect-message-count message_type:expr[,message_type:expr] lcov . "count" ( ) . genhtml(1) "expect_message_count" lcovrc(5) . --keep-going : . stop_on_error [0|1] lcovrc . lcovrc(5) . --preserve - . . --filter filters coverpoint . genhtml . --demangle-cpp [param] C++ (Demangle) . genhtml . -i --initial - `.gcno' . --all (`.gcno') (`.gcda') . lcov -c .bb .bbg .gcno . <<>> (baseline) . ( lcov -a) . : 1. # lcov -c -i -d appdir -o app_base.info 2. # appdir/test 3. # lcov -c -d appdir -o app_test.info 4. # lcov -a app_base.info -a app_test.info -o app_total.info : # lcov --capture --all -o app_total.info -d appdir - `.gcno' ( ) `.gcda' ( ) - . (coverpoint) ( ) . --initial --capture . --initial --all . -k subdirectory --kernel-directory subdirectory subdirectory. . . gcov . -l tracefile --list tracefile tracefile. -z -c -a -e -r -l -diff -summary . --list-full-path --no-list-full-path . -list-full-path -no-list-full-path . . --no-markers (exclusion markers) . geninfo (1) . --no-recursion . -o tracefile --output-file tracefile tracefile (stdout). "-" . lcov <> ".info" . -v --verbose (verbosity) . / - . -quiet . stdout ( stdout ) stderr . -q --quiet . <<>> - . --debug << >>. lcov . --parallel [integer] -j [integer] ( ). . ( ) . memory, memory_percentage, max_fork_fails fork_fail_timeout lcovrc(5) . (profile) . "-profile" "-history" . --memory integer . fork() . 0 () - . - . - - . memory_percentage . lcovrc(5) . --rc keyword=value . keyword=value lcovrc . . lcovrc(5) . -r tracefile pattern --remove tracefile pattern tracefile. tracefile . ( ). tracefile . : . tracefile -o . -z -c -a -e -r -l -diff -summary . --summary tracefile tracefile . . -z -c -a -e -r -l -diff -summary . --fail-under-branches percentage lcov percentage 1 . --fail-under-lines percentage lcov percentage 1 . -t testname --test-name testname tracefile. tracefile ( -a ). ("_") . --to-package package .da . .info . : : o o lcov -c [-d directory] -to-package file o file : o lcov -c -from-package file [-o ] . -b -to-package -from-package . .info . --version . -z --zerocounters . . -directory . -z -c -a -e -r -l -diff -summary . --tempdir dirname . "/tmp" . (FILES) /etc/lcovrc . ~/.lcovrc . (AUTHOR) Peter Oberparleiter <> Henry Cox <> . (SEE ALSO) lcovrc(5) , genhtml(1) , geninfo(1) , gendesc(1) , gcov(1) llvm2lcov(1) py2lcov(1) perl2lcov(1) https://github.com/linux-test-project/lcov (COPYRIGHT) 2024-2026, LCOV Project 2.5 2026-07-07 LCOV(1)