{
    "content": [
        {
            "type": "text",
            "text": "# gcov-tool-11(1) (man)\n\n**Summary:** gcov-tool - offline gcda profile processing tool\n\n**Synopsis:** gcov-tool [-v|--version] [-h|--help]\ngcov-tool merge [merge-options] directory1 directory2\n[-o|--output directory]\n[-v|--verbose]\n[-w|--weight w1,w2]\ngcov-tool rewrite [rewrite-options] directory\n[-n|--normalize longlongvalue]\n[-o|--output directory]\n[-s|--scale floatorsimple-fracvalue]\n[-v|--verbose]\ngcov-tool overlap [overlap-options] directory1 directory2\n[-f|--function]\n[-F|--fullname]\n[-h|--hotonly]\n[-o|--object]\n[-t|--hotthreshold] float\n[-v|--verbose]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -h | — | — |  |\n| — | --help | — | Display help about using gcov-tool (on the standard output), and exit without doing any further processing. |\n| -v | — | — |  |\n| — | --version | — | Display the gcov-tool version number (on the standard output), and exit without doing any further processing. |\n\n## See Also\n\n- gpl(7)\n- gfdl(7)\n- fsf-funding(7)\n- gcc(1)\n- gcov(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (21 lines)\n- **DESCRIPTION** (37 lines)\n- **OPTIONS** (1 lines) — 7 subsections\n  - -h (1 lines)\n  - --help (3 lines)\n  - -v (1 lines)\n  - --version (3 lines)\n  - merge (15 lines)\n  - rewrite (20 lines)\n  - overlap (30 lines)\n- **SEE ALSO** (2 lines)\n- **COPYRIGHT** (21 lines)\n\n## Full Content\n\n### NAME\n\ngcov-tool - offline gcda profile processing tool\n\n### SYNOPSIS\n\ngcov-tool [-v|--version] [-h|--help]\n\ngcov-tool merge [merge-options] directory1 directory2\n[-o|--output directory]\n[-v|--verbose]\n[-w|--weight w1,w2]\n\ngcov-tool rewrite [rewrite-options] directory\n[-n|--normalize longlongvalue]\n[-o|--output directory]\n[-s|--scale floatorsimple-fracvalue]\n[-v|--verbose]\n\ngcov-tool overlap [overlap-options] directory1 directory2\n[-f|--function]\n[-F|--fullname]\n[-h|--hotonly]\n[-o|--object]\n[-t|--hotthreshold] float\n[-v|--verbose]\n\n### DESCRIPTION\n\ngcov-tool is an offline tool to process gcc's gcda profile files.\n\nCurrent gcov-tool supports the following functionalities:\n\n*   merge two sets of profiles with weights.\n\n*   read one set of profile and rewrite profile contents. One can scale or normalize the\ncount values.\n\nExamples of the use cases for this tool are:\n\n*   Collect the profiles for different set of inputs, and use this tool to merge them. One\ncan specify the weight to factor in the relative importance of each input.\n\n*   Rewrite the profile after removing a subset of the gcda files, while maintaining the\nconsistency of the summary and the histogram.\n\n*   It can also be used to debug or libgcov code as the tools shares the majority code as the\nruntime library.\n\nNote that for the merging operation, this profile generated offline may contain slight\ndifferent values from the online merged profile. Here are a list of typical differences:\n\n*   histogram difference: This offline tool recomputes the histogram after merging the\ncounters. The resulting histogram, therefore, is precise. The online merging does not\nhave this capability -- the histogram is merged from two histograms and the result is an\napproximation.\n\n*   summary checksum difference: Summary checksum uses a CRC32 operation. The value depends\non the link list order of gcov-info objects. This order is different in gcov-tool from\nthat in the online merge. It's expected to have different summary checksums. It does not\nreally matter as the compiler does not use this checksum anywhere.\n\n*   value profile counter values difference: Some counter values for value profile are\nruntime dependent, like heap addresses. It's normal to see some difference in these kind\nof counters.\n\n### OPTIONS\n\n#### -h\n\n#### --help\n\nDisplay help about using gcov-tool (on the standard output), and exit without doing any\nfurther processing.\n\n#### -v\n\n#### --version\n\nDisplay the gcov-tool version number (on the standard output), and exit without doing any\nfurther processing.\n\n#### merge\n\nMerge two profile directories.\n\n-o directory\n--output directory\nSet the output profile directory. Default output directory name is mergedprofile.\n\n-v\n--verbose\nSet the verbose mode.\n\n-w w1,w2\n--weight w1,w2\nSet the merge weights of the directory1 and directory2, respectively. The default\nweights are 1 for both.\n\n#### rewrite\n\nRead the specified profile directory and rewrite to a new directory.\n\n-n longlongvalue\n--normalize <longlongvalue>\nNormalize the profile. The specified value is the max counter value in the new\nprofile.\n\n-o directory\n--output directory\nSet the output profile directory. Default output name is rewriteprofile.\n\n-s floatorsimple-fracvalue\n--scale floatorsimple-fracvalue\nScale the profile counters. The specified value can be in floating point value, or\nsimple fraction value form, such 1, 2, 2/3, and 5/3.\n\n-v\n--verbose\nSet the verbose mode.\n\n#### overlap\n\nCompute the overlap score between the two specified profile directories.  The overlap\nscore is computed based on the arc profiles. It is defined as the sum of min\n(p1counter[i] / p1sumall, p2counter[i] / p2sumall), for all arc counter i, where\np1counter[i] and p2counter[i] are two matched counters and p1sumall and p2sumall\nare the sum of counter values in profile 1 and profile 2, respectively.\n\n-f\n--function\nPrint function level overlap score.\n\n-F\n--fullname\nPrint full gcda filename.\n\n-h\n--hotonly\nOnly print info for hot objects/functions.\n\n-o\n--object\nPrint object level overlap score.\n\n-t float\n--hotthreshold <float>\nSet the threshold for hot counter value.\n\n-v\n--verbose\nSet the verbose mode.\n\n### SEE ALSO\n\ngpl(7), gfdl(7), fsf-funding(7), gcc(1), gcov(1) and the Info entry for gcc.\n\n### COPYRIGHT\n\nCopyright (c) 2014-2021 Free Software Foundation, Inc.\n\nPermission is granted to copy, distribute and/or modify this document under the terms of the\nGNU Free Documentation License, Version 1.3 or any later version published by the Free\nSoftware Foundation; with the Invariant Sections being \"GNU General Public License\" and\n\"Funding Free Software\", the Front-Cover texts being (a) (see below), and with the Back-Cover\nTexts being (b) (see below).  A copy of the license is included in the gfdl(7) man page.\n\n(a) The FSF's Front-Cover Text is:\n\nA GNU Manual\n\n(b) The FSF's Back-Cover Text is:\n\nYou have freedom to copy and modify this GNU Manual, like GNU\nsoftware.  Copies published by the Free Software Foundation raise\nfunds for GNU development.\n\n\n\ngcc-11.4.0                                   2023-05-28                                 GCOV-TOOL(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "gcov-tool-11",
        "section": "1",
        "mode": "man",
        "summary": "gcov-tool - offline gcda profile processing tool",
        "synopsis": "gcov-tool [-v|--version] [-h|--help]\ngcov-tool merge [merge-options] directory1 directory2\n[-o|--output directory]\n[-v|--verbose]\n[-w|--weight w1,w2]\ngcov-tool rewrite [rewrite-options] directory\n[-n|--normalize longlongvalue]\n[-o|--output directory]\n[-s|--scale floatorsimple-fracvalue]\n[-v|--verbose]\ngcov-tool overlap [overlap-options] directory1 directory2\n[-f|--function]\n[-F|--fullname]\n[-h|--hotonly]\n[-o|--object]\n[-t|--hotthreshold] float\n[-v|--verbose]",
        "flags": [
            {
                "flag": "-h",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--help",
                "arg": null,
                "description": "Display help about using gcov-tool (on the standard output), and exit without doing any further processing."
            },
            {
                "flag": "-v",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--version",
                "arg": null,
                "description": "Display the gcov-tool version number (on the standard output), and exit without doing any further processing."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "gpl",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/gpl/7/json"
            },
            {
                "name": "gfdl",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/gfdl/7/json"
            },
            {
                "name": "fsf-funding",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/fsf-funding/7/json"
            },
            {
                "name": "gcc",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/gcc/1/json"
            },
            {
                "name": "gcov",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/gcov/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 21,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 37,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-h",
                        "lines": 1,
                        "flag": "-h"
                    },
                    {
                        "name": "--help",
                        "lines": 3,
                        "long": "--help"
                    },
                    {
                        "name": "-v",
                        "lines": 1,
                        "flag": "-v"
                    },
                    {
                        "name": "--version",
                        "lines": 3,
                        "long": "--version"
                    },
                    {
                        "name": "merge",
                        "lines": 15
                    },
                    {
                        "name": "rewrite",
                        "lines": 20
                    },
                    {
                        "name": "overlap",
                        "lines": 30
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 21,
                "subsections": []
            }
        ]
    }
}