OS Manuals

/usr/bin/gcov

the GNU compiler collection

From gcc 16.2.0-r3 (os), captured 2026-11-10 by running gcov --help (exit 0). permalink

Also provided by 5 other package versions
Usage: gcov [OPTION...] SOURCE|OBJ...

Print code coverage information.

  -a, --all-blocks                Show information for every basic block
  -b, --branch-probabilities      Include branch probabilities in output
  -c, --branch-counts             Output counts of branches taken
                                    rather than percentages
  -g, --conditions                Include modified condition/decision
                                    coverage (masking MC/DC) in output
  -e, --prime-paths               Show prime path coverage summary
      --prime-paths-lines[=TYPE]  Include paths in output
                                    line trace mode - does not affect json
                                    TYPE is 'covered', 'uncovered', or 'both'
                                    and defaults to 'uncovered'
      --prime-paths-source[=TYPE] Include paths in output
                                    source trace mode - does not affect json
                                    TYPE is 'covered', 'uncovered', or 'both'
                                    and defaults to 'uncovered'
  -d, --display-progress          Display progress information
  -D, --debug			    Display debugging dumps
  -f, --function-summaries        Output summaries for each function
      --include                   Include functions matching this regex
      --exclude                   Exclude functions matching this regex
  -h, --help                      Print this help, then exit
  -j, --json-format               Output JSON intermediate format
                                    into .gcov.json.gz file
  -H, --human-readable            Output human readable numbers
  -k, --use-colors                Emit colored output
  -l, --long-file-names           Use long output file names for included
                                    source files
  -m, --demangled-names           Output demangled function names
  -M, --filter-on-demangled       Make --include/--exclude match on demangled
                                    names. This does not imply -m
  -n, --no-output                 Do not create an output file
  -o, --object-directory DIR|FILE Search for object files in DIR or called FILE
  -p, --preserve-paths            Preserve all pathname components
  -q, --use-hotness-colors        Emit perf-like colored output for hot lines
  -r, --relative-only             Only show data for relative sources
  -s, --source-prefix DIR         Source prefix to elide
  -t, --stdout                    Output to stdout instead of a file
  -u, --unconditional-branches    Show unconditional branch counts too
  -v, --version                   Print version number, then exit
  -w, --verbose                   Print verbose informations
  -x, --hash-filenames            Hash long pathnames

Obsolete options:
  -i, --json-format               Replaced with -j, --json-format
  -j, --human-readable            Replaced with -H, --human-readable

For bug reporting instructions, please see:
<https://gcc.gnu.org/bugs/>.
Options (31)
OptionDescriptionSource
-a, --all-blocksWrite individual execution counts for every basic block.help + man + man
-b, --branch-probabilitiesWrite branch frequencies to the output file, and write branch summary info to the standard output.help + man + man
-c, --branch-countsWrite branch frequencies as the number of branches taken, rather than the percentage of branches taken.help + man + man
-g, --conditionsWrite condition coverage to the output file, and write condition summary info to the standard output.help + man + man
-e, --prime-pathsWrite path coverage to the output file, and write path summary info to the standard output.help + man + man
--prime-paths-lines TYPEInclude paths in output line trace mode - does not affect json TYPE is 'covered', 'uncovered', or 'both' and defaults to 'uncovered'help
-d, --display-progressDisplay the progress on the standard output.help + man + man
-D, --debugDisplay debugging dumpshelp
-f, --function-summariesOutput summaries for each function in addition to the file level summary.help + man + man
--include regexInclude functions matching this regexhelp + man
--exclude regexExclude functions matching this regexhelp + man
-h, --helpDisplay help about using gcov (on the standard output), and exit without doing any further processing.help + man + man
-j, --json-formatOutput gcov file in an easy-to-parse JSON intermediate format which does not require source code for generation.help + man + man
-H, --human-readableWrite counts in human readable format (like 24.6k).help + man + man
-k, --use-colorsUse colors for lines of code that have zero coverage.help + man + man
-l, --long-file-namesUse long output file names for included source fileshelp + man + man
-m, --demangled-namesDisplay demangled function names in output.help + man + man
-M, --filter-on-demangledMake --include and --exclude match demangled names.help + man + man
-n, --no-outputDo not create the gcov output file.help + man + man
-p, --preserve-pathsPreserve complete path information in the names of generated .gcov files.help + man + man
-q, --use-hotness-colorsEmit perf-like colored output for hot lines.help + man + man
-r, --relative-onlyOnly output information about source files with a relative pathname (after source prefix elision).help + man + man
-s, --source-prefix DIRA prefix for source file names to remove when generating the output coverage files.help + man + man
-t, --stdoutOutput to standard output instead of output files.help + man + man
-u, --unconditional-branchesWhen branch probabilities are given, include those of unconditional branches.help + man + man
-v, --versionDisplay the gcov version number (on the standard output), and exit without doing any further processing.help + man + man
-w, --verbosePrint verbose informations related to basic blocks and arcs.help + man + man
-x, --hash-filenamesWhen using --preserve-paths, gcov uses the full pathname of the source files to create an output filename.help + man + man
-o directory|file (in the manual page but not in --help)man
--object-directory directory (in the manual page but not in --help)man
--object-file fileSpecify either the directory containing the gcov data files, or the object path name. (in the manual page but not in --help)man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.