.\" Man page generated from reStructuredText. . .TH "LLVM-PROFDATA" "1" "2020-01-20" "6" "LLVM" .SH NAME llvm-profdata \- Profile data tool . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .sp \fBllvm\-profdata\fP \fIcommand\fP [\fIargs…\fP] .SH DESCRIPTION .sp The \fBllvm\-profdata\fP tool is a small utility for working with profile data files. .SH COMMANDS .INDENT 0.0 .IP \(bu 2 \fI\%merge\fP .IP \(bu 2 \fI\%show\fP .UNINDENT .SH MERGE .SS SYNOPSIS .sp \fBllvm\-profdata merge\fP [\fIoptions\fP] [\fIfilename…\fP] .SS DESCRIPTION .sp \fBllvm\-profdata merge\fP takes several profile data files generated by PGO instrumentation and merges them together into a single indexed profile data file. .sp By default profile data is merged without modification. This means that the relative importance of each input file is proportional to the number of samples or counts it contains. In general, the input from a longer training run will be interpreted as relatively more important than a shorter run. Depending on the nature of the training runs it may be useful to adjust the weight given to each input file by using the \fB\-weighted\-input\fP option. .sp Profiles passed in via \fB\-weighted\-input\fP, \fB\-input\-files\fP, or via positional arguments are processed once for each time they are seen. .SS OPTIONS .INDENT 0.0 .TP .B \-help Print a summary of command line options. .UNINDENT .INDENT 0.0 .TP .B \-output=output, \-o=output Specify the output file name. \fIOutput\fP cannot be \fB\-\fP as the resulting indexed profile data can’t be written to standard output. .UNINDENT .INDENT 0.0 .TP .B \-weighted\-input=weight,filename Specify an input file name along with a weight. The profile counts of the supplied \fBfilename\fP will be scaled (multiplied) by the supplied \fBweight\fP, where where \fBweight\fP is a decimal integer >= 1. Input files specified without using this option are assigned a default weight of 1. Examples are shown below. .UNINDENT .INDENT 0.0 .TP .B \-input\-files=path, \-f=path Specify a file which contains a list of files to merge. The entries in this file are newline\-separated. Lines starting with ‘#’ are skipped. Entries may be of the form or ,. .UNINDENT .INDENT 0.0 .TP .B \-instr (default) Specify that the input profile is an instrumentation\-based profile. .UNINDENT .INDENT 0.0 .TP .B \-sample Specify that the input profile is a sample\-based profile. .sp The format of the generated file can be generated in one of three ways: .INDENT 7.0 .TP .B \-binary (default) .UNINDENT .sp Emit the profile using a binary encoding. For instrumentation\-based profile the output format is the indexed binary format. .INDENT 7.0 .TP .B \-text .UNINDENT .sp Emit the profile in text mode. This option can also be used with both sample\-based and instrumentation\-based profile. When this option is used the profile will be dumped in the text format that is parsable by the profile reader. .INDENT 7.0 .TP .B \-gcc .UNINDENT .sp Emit the profile using GCC’s gcov format (Not yet supported). .UNINDENT .INDENT 0.0 .TP .B \-sparse[=true|false] Do not emit function records with 0 execution count. Can only be used in conjunction with \-instr. Defaults to false, since it can inhibit compiler optimization during PGO. .UNINDENT .INDENT 0.0 .TP .B \-num\-threads=N, \-j=N Use N threads to perform profile merging. When N=0, llvm\-profdata auto\-detects an appropriate number of threads to use. This is the default. .UNINDENT .SS EXAMPLES .SS Basic Usage .sp Merge three profiles: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C llvm\-profdata merge foo.profdata bar.profdata baz.profdata \-output merged.profdata .ft P .fi .UNINDENT .UNINDENT .SS Weighted Input .sp The input file \fIfoo.profdata\fP is especially important, multiply its counts by 10: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C llvm\-profdata merge \-weighted\-input=10,foo.profdata bar.profdata baz.profdata \-output merged.profdata .ft P .fi .UNINDENT .UNINDENT .sp Exactly equivalent to the previous invocation (explicit form; useful for programmatic invocation): .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C llvm\-profdata merge \-weighted\-input=10,foo.profdata \-weighted\-input=1,bar.profdata \-weighted\-input=1,baz.profdata \-output merged.profdata .ft P .fi .UNINDENT .UNINDENT .SH SHOW .SS SYNOPSIS .sp \fBllvm\-profdata show\fP [\fIoptions\fP] [\fIfilename\fP] .SS DESCRIPTION .sp \fBllvm\-profdata show\fP takes a profile data file and displays the information about the profile counters for this file and for any of the specified function(s). .sp If \fIfilename\fP is omitted or is \fB\-\fP, then \fBllvm\-profdata show\fP reads its input from standard input. .SS OPTIONS .INDENT 0.0 .TP .B \-all\-functions Print details for every function. .UNINDENT .INDENT 0.0 .TP .B \-counts Print the counter values for the displayed functions. .UNINDENT .INDENT 0.0 .TP .B \-function=string Print details for a function if the function’s name contains the given string. .UNINDENT .INDENT 0.0 .TP .B \-help Print a summary of command line options. .UNINDENT .INDENT 0.0 .TP .B \-output=output, \-o=output Specify the output file name. If \fIoutput\fP is \fB\-\fP or it isn’t specified, then the output is sent to standard output. .UNINDENT .INDENT 0.0 .TP .B \-instr (default) Specify that the input profile is an instrumentation\-based profile. .UNINDENT .INDENT 0.0 .TP .B \-text Instruct the profile dumper to show profile counts in the text format of the instrumentation\-based profile data representation. By default, the profile information is dumped in a more human readable form (also in text) with annotations. .UNINDENT .INDENT 0.0 .TP .B \-topn=n Instruct the profile dumper to show the top \fBn\fP functions with the hottest basic blocks in the summary section. By default, the topn functions are not dumped. .UNINDENT .INDENT 0.0 .TP .B \-sample Specify that the input profile is a sample\-based profile. .UNINDENT .INDENT 0.0 .TP .B \-memop\-sizes Show the profiled sizes of the memory intrinsic calls for shown functions. .UNINDENT .SH EXIT STATUS .sp \fBllvm\-profdata\fP returns 1 if the command is omitted or is invalid, if it cannot read input files, or if there is a mismatch between their data. .SH AUTHOR Maintained by The LLVM Team (http://llvm.org/). .SH COPYRIGHT 2003-2020, LLVM Project .\" Generated by docutils manpage writer. .