<html lang="en"> <head> <title>Gcov-tool Intro - Using the GNU Compiler Collection (GCC)</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="Using the GNU Compiler Collection (GCC)"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Gcov_002dtool.html#Gcov_002dtool" title="Gcov-tool"> <link rel="next" href="Invoking-Gcov_002dtool.html#Invoking-Gcov_002dtool" title="Invoking Gcov-tool"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <!-- Copyright (C) 1988-2015 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being ``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 section entitled ``GNU Free Documentation License''. (a) The FSF's Front-Cover Text is: A GNU Manual (b) The FSF's Back-Cover Text is: 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.--> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="Gcov-tool-Intro"></a> <a name="Gcov_002dtool-Intro"></a> <p> Next: <a rel="next" accesskey="n" href="Invoking-Gcov_002dtool.html#Invoking-Gcov_002dtool">Invoking Gcov-tool</a>, Up: <a rel="up" accesskey="u" href="Gcov_002dtool.html#Gcov_002dtool">Gcov-tool</a> <hr> </div> <h3 class="section">11.1 Introduction to <samp><span class="command">gcov-tool</span></samp></h3> <!-- man begin DESCRIPTION --> <p><samp><span class="command">gcov-tool</span></samp> is an offline tool to process gcc's gcda profile files. <p>Current gcov-tool supports the following functionalities: <ul> <li>merge two sets of profiles with weights. <li>read one set of profile and rewrite profile contents. One can scale or normalize the count values. </ul> <p>Examples of the use cases for this tool are: <ul> <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>Rewrite the profile after removing a subset of the gcda files, while maintaining the consistency of the summary and the histogram. <li>It can also be used to debug or libgcov code as the tools shares the majority code as the runtime library. </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: <ul> <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>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>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. </ul> <!-- man end --> </body></html>