annotate gcc/doc/gcov-tool.texi @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1 @c Copyright (C) 2014-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
2 @c This is part of the GCC manual.
kono
parents:
diff changeset
3 @c For copying conditions, see the file gcc.texi.
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 @ignore
kono
parents:
diff changeset
6 @c man begin COPYRIGHT
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
7 Copyright @copyright{} 2014-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 Permission is granted to copy, distribute and/or modify this document
kono
parents:
diff changeset
10 under the terms of the GNU Free Documentation License, Version 1.3 or
kono
parents:
diff changeset
11 any later version published by the Free Software Foundation; with the
kono
parents:
diff changeset
12 Invariant Sections being ``GNU General Public License'' and ``Funding
kono
parents:
diff changeset
13 Free Software'', the Front-Cover texts being (a) (see below), and with
kono
parents:
diff changeset
14 the Back-Cover Texts being (b) (see below). A copy of the license is
kono
parents:
diff changeset
15 included in the gfdl(7) man page.
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 (a) The FSF's Front-Cover Text is:
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 A GNU Manual
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 (b) The FSF's Back-Cover Text is:
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 You have freedom to copy and modify this GNU Manual, like GNU
kono
parents:
diff changeset
24 software. Copies published by the Free Software Foundation raise
kono
parents:
diff changeset
25 funds for GNU development.
kono
parents:
diff changeset
26 @c man end
kono
parents:
diff changeset
27 @c Set file name and title for the man page.
kono
parents:
diff changeset
28 @setfilename gcov-tool
kono
parents:
diff changeset
29 @settitle offline gcda profile processing tool
kono
parents:
diff changeset
30 @end ignore
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 @node Gcov-tool
kono
parents:
diff changeset
33 @chapter @command{gcov-tool}---an Offline Gcda Profile Processing Tool
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 @command{gcov-tool} is a tool you can use in conjunction with GCC to
kono
parents:
diff changeset
36 manipulate or process gcda profile files offline.
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 @menu
kono
parents:
diff changeset
39 * Gcov-tool Intro:: Introduction to gcov-tool.
kono
parents:
diff changeset
40 * Invoking Gcov-tool:: How to use gcov-tool.
kono
parents:
diff changeset
41 @end menu
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 @node Gcov-tool Intro
kono
parents:
diff changeset
44 @section Introduction to @command{gcov-tool}
kono
parents:
diff changeset
45 @c man begin DESCRIPTION
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 @command{gcov-tool} is an offline tool to process gcc's gcda profile files.
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 Current gcov-tool supports the following functionalities:
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 @itemize @bullet
kono
parents:
diff changeset
52 @item
kono
parents:
diff changeset
53 merge two sets of profiles with weights.
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 @item
kono
parents:
diff changeset
56 read one set of profile and rewrite profile contents. One can scale or
kono
parents:
diff changeset
57 normalize the count values.
kono
parents:
diff changeset
58 @end itemize
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 Examples of the use cases for this tool are:
kono
parents:
diff changeset
61 @itemize @bullet
kono
parents:
diff changeset
62 @item
kono
parents:
diff changeset
63 Collect the profiles for different set of inputs, and use this tool to merge
kono
parents:
diff changeset
64 them. One can specify the weight to factor in the relative importance of
kono
parents:
diff changeset
65 each input.
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 @item
kono
parents:
diff changeset
68 Rewrite the profile after removing a subset of the gcda files, while maintaining
kono
parents:
diff changeset
69 the consistency of the summary and the histogram.
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 @item
kono
parents:
diff changeset
72 It can also be used to debug or libgcov code as the tools shares the majority
kono
parents:
diff changeset
73 code as the runtime library.
kono
parents:
diff changeset
74 @end itemize
kono
parents:
diff changeset
75
kono
parents:
diff changeset
76 Note that for the merging operation, this profile generated offline may
kono
parents:
diff changeset
77 contain slight different values from the online merged profile. Here are
kono
parents:
diff changeset
78 a list of typical differences:
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 @itemize @bullet
kono
parents:
diff changeset
81 @item
kono
parents:
diff changeset
82 histogram difference: This offline tool recomputes the histogram after merging
kono
parents:
diff changeset
83 the counters. The resulting histogram, therefore, is precise. The online
kono
parents:
diff changeset
84 merging does not have this capability -- the histogram is merged from two
kono
parents:
diff changeset
85 histograms and the result is an approximation.
kono
parents:
diff changeset
86
kono
parents:
diff changeset
87 @item
kono
parents:
diff changeset
88 summary checksum difference: Summary checksum uses a CRC32 operation. The value
kono
parents:
diff changeset
89 depends on the link list order of gcov-info objects. This order is different in
kono
parents:
diff changeset
90 gcov-tool from that in the online merge. It's expected to have different
kono
parents:
diff changeset
91 summary checksums. It does not really matter as the compiler does not use this
kono
parents:
diff changeset
92 checksum anywhere.
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94 @item
kono
parents:
diff changeset
95 value profile counter values difference: Some counter values for value profile
kono
parents:
diff changeset
96 are runtime dependent, like heap addresses. It's normal to see some difference
kono
parents:
diff changeset
97 in these kind of counters.
kono
parents:
diff changeset
98 @end itemize
kono
parents:
diff changeset
99
kono
parents:
diff changeset
100 @c man end
kono
parents:
diff changeset
101
kono
parents:
diff changeset
102 @node Invoking Gcov-tool
kono
parents:
diff changeset
103 @section Invoking @command{gcov-tool}
kono
parents:
diff changeset
104
kono
parents:
diff changeset
105 @smallexample
kono
parents:
diff changeset
106 gcov-tool @r{[}@var{global-options}@r{]} SUB_COMMAND @r{[}@var{sub_command-options}@r{]} @var{profile_dir}
kono
parents:
diff changeset
107 @end smallexample
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109 @command{gcov-tool} accepts the following options:
kono
parents:
diff changeset
110
kono
parents:
diff changeset
111 @ignore
kono
parents:
diff changeset
112 @c man begin SYNOPSIS
kono
parents:
diff changeset
113 gcov-tool [@option{-v}|@option{--version}] [@option{-h}|@option{--help}]
kono
parents:
diff changeset
114
kono
parents:
diff changeset
115 gcov-tool merge [merge-options] @var{directory1} @var{directory2}
kono
parents:
diff changeset
116 [@option{-o}|@option{--output} @var{directory}]
kono
parents:
diff changeset
117 [@option{-v}|@option{--verbose}]
kono
parents:
diff changeset
118 [@option{-w}|@option{--weight} @var{w1,w2}]
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 gcov-tool rewrite [rewrite-options] @var{directory}
kono
parents:
diff changeset
121 [@option{-n}|@option{--normalize} @var{long_long_value}]
kono
parents:
diff changeset
122 [@option{-o}|@option{--output} @var{directory}]
kono
parents:
diff changeset
123 [@option{-s}|@option{--scale} @var{float_or_simple-frac_value}]
kono
parents:
diff changeset
124 [@option{-v}|@option{--verbose}]
kono
parents:
diff changeset
125
kono
parents:
diff changeset
126 gcov-tool overlap [overlap-options] @var{directory1} @var{directory2}
kono
parents:
diff changeset
127 [@option{-f}|@option{--function}]
kono
parents:
diff changeset
128 [@option{-F}|@option{--fullname}]
kono
parents:
diff changeset
129 [@option{-h}|@option{--hotonly}]
kono
parents:
diff changeset
130 [@option{-o}|@option{--object}]
kono
parents:
diff changeset
131 [@option{-t}|@option{--hot_threshold}] @var{float}
kono
parents:
diff changeset
132 [@option{-v}|@option{--verbose}]
kono
parents:
diff changeset
133
kono
parents:
diff changeset
134 @c man end
kono
parents:
diff changeset
135 @c man begin SEEALSO
kono
parents:
diff changeset
136 gpl(7), gfdl(7), fsf-funding(7), gcc(1), gcov(1) and the Info entry for
kono
parents:
diff changeset
137 @file{gcc}.
kono
parents:
diff changeset
138 @c man end
kono
parents:
diff changeset
139 @end ignore
kono
parents:
diff changeset
140
kono
parents:
diff changeset
141 @c man begin OPTIONS
kono
parents:
diff changeset
142 @table @gcctabopt
kono
parents:
diff changeset
143 @item -h
kono
parents:
diff changeset
144 @itemx --help
kono
parents:
diff changeset
145 Display help about using @command{gcov-tool} (on the standard output), and
kono
parents:
diff changeset
146 exit without doing any further processing.
kono
parents:
diff changeset
147
kono
parents:
diff changeset
148 @item -v
kono
parents:
diff changeset
149 @itemx --version
kono
parents:
diff changeset
150 Display the @command{gcov-tool} version number (on the standard output),
kono
parents:
diff changeset
151 and exit without doing any further processing.
kono
parents:
diff changeset
152
kono
parents:
diff changeset
153 @item merge
kono
parents:
diff changeset
154 Merge two profile directories.
kono
parents:
diff changeset
155 @table @gcctabopt
kono
parents:
diff changeset
156
kono
parents:
diff changeset
157 @item -o @var{directory}
kono
parents:
diff changeset
158 @itemx --output @var{directory}
kono
parents:
diff changeset
159 Set the output profile directory. Default output directory name is
kono
parents:
diff changeset
160 @var{merged_profile}.
kono
parents:
diff changeset
161
kono
parents:
diff changeset
162 @item -v
kono
parents:
diff changeset
163 @itemx --verbose
kono
parents:
diff changeset
164 Set the verbose mode.
kono
parents:
diff changeset
165
kono
parents:
diff changeset
166 @item -w @var{w1},@var{w2}
kono
parents:
diff changeset
167 @itemx --weight @var{w1},@var{w2}
kono
parents:
diff changeset
168 Set the merge weights of the @var{directory1} and @var{directory2},
kono
parents:
diff changeset
169 respectively. The default weights are 1 for both.
kono
parents:
diff changeset
170 @end table
kono
parents:
diff changeset
171
kono
parents:
diff changeset
172 @item rewrite
kono
parents:
diff changeset
173 Read the specified profile directory and rewrite to a new directory.
kono
parents:
diff changeset
174 @table @gcctabopt
kono
parents:
diff changeset
175
kono
parents:
diff changeset
176 @item -n @var{long_long_value}
kono
parents:
diff changeset
177 @itemx --normalize <long_long_value>
kono
parents:
diff changeset
178 Normalize the profile. The specified value is the max counter value
kono
parents:
diff changeset
179 in the new profile.
kono
parents:
diff changeset
180
kono
parents:
diff changeset
181 @item -o @var{directory}
kono
parents:
diff changeset
182 @itemx --output @var{directory}
kono
parents:
diff changeset
183 Set the output profile directory. Default output name is @var{rewrite_profile}.
kono
parents:
diff changeset
184
kono
parents:
diff changeset
185 @item -s @var{float_or_simple-frac_value}
kono
parents:
diff changeset
186 @itemx --scale @var{float_or_simple-frac_value}
kono
parents:
diff changeset
187 Scale the profile counters. The specified value can be in floating point value,
kono
parents:
diff changeset
188 or simple fraction value form, such 1, 2, 2/3, and 5/3.
kono
parents:
diff changeset
189
kono
parents:
diff changeset
190 @item -v
kono
parents:
diff changeset
191 @itemx --verbose
kono
parents:
diff changeset
192 Set the verbose mode.
kono
parents:
diff changeset
193 @end table
kono
parents:
diff changeset
194
kono
parents:
diff changeset
195 @item overlap
kono
parents:
diff changeset
196 Compute the overlap score between the two specified profile directories.
kono
parents:
diff changeset
197 The overlap score is computed based on the arc profiles. It is defined as
kono
parents:
diff changeset
198 the sum of min (p1_counter[i] / p1_sum_all, p2_counter[i] / p2_sum_all),
kono
parents:
diff changeset
199 for all arc counter i, where p1_counter[i] and p2_counter[i] are two
kono
parents:
diff changeset
200 matched counters and p1_sum_all and p2_sum_all are the sum of counter
kono
parents:
diff changeset
201 values in profile 1 and profile 2, respectively.
kono
parents:
diff changeset
202
kono
parents:
diff changeset
203 @table @gcctabopt
kono
parents:
diff changeset
204 @item -f
kono
parents:
diff changeset
205 @itemx --function
kono
parents:
diff changeset
206 Print function level overlap score.
kono
parents:
diff changeset
207
kono
parents:
diff changeset
208 @item -F
kono
parents:
diff changeset
209 @itemx --fullname
kono
parents:
diff changeset
210 Print full gcda filename.
kono
parents:
diff changeset
211
kono
parents:
diff changeset
212 @item -h
kono
parents:
diff changeset
213 @itemx --hotonly
kono
parents:
diff changeset
214 Only print info for hot objects/functions.
kono
parents:
diff changeset
215
kono
parents:
diff changeset
216 @item -o
kono
parents:
diff changeset
217 @itemx --object
kono
parents:
diff changeset
218 Print object level overlap score.
kono
parents:
diff changeset
219
kono
parents:
diff changeset
220 @item -t @var{float}
kono
parents:
diff changeset
221 @itemx --hot_threshold <float>
kono
parents:
diff changeset
222 Set the threshold for hot counter value.
kono
parents:
diff changeset
223
kono
parents:
diff changeset
224 @item -v
kono
parents:
diff changeset
225 @itemx --verbose
kono
parents:
diff changeset
226 Set the verbose mode.
kono
parents:
diff changeset
227 @end table
kono
parents:
diff changeset
228
kono
parents:
diff changeset
229 @end table
kono
parents:
diff changeset
230
kono
parents:
diff changeset
231 @c man end