a4b18f301e427f939fe8811fd5044344f2a456ee
[oota-llvm.git] / docs / CommandGuide / llvm-profdata.rst
1 llvm-profdata - Profile data tool
2 =================================
3
4 SYNOPSIS
5 --------
6
7 :program:`llvm-profdata` *command* [*args...*]
8
9 DESCRIPTION
10 -----------
11
12 The :program:`llvm-profdata` tool is a small utility for working with profile
13 data files.
14
15 COMMANDS
16 --------
17
18 * :ref:`merge <profdata-merge>`
19 * :ref:`show <profdata-show>`
20
21 .. program:: llvm-profdata merge
22
23 .. _profdata-merge:
24
25 MERGE
26 -----
27
28 SYNOPSIS
29 ^^^^^^^^
30
31 :program:`llvm-profdata merge` [*options*] [*filename[:weight]...*]
32
33 DESCRIPTION
34 ^^^^^^^^^^^
35
36 :program:`llvm-profdata merge` takes several profile data files
37 generated by PGO instrumentation and merges them together into a single
38 indexed profile data file.
39
40 The profile counts in each input file can be scaled (multiplied) by specifying
41 ``<filename>:<weight>``, where `<weight>` is a decimal integer >= 1.
42 A default weight of 1 is assumed if only `<filename>` is given.
43
44 OPTIONS
45 ^^^^^^^
46
47 .. option:: -help
48
49  Print a summary of command line options.
50
51 .. option:: -output=output, -o=output
52
53  Specify the output file name.  *Output* cannot be ``-`` as the resulting
54  indexed profile data can't be written to standard output.
55
56 .. option:: -instr (default)
57
58  Specify that the input profile is an instrumentation-based profile.
59
60 .. option:: -sample
61
62  Specify that the input profile is a sample-based profile.
63  
64  The format of the generated file can be generated in one of three ways:
65
66  .. option:: -binary (default)
67
68  Emit the profile using a binary encoding. For instrumentation-based profile
69  the output format is the indexed binary format. 
70
71  .. option:: -text
72
73  Emit the profile in text mode. This option can also be used with both
74  sample-based and instrumentation-based profile. When this option is used
75  the profile will be dumped in the text format that is parsable by the profile
76  reader.
77
78  .. option:: -gcc
79
80  Emit the profile using GCC's gcov format (Not yet supported).
81
82 .. program:: llvm-profdata show
83
84 .. _profdata-show:
85
86 SHOW
87 ----
88
89 SYNOPSIS
90 ^^^^^^^^
91
92 :program:`llvm-profdata show` [*options*] [*filename*]
93
94 DESCRIPTION
95 ^^^^^^^^^^^
96
97 :program:`llvm-profdata show` takes a profile data file and displays the
98 information about the profile counters for this file and
99 for any of the specified function(s).
100
101 If *filename* is omitted or is ``-``, then **llvm-profdata show** reads its
102 input from standard input.
103
104 OPTIONS
105 ^^^^^^^
106
107 .. option:: -all-functions
108
109  Print details for every function.
110
111 .. option:: -counts
112
113  Print the counter values for the displayed functions.
114
115 .. option:: -function=string
116
117  Print details for a function if the function's name contains the given string.
118
119 .. option:: -help
120
121  Print a summary of command line options.
122
123 .. option:: -output=output, -o=output
124
125  Specify the output file name.  If *output* is ``-`` or it isn't specified,
126  then the output is sent to standard output.
127
128 .. option:: -instr (default)
129
130  Specify that the input profile is an instrumentation-based profile.
131
132 .. option:: -text
133
134  Instruct the profile dumper to show profile counts in the text format of the
135  instrumentation-based profile data representation. By default, the profile
136  information is dumped in a more human readable form (also in text) with
137  annotations.
138
139 .. option:: -sample
140
141  Specify that the input profile is a sample-based profile.
142
143 EXIT STATUS
144 -----------
145
146 :program:`llvm-profdata` returns 1 if the command is omitted or is invalid,
147 if it cannot read input files, or if there is a mismatch between their data.