GCOV-TOOL(1)
β¨ GCOV-TOOL β¨ π¦ (gcov-tool, offline gcda profile processing tool)
Okay bestie, let's talk about gcov-tool π It's an offline tool for processing gcc's gcda profile files, and it is literally so good. π₯
πΈ NAME πΈ
gcov-tool - offline gcda profile processing tool π
π SYNOPSIS π
Here are the vibes you can call it with:
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 an offline tool that processes gcc's gcda profile files. β¨
It currently does two main things:
- merge two sets of profiles, with weights π
- read one set of profile and rewrite its contents. You can scale or normalize the count values π
Here's when you'd actually use this, bestie:
- Collect profiles for different sets of inputs, then merge them together. You can set a weight to show how much each input matters. π
- Rewrite the profile after removing a subset of the gcda files, and it keeps the summary and histogram consistent. Iconic. π
- It can also help you debug libgcov code, because the tool shares most of its code with the runtime library. π§
Heads up though, because this is important π When you merge offline, the profile might have slightly different values from an online merged profile. Here are the typical differences:
- Histogram difference: The offline tool recomputes the histogram after merging the counters, so the result is precise. Online merging can't do that. It merges two histograms into one, so the result is only an approximation. π
- Summary checksum difference: The summary checksum uses a CRC32 operation, and its value depends on the link list order of gcov-info objects. gcov-tool uses a different order than the online merge, so you'll see different summary checksums. Honestly it doesn't really matter, because the compiler never uses this checksum anywhere. π
- Value profile counter difference: Some value profile counters depend on runtime stuff, like heap addresses. Seeing differences in these counters is totally normal. π«Ά
π OPTIONS π
-h,--helpβ Shows you help for using gcov-tool on standard output, then exits without doing any more processing. π-v,--versionβ Shows the gcov-tool version number on standard output, then exits without doing any more processing. π₯
π§ merge π§
Merges two profile directories together. π
-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, respectively. Both default to 1. β
π rewrite π
Reads the specified profile directory 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, and5/3. π¦-v,--verboseβ Turns on verbose mode. π£
πΈ overlap πΈ
Computes the overlap score between the two specified profile directories. The overlap score is based on the arc profiles. It's defined as the sum of min (p1_counter[i] / p1_sum_all, p2_counter[i] / p2_sum_all), taken over all arc counters i. Here p1_counter[i] and p2_counter[i] are two matched counters, and p1_sum_all and p2_sum_all are the sums of counter values in profile 1 and profile 2, respectively. Math bestie, I know, but it's giving precision π€π
-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. Go read those if you're hungry for more, periodt. π
π COPYRIGHT π
Copyright (c) 2014-2019 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 bestie, that's the whole tea! β¨ This page came from gcc-9.5.0 and was dated 2022-05-27, so go forth and profile responsibly, periodt πππ¦
π¦ where this page comes from
- ubuntu jammy: gcc-9-hppa-linux-gnu 9.5.0-1ubuntu1~22.04cross1
- ubuntu noble: gcc-9-hppa-linux-gnu 9.5.0-6ubuntu2cross1
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms