Also turn off OPTION_MASK_ABI_X32 for -m16
[official-gcc.git] / gcc / doc / gcov-tool.texi
blobff8b9e22f4f4d19e4c2074f1091be676c367e612
1 @c Copyright (C) 2014 Free Software Foundation, Inc.
2 @c This is part of the GCC manual.
3 @c For copying conditions, see the file gcc.texi.
5 @ignore
6 @c man begin COPYRIGHT
7 Copyright @copyright{} 2014 Free Software Foundation, Inc.
9 Permission is granted to copy, distribute and/or modify this document
10 under the terms of the GNU Free Documentation License, Version 1.3 or
11 any later version published by the Free Software Foundation; with the
12 Invariant Sections being ``GNU General Public License'' and ``Funding
13 Free Software'', the Front-Cover texts being (a) (see below), and with
14 the Back-Cover Texts being (b) (see below).  A copy of the license is
15 included in the gfdl(7) man page.
17 (a) The FSF's Front-Cover Text is:
19      A GNU Manual
21 (b) The FSF's Back-Cover Text is:
23      You have freedom to copy and modify this GNU Manual, like GNU
24      software.  Copies published by the Free Software Foundation raise
25      funds for GNU development.
26 @c man end
27 @c Set file name and title for the man page.
28 @setfilename gcov-tool
29 @settitle offline gcda profile processing tool
30 @end ignore
32 @node Gcov-tool
33 @chapter @command{gcov-tool}---an Offline Gcda Profile Processing Tool
35 @command{gcov-tool} is a tool you can use in conjunction with GCC to
36 manipulate or process gcda profile files offline.
38 @menu
39 * Gcov-tool Intro::             Introduction to gcov-tool.
40 * Invoking Gcov-tool::          How to use gcov-tool.
41 @end menu
43 @node Gcov-tool Intro
44 @section Introduction to @command{gcov-tool}
45 @c man begin DESCRIPTION
47 @command{gcov-tool} is an offline tool to process gcc's gcda profile files.
49 Current gcov-tool supports the following functionalities:
51 @itemize @bullet
52 @item
53 merge two sets of profiles with weights.
55 @item
56 read one set of profile and rewrite profile contents. One can scale or
57 normalize the count values.
58 @end itemize
60 Examples of the use cases for this tool are:
61 @itemize @bullet
62 @item
63 Collect the profiles for different set of inputs, and use this tool to merge
64 them. One can specify the weight to factor in the relative importance of
65 each input.
67 @item
68 Rewrite the profile after removing a subset of the gcda files, while maintaining
69 the consistency of the summary and the histogram.
71 @item
72 It can also be used to debug or libgcov code as the tools shares the majority
73 code as the runtime library.
74 @end itemize
76 Note that for the merging operation, this profile generated offline may
77 contain slight different values from the online merged profile. Here are
78 a list of typical differences:
80 @itemize @bullet
81 @item
82 histogram difference: This offline tool recomputes the histogram after merging
83 the counters. The resulting histogram, therefore, is precise. The online
84 merging does not have this capability -- the histogram is merged from two
85 histograms and the result is an approximation.
87 @item
88 summary checksum difference: Summary checksum uses a CRC32 operation. The value
89 depends on the link list order of gcov-info objects. This order is different in
90 gcov-tool from that in the online merge. It's expected to have different
91 summary checksums. It does not really matter as the compiler does not use this
92 checksum anywhere.
94 @item
95 value profile counter values difference: Some counter values for value profile
96 are runtime dependent, like heap addresses. It's normal to see some difference
97 in these kind of counters.
98 @end itemize
100 @c man end
102 @node Invoking Gcov-tool
103 @section Invoking @command{gcov-tool}
105 @smallexample
106 gcov-tool @r{[}@var{global-options}@r{]} SUB_COMMAND
107 @r{[}@var{sub_command-options}@r{]} @var{profile_dir}
108 @end smallexample
110 @command{gcov-tool} accepts the following options:
112 @ignore
113 @c man begin SYNOPSIS
114 gcov-tool [@option{-v}|@option{--version}] [@option{-h}|@option{--help}]
116 gcov-tool merge [merge-options] @var{directory1} @var{directory2}
117      [@option{-v}|@option{--verbose}]
118      [@option{-o}|@option{ --output} @var{directory}]
119      [@option{-w}|@option{--weight} @var{w1,w2}]
121 gcov-tool rewrite [rewrite-options] @var{directory}
122      [@option{-v}|@option{--verbose}]
123      [@option{-o}|@option{--output} @var{directory}]
124      [@option{-s}|@option{--scale} @var{float_or_simple-frac_value}]
125      [@option{-n}|@option{--normalize} @var{long_long_value}]
126 @c man end
127 @c man begin SEEALSO
128 gpl(7), gfdl(7), fsf-funding(7), gcc(1), gcov(1) and the Info entry for
129 @file{gcc}.
130 @c man end
131 @end ignore
133 @c man begin OPTIONS
134 @table @gcctabopt
135 @item -h
136 @itemx --help
137 Display help about using @command{gcov-tool} (on the standard output), and
138 exit without doing any further processing.
140 @item -v
141 @itemx --version
142 Display the @command{gcov-tool} version number (on the standard output),
143 and exit without doing any further processing.
145 @item merge
146 Merge two profile directories.
148 @table @gcctabopt
149 @item -v
150 @itemx --verbose
151 Set the verbose mode.
153 @item -o @var{directory}
154 @itemx --output @var{directory}
155 Set the output profile directory. Default output directory name is
156 @var{merged_profile}.
158 @item -w @var{w1},@var{w2}
159 @itemx --weight @var{w1},@var{w2}
160 Set the merge weights of the @var{directory1} and @var{directory2},
161 respectively. The default weights are 1 for both.
162 @end table
164 @item rewrite
165 Read the specified profile directory and rewrite to a new directory.
167 @table @gcctabopt
168 @item -v
169 @itemx --verbose
170 Set the verbose mode.
172 @item -o @var{directory}
173 @itemx --output @var{directory}
174 Set the output profile directory. Default output name is @var{rewrite_profile}.
176 @item -s @var{float_or_simple-frac_value}
177 @itemx --scale @var{float_or_simple-frac_value}
178 Scale the profile counters. The specified value can be in floating point value,
179 or simple fraction value form, such 1, 2, 2/3, and 5/3.
181 @item -n @var{long_long_value}
182 @itemx --normalize <long_long_value>
183 Normalize the profile. The specified value is the max counter value
184 in the new profile.
186 @end table
187 @end table
189 @c man end