1LLVM-PROFDATA(1)                     LLVM                     LLVM-PROFDATA(1)
2
3
4

NAME

6       llvm-profdata - Profile data tool
7

SYNOPSIS

9       llvm-profdata command [args...]
10

DESCRIPTION

12       The llvm-profdata tool is a small utility for working with profile data
13       files.
14

COMMANDS

16merge
17
18show
19

MERGE

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       -instr (default)
61              Specify  that the input profile is an instrumentation-based pro‐
62              file.
63
64       -sample
65              Specify that the input profile is a sample-based profile.
66
67              The format of the generated file can  be  generated  in  one  of
68              three ways:
69
70              -binary (default)
71
72              Emit  the  profile  using  a  binary  encoding. For instrumenta‐
73              tion-based profile the output format is the indexed binary  for‐
74              mat.
75
76              -text
77
78              Emit the profile in text mode. This option can also be used with
79              both sample-based and instrumentation-based profile.  When  this
80              option  is  used  the  profile will be dumped in the text format
81              that is parsable by the profile reader.
82
83              -gcc
84
85              Emit the profile using GCC's gcov format (Not yet supported).
86
87       -sparse[=true|false]
88              Do not emit function records with 0 execution count. Can only be
89              used in conjunction with -instr. Defaults to false, since it can
90              inhibit compiler optimization during PGO.
91
92       -num-threads=N, -j=N
93              Use N threads to perform profile merging. When  N=0,  llvm-prof‐
94              data  auto-detects an appropriate number of threads to use. This
95              is the default.
96
97   EXAMPLES
98   Basic Usage
99       Merge three profiles:
100
101          llvm-profdata merge foo.profdata bar.profdata baz.profdata -output merged.profdata
102
103   Weighted Input
104       The input file  foo.profdata  is  especially  important,  multiply  its
105       counts by 10:
106
107          llvm-profdata merge -weighted-input=10,foo.profdata bar.profdata baz.profdata -output merged.profdata
108
109       Exactly  equivalent  to  the previous invocation (explicit form; useful
110       for programmatic invocation):
111
112          llvm-profdata merge -weighted-input=10,foo.profdata -weighted-input=1,bar.profdata -weighted-input=1,baz.profdata -output merged.profdata
113

SHOW

115   SYNOPSIS
116       llvm-profdata show [options] [filename]
117
118   DESCRIPTION
119       llvm-profdata show takes a profile data file and displays the  informa‐
120       tion about the profile counters for this file and for any of the speci‐
121       fied function(s).
122
123       If filename is omitted or is -, then llvm-profdata show reads its input
124       from standard input.
125
126   OPTIONS
127       -all-functions
128              Print details for every function.
129
130       -counts
131              Print the counter values for the displayed functions.
132
133       -function=string
134              Print details for a function if the function's name contains the
135              given string.
136
137       -help  Print a summary of command line options.
138
139       -output=output, -o=output
140              Specify the output file name.  If output is - or it isn't speci‐
141              fied, then the output is sent to standard output.
142
143       -instr (default)
144              Specify  that the input profile is an instrumentation-based pro‐
145              file.
146
147       -text  Instruct the profile dumper to show profile counts in  the  text
148              format of the instrumentation-based profile data representation.
149              By default, the profile information is dumped in  a  more  human
150              readable form (also in text) with annotations.
151
152       -topn=n
153              Instruct the profile dumper to show the top n functions with the
154              hottest basic blocks in the summary  section.  By  default,  the
155              topn functions are not dumped.
156
157       -sample
158              Specify that the input profile is a sample-based profile.
159
160       -memop-sizes
161              Show  the profiled sizes of the memory intrinsic calls for shown
162              functions.
163

EXIT STATUS

165       llvm-profdata returns 1 if the command is omitted or is invalid, if  it
166       cannot read input files, or if there is a mismatch between their data.
167

AUTHOR

169       Maintained by The LLVM Team (http://llvm.org/).
170
172       2003-2023, LLVM Project
173
174
175
176
1777                                 2023-07-20                  LLVM-PROFDATA(1)
Impressum