man-pages/man1/x86_64-linux-gnu-gcov-tool-9.1.html
2021-03-31 01:06:50 +01:00

357 lines
8.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of GCOV-TOOL</TITLE>
</HEAD><BODY>
<H1>GCOV-TOOL</H1>
Section: GNU (1)<BR>Updated: 2020-03-12<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
gcov-tool - offline gcda profile processing tool
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
gcov-tool [<B>-v</B>|<B>--version</B>] [<B>-h</B>|<B>--help</B>]
<P>
gcov-tool merge [merge-options] <I>directory1</I> <I>directory2</I>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<B>-o</B>|<B>--output</B>&nbsp;<I>directory</I>]
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<B>-v</B>|<B>--verbose</B>]
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<B>-w</B>|<B>--weight</B>&nbsp;<I>w1,w2</I>]
<P>
gcov-tool rewrite [rewrite-options] <I>directory</I>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<B>-n</B>|<B>--normalize</B>&nbsp;<I>long_long_value</I>]
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<B>-o</B>|<B>--output</B>&nbsp;<I>directory</I>]
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<B>-s</B>|<B>--scale</B>&nbsp;<I>float_or_simple-frac_value</I>]
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<B>-v</B>|<B>--verbose</B>]
<P>
gcov-tool overlap [overlap-options] <I>directory1</I> <I>directory2</I>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<B>-f</B>|<B>--function</B>]
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<B>-F</B>|<B>--fullname</B>]
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<B>-h</B>|<B>--hotonly</B>]
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<B>-o</B>|<B>--object</B>]
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<B>-t</B>|<B>--hot_threshold</B>]&nbsp;<I>float</I>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<B>-v</B>|<B>--verbose</B>]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>gcov-tool</B> is an offline tool to process gcc's gcda profile files.
<P>
Current gcov-tool supports the following functionalities:
<DL COMPACT>
<DT id="1">*<DD>
merge two sets of profiles with weights.
<DT id="2">*<DD>
read one set of profile and rewrite profile contents. One can scale or
normalize the count values.
</DL>
<P>
Examples of the use cases for this tool are:
<DL COMPACT>
<DT id="3">*<DD>
Collect the profiles for different set of inputs, and use this tool to merge
them. One can specify the weight to factor in the relative importance of
each input.
<DT id="4">*<DD>
Rewrite the profile after removing a subset of the gcda files, while maintaining
the consistency of the summary and the histogram.
<DT id="5">*<DD>
It can also be used to debug or libgcov code as the tools shares the majority
code as the runtime library.
</DL>
<P>
Note that for the merging operation, this profile generated offline may
contain slight different values from the online merged profile. Here are
a list of typical differences:
<DL COMPACT>
<DT id="6">*<DD>
histogram difference: This offline tool recomputes the histogram after merging
the counters. The resulting histogram, therefore, is precise. The online
merging does not have this capability --- the histogram is merged from two
histograms and the result is an approximation.
<DT id="7">*<DD>
summary checksum difference: Summary checksum uses a <FONT SIZE="-1">CRC32</FONT> operation. The value
depends on the link list order of gcov-info objects. This order is different in
gcov-tool from that in the online merge. It's expected to have different
summary checksums. It does not really matter as the compiler does not use this
checksum anywhere.
<DT id="8">*<DD>
value profile counter values difference: Some counter values for value profile
are runtime dependent, like heap addresses. It's normal to see some difference
in these kind of counters.
</DL>
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="9"><B>-h</B><DD>
<DT id="10"><B>--help</B><DD>
Display help about using <B>gcov-tool</B> (on the standard output), and
exit without doing any further processing.
<DT id="11"><B>-v</B><DD>
<DT id="12"><B>--version</B><DD>
Display the <B>gcov-tool</B> version number (on the standard output),
and exit without doing any further processing.
<DT id="13"><B>merge</B><DD>
Merge two profile directories.
<DL COMPACT><DT id="14"><DD>
<DL COMPACT>
<DT id="15"><B>-o</B> <I>directory</I><DD>
<DT id="16"><B>--output</B> <I>directory</I><DD>
Set the output profile directory. Default output directory name is
<I>merged_profile</I>.
<DT id="17"><B>-v</B><DD>
<DT id="18"><B>--verbose</B><DD>
Set the verbose mode.
<DT id="19"><B>-w</B> <I>w1</I><B>,</B><I>w2</I><DD>
<DT id="20"><B>--weight</B> <I>w1</I><B>,</B><I>w2</I><DD>
Set the merge weights of the <I>directory1</I> and <I>directory2</I>,
respectively. The default weights are 1 for both.
</DL>
</DL>
<DL COMPACT><DT id="21"><DD>
</DL>
<DT id="22"><B>rewrite</B><DD>
Read the specified profile directory and rewrite to a new directory.
<DL COMPACT><DT id="23"><DD>
<DL COMPACT>
<DT id="24"><B>-n</B> <I>long_long_value</I><DD>
<DT id="25"><B>--normalize &lt;long_long_value&gt;</B><DD>
Normalize the profile. The specified value is the max counter value
in the new profile.
<DT id="26"><B>-o</B> <I>directory</I><DD>
<DT id="27"><B>--output</B> <I>directory</I><DD>
Set the output profile directory. Default output name is <I>rewrite_profile</I>.
<DT id="28"><B>-s</B> <I>float_or_simple-frac_value</I><DD>
<DT id="29"><B>--scale</B> <I>float_or_simple-frac_value</I><DD>
Scale the profile counters. The specified value can be in floating point value,
or simple fraction value form, such 1, 2, 2/3, and 5/3.
<DT id="30"><B>-v</B><DD>
<DT id="31"><B>--verbose</B><DD>
Set the verbose mode.
</DL>
</DL>
<DL COMPACT><DT id="32"><DD>
</DL>
<DT id="33"><B>overlap</B><DD>
Compute the overlap score between the two specified profile directories.
The overlap score is computed based on the arc profiles. It is defined as
the sum of min (p1_counter[i] / p1_sum_all, p2_counter[i] / p2_sum_all),
for all arc counter i, where p1_counter[i] and p2_counter[i] are two
matched counters and p1_sum_all and p2_sum_all are the sum of counter
values in profile 1 and profile 2, respectively.
<DL COMPACT><DT id="34"><DD>
<DL COMPACT>
<DT id="35"><B>-f</B><DD>
<DT id="36"><B>--function</B><DD>
Print function level overlap score.
<DT id="37"><B>-F</B><DD>
<DT id="38"><B>--fullname</B><DD>
Print full gcda filename.
<DT id="39"><B>-h</B><DD>
<DT id="40"><B>--hotonly</B><DD>
Only print info for hot objects/functions.
<DT id="41"><B>-o</B><DD>
<DT id="42"><B>--object</B><DD>
Print object level overlap score.
<DT id="43"><B>-t</B> <I>float</I><DD>
<DT id="44"><B>--hot_threshold &lt;float&gt;</B><DD>
Set the threshold for hot counter value.
<DT id="45"><B>-v</B><DD>
<DT id="46"><B>--verbose</B><DD>
Set the verbose mode.
</DL>
</DL>
<DL COMPACT><DT id="47"><DD>
</DL>
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?7+gpl">gpl</A></B>(7), <B><A HREF="/cgi-bin/man/man2html?7+gfdl">gfdl</A></B>(7), <B><A HREF="/cgi-bin/man/man2html?7+fsf-funding">fsf-funding</A></B>(7), <B><A HREF="/cgi-bin/man/man2html?1+gcc">gcc</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+gcov">gcov</A></B>(1) and the Info entry for
<I>gcc</I>.
<A NAME="lbAG">&nbsp;</A>
<H2>COPYRIGHT</H2>
Copyright (c) 2014-2019 Free Software Foundation, Inc.
<P>
Permission is granted to copy, distribute and/or modify this document
under the terms of the <FONT SIZE="-1">GNU</FONT> Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``<FONT SIZE="-1">GNU</FONT> General Public License'' and ``Funding
Free Software'', the Front-Cover texts being (a) (see below), and with
the Back-Cover Texts being (b) (see below). A copy of the license is
included in the <B><A HREF="/cgi-bin/man/man2html?7+gfdl">gfdl</A></B>(7) man page.
<P>
(a) The <FONT SIZE="-1">FSF</FONT>'s Front-Cover Text is:
<P>
<PRE>
A GNU Manual
</PRE>
<P>
(b) The <FONT SIZE="-1">FSF</FONT>'s Back-Cover Text is:
<P>
<PRE>
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.
</PRE>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="48"><A HREF="#lbAB">NAME</A><DD>
<DT id="49"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="50"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="51"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="52"><A HREF="#lbAF">SEE ALSO</A><DD>
<DT id="53"><A HREF="#lbAG">COPYRIGHT</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:29 GMT, March 31, 2021
</BODY>
</HTML>