GCOV-TOOL(1)
โจ NAME โจ
okay bestie, meet gcov-tool ๐ It's an offline gcda profile processing tool that works on gcc's gcda profile files ๐ง
๐ธ SYNOPSIS ๐ธ
gcov-tool [-v|--version] [-h|--help]
gcov-tool merge [merge-options] directory1 directory2
[-o|--output directory]
[-v|--verbose]
[-w|--weight w1,w2]
gcov-tool rewrite [rewrite-options] directory
[-n|--normalize long_long_value]
[-o|--output directory]
[-s|--scale float_or_simple-frac_value]
[-v|--verbose]
gcov-tool overlap [overlap-options] directory1 directory2
[-f|--function]
[-F|--fullname]
[-h|--hotonly]
[-o|--object]
[-t|--hot_threshold] float
[-v|--verbose]
๐ฆ DESCRIPTION ๐ฆ
okay so gcov-tool is literally the offline tool for processing gcc's gcda profile files, and it's giving main character energy ๐
Right now it can do two things:
- merge two sets of profiles, with weights ๐
- rewrite one set of profile contents. You can scale the count values or normalize them ๐
The use cases are lowkey iconic:
- Collect profiles from different sets of inputs and merge them together. You can set a weight to show how much each input matters ๐
- Rewrite a profile after removing some of the gcda files, and it keeps the summary and the histogram consistent ๐
- It can also help you debug libgcov code, since the tool shares most of its code with the runtime library ๐ง
ngl, an offline merge might give you slightly different values than the online merged profile. These are the typical differences:
- histogram difference ๐: The offline tool recomputes the histogram after merging the counters, so the result is precise. The online merge can't do that. It merges two histograms into one, so the result is an approximation ๐
- summary checksum difference ๐: The summary checksum uses a CRC32 operation. Its value depends on the link list order of gcov-info objects, and gcov-tool uses a different order than the online merge. So different summary checksums are expected. It doesn't really matter, because the compiler doesn't use this checksum anywhere ๐
- value profile counter values difference ๐ธ: Some value profile counters depend on runtime stuff, like heap addresses. Seeing differences in these counters is totally normal ๐ซถ
โจ OPTIONS โจ
-h,--helpโ Shows help about using gcov-tool on the standard output, then exits without doing any more processing ๐-v,--versionโ Shows the gcov-tool version number on the standard output, then exits without doing any more processing โจ
๐ merge ๐
Merges two profile directories, bestie ๐ซถ
-o directory,--output directoryโ Sets the output profile directory. The default output directory name ismerged_profile๐-v,--verboseโ Turns on verbose mode ๐ฃ-w w1,w2,--weight w1,w2โ Sets the merge weights for directory1 and directory2, in that order. Both default to1โ๏ธ
๐ rewrite ๐
Reads the profile directory you give it and rewrites it into a new directory ๐
-n long_long_value,--normalize <long_long_value>โ Normalizes the profile. The value you pass is the max counter value in the new profile ๐ฅ-o directory,--output directoryโ Sets the output profile directory. The default output name isrewrite_profile๐ธ-s float_or_simple-frac_value,--scale float_or_simple-frac_valueโ Scales the profile counters. The value can be a floating point number or a simple fraction, like1,2,2/3, or5/3๐ฆ-v,--verboseโ Turns on verbose mode ๐ฃ
๐ฎ overlap ๐ฎ
Computes the overlap score between two profile directories you specify. The score is based on the arc profiles, and it's defined as the sum of the minimum of two ratios, across every arc counter i ๐งฎ
min (p1_counter[i] / p1_sum_all, p2_counter[i] / p2_sum_all)
In that formula, p1_counter[i] and p2_counter[i] are the two matched counters, and p1_sum_all and p2_sum_all are the sums of the counter values in profile 1 and profile 2, respectively ๐
-f,--functionโ Prints the function level overlap score ๐ฏ-F,--fullnameโ Prints the full gcda filename ๐-h,--hotonlyโ Only prints info for hot objects and functions ๐ฅ-o,--objectโ Prints the object level overlap score ๐งธ-t float,--hot_threshold <float>โ Sets the threshold for a hot counter value ๐ก๏ธ-v,--verboseโ Turns on verbose mode ๐ฃ
๐ง SEE ALSO ๐ง
gpl(7), gfdl(7), fsf-funding(7), gcc(1), gcov(1) and the Info entry for gcc ๐
๐ COPYRIGHT ๐
Copyright (c) 2014-2022 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. The Invariant Sections are "GNU General Public License" and "Funding Free Software". The Front-Cover texts are (a) (see below), and the Back-Cover Texts are (b) (see below). A copy of the license is included in the gfdl(7) man page ๐
(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.
okay that's the whole tea, bestie ๐ซถ Source/version gcc-12, dated 2022-03-02, all for GCOV-TOOL(1) ๐ โจ
๐ฆ where this page comes from
- ubuntu jammy: gcc-12-powerpc64-linux-gnu 12-20220302-1ubuntu1cross1
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms