blob: b71bbf3ee724a71c38b2e8a9ff41a09d414b0add (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
<div class="section-level-extent" id="Gcov-tool-Intro"> <div class="nav-panel"> <p> Next: <a href="invoking-gcov-tool" accesskey="n" rel="next">Invoking <code class="command">gcov-tool</code></a>, Up: <a href="gcov-tool" accesskey="u" rel="up"><code class="command">gcov-tool</code>—an Offline Gcda Profile Processing Tool</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div> <h1 class="section" id="Introduction-to-gcov-tool"><span>11.1 Introduction to gcov-tool<a class="copiable-link" href="#Introduction-to-gcov-tool"> ¶</a></span></h1> <p><code class="command">gcov-tool</code> is an offline tool to process gcc’s gcda profile files. </p> <p>Current gcov-tool supports the following functionalities: </p> <ul class="itemize mark-bullet"> <li>merge two sets of profiles with weights. </li>
<li>read a stream of profiles with associated filenames and merge it with a set of profiles with weights. </li>
<li>read one set of profile and rewrite profile contents. One can scale or normalize the count values. </li>
</ul> <p>Examples of the use cases for this tool are: </p>
<ul class="itemize mark-bullet"> <li>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. </li>
<li>Collect profiles from target systems without a filesystem (freestanding environments). Merge the collected profiles with associated profiles present on the host system. One can specify the weight to factor in the relative importance of each input. </li>
<li>Rewrite the profile after removing a subset of the gcda files, while maintaining the consistency of the summary and the histogram. </li>
<li>It can also be used to debug or libgcov code as the tools shares the majority code as the runtime library. </li>
</ul> <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: </p> <ul class="itemize mark-bullet"> <li>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. </li>
<li>summary checksum difference: Summary checksum uses a CRC32 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. </li>
<li>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. </li>
</ul> </div> <div class="nav-panel"> <p> Next: <a href="invoking-gcov-tool">Invoking <code class="command">gcov-tool</code></a>, Up: <a href="gcov-tool"><code class="command">gcov-tool</code>—an Offline Gcda Profile Processing Tool</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div><div class="_attribution">
<p class="_attribution-p">
© Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br>
<a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Gcov-tool-Intro.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Gcov-tool-Intro.html</a>
</p>
</div>
|