1LLVM-PROFDATA(1) LLVM LLVM-PROFDATA(1)
2
3
4
6 llvm-profdata - Profile data tool
7
9 llvm-profdata command [args...]
10
12 The llvm-profdata tool is a small utility for working with profile data
13 files.
14
16 • merge
17
18 • show
19
21 SYNOPSIS
22 llvm-profdata merge [options] [filename...]
23
24 DESCRIPTION
25 llvm-profdata merge takes several profile data files generated by PGO
26 instrumentation and merges them together into a single indexed profile
27 data file.
28
29 By default profile data is merged without modification. This means that
30 the relative importance of each input file is proportional to the num‐
31 ber of samples or counts it contains. In general, the input from a
32 longer training run will be interpreted as relatively more important
33 than a shorter run. Depending on the nature of the training runs it may
34 be useful to adjust the weight given to each input file by using the
35 -weighted-input option.
36
37 Profiles passed in via -weighted-input, -input-files, or via positional
38 arguments are processed once for each time they are seen.
39
40 OPTIONS
41 -help Print a summary of command line options.
42
43 -output=output, -o=output
44 Specify the output file name. Output cannot be - as the result‐
45 ing indexed profile data can't be written to standard output.
46
47 -weighted-input=weight,filename
48 Specify an input file name along with a weight. The profile
49 counts of the supplied filename will be scaled (multiplied) by
50 the supplied weight, where where weight is a decimal integer >=
51 1. Input files specified without using this option are assigned
52 a default weight of 1. Examples are shown below.
53
54 -input-files=path, -f=path
55 Specify a file which contains a list of files to merge. The en‐
56 tries in this file are newline-separated. Lines starting with
57 '#' are skipped. Entries may be of the form <filename> or
58 <weight>,<filename>.
59
60 -remapping-file=path, -r=path
61 Specify a file which contains a remapping from symbol names in
62 the input profile to the symbol names that should be used in the
63 output profile. The file should consist of lines of the form
64 <input-symbol> <output-symbol>. Blank lines and lines starting
65 with # are skipped.
66
67 The llvm-cxxmap tool can be used to generate the symbol remap‐
68 ping file.
69
70 -instr (default)
71 Specify that the input profile is an instrumentation-based pro‐
72 file.
73
74 -sample
75 Specify that the input profile is a sample-based profile.
76
77 The format of the generated file can be generated in one of
78 three ways:
79
80 -binary (default)
81
82 Emit the profile using a binary encoding. For instrumenta‐
83 tion-based profile the output format is the indexed binary for‐
84 mat.
85
86 -text
87
88 Emit the profile in text mode. This option can also be used with
89 both sample-based and instrumentation-based profile. When this
90 option is used the profile will be dumped in the text format
91 that is parsable by the profile reader.
92
93 -gcc
94
95 Emit the profile using GCC's gcov format (Not yet supported).
96
97 -sparse[=true|false]
98 Do not emit function records with 0 execution count. Can only be
99 used in conjunction with -instr. Defaults to false, since it can
100 inhibit compiler optimization during PGO.
101
102 -num-threads=N, -j=N
103 Use N threads to perform profile merging. When N=0, llvm-prof‐
104 data auto-detects an appropriate number of threads to use. This
105 is the default.
106
107 EXAMPLES
108 Basic Usage
109 Merge three profiles:
110
111 llvm-profdata merge foo.profdata bar.profdata baz.profdata -output merged.profdata
112
113 Weighted Input
114 The input file foo.profdata is especially important, multiply its
115 counts by 10:
116
117 llvm-profdata merge -weighted-input=10,foo.profdata bar.profdata baz.profdata -output merged.profdata
118
119 Exactly equivalent to the previous invocation (explicit form; useful
120 for programmatic invocation):
121
122 llvm-profdata merge -weighted-input=10,foo.profdata -weighted-input=1,bar.profdata -weighted-input=1,baz.profdata -output merged.profdata
123
125 SYNOPSIS
126 llvm-profdata show [options] [filename]
127
128 DESCRIPTION
129 llvm-profdata show takes a profile data file and displays the informa‐
130 tion about the profile counters for this file and for any of the speci‐
131 fied function(s).
132
133 If filename is omitted or is -, then llvm-profdata show reads its input
134 from standard input.
135
136 OPTIONS
137 -all-functions
138 Print details for every function.
139
140 -counts
141 Print the counter values for the displayed functions.
142
143 -function=string
144 Print details for a function if the function's name contains the
145 given string.
146
147 -help Print a summary of command line options.
148
149 -output=output, -o=output
150 Specify the output file name. If output is - or it isn't speci‐
151 fied, then the output is sent to standard output.
152
153 -instr (default)
154 Specify that the input profile is an instrumentation-based pro‐
155 file.
156
157 -text Instruct the profile dumper to show profile counts in the text
158 format of the instrumentation-based profile data representation.
159 By default, the profile information is dumped in a more human
160 readable form (also in text) with annotations.
161
162 -topn=n
163 Instruct the profile dumper to show the top n functions with the
164 hottest basic blocks in the summary section. By default, the
165 topn functions are not dumped.
166
167 -sample
168 Specify that the input profile is a sample-based profile.
169
170 -memop-sizes
171 Show the profiled sizes of the memory intrinsic calls for shown
172 functions.
173
174 -value-cutoff=n
175 Show only those functions whose max count values are greater or
176 equal to n. By default, the value-cutoff is set to 0.
177
178 -list-below-cutoff
179 Only output names of functions whose max count value are below
180 the cutoff value.
181
183 llvm-profdata returns 1 if the command is omitted or is invalid, if it
184 cannot read input files, or if there is a mismatch between their data.
185
187 Maintained by the LLVM Team (https://llvm.org/).
188
190 2003-2023, LLVM Project
191
192
193
194
1958 2023-07-20 LLVM-PROFDATA(1)