Backport from sid to buster
[hcoop/debian/mlton.git] / man / mlprof.1
CommitLineData
7f918cf1
CE
1.TH mlprof 1 "February 6, 2018"
2.SH NAME
3\fBmlprof\fP \- display profiling information for a MLton-compiled executable
4.SH SYNOPSIS
5\fBmlprof \fI[option ...] a.out [mlmon.out ...]\fR
6.SH DESCRIPTION
7.PP
8\fBmlprof\fP extracts information from an executable compiled by
9\fBMLton\fP with \fB-profile alloc\fP or \fB-profile time\fP and the
10resulting \fBmlmon.out\fP file produced by running the executable.
11
12The output of \fBmlprof\fP consists of an initial line indicating the
13total amount of CPU time or bytes allocated. After this, source
14functions are listed along with the percentage of this total that they
15used, in decreasing order. If the program was compiled with
16\fB-profile-stack true\fP, \fBmlprof\fP will display the time spent or
17bytes allocated while the function was on the stack and in GC in
18addition to the time or bytes that the function is directly
19responsible for.
20
21With multiple \fBmlmon.out\fP files, \fBmlprof\fP will sum the
22profiling information.
23
24.SH OPTIONS
25.TP
26\fB-call-graph \fIfile\fP
27Write a call graph containing the table data to a dot file. See the
28\fBMLton User Guide\fP for details.
29.TP
30\fB-graph-title \fIstring\fP
31Set the call-graph title.
32.TP
33\fB-gray \fI{\fBfalse\fP|\fBtrue\fP}\fP
34Gray call-graph nodes according to stack %. This only makes sense if
35the executable was compiled \fB-profile-stack true\fP.
36.TP
37\fB-keep \fIexp\fP
38Only show functions specified by \fIexp\fP. For details on the
39allowed expressions, see the \fBMLton User Guide\fP. Multiple
40\fB-keep\fP expressions are not allowed.
41.TP
42\fB-mlmon \fIfile\fP
43Process the list of whitespace-separated \fBmlmon.out\fP files found
44in the specified file.
45.TP
46\fB-raw \fI{\fBfalse\fP|\fBtrue\fP}\fP
47Show the raw counts in addition to the percentages.
48.TP
49\fB-show-line \fI{\fBfalse\fP|\fBtrue\fP}\fP
50Show the file and line for each function.
51.TP
52\fB-split \fIregexp\fP
53Treat duplicates of functions whose name matches \fIregexp\fP as
54different functions.
55.TP
56\fB-thresh \fIx\fP
57An abbreviation for \fB-keep '(thresh x)'\fP, which only prints
58information about functions whose percentage is greater than or equal
59to \fBx\fP, where 0 <= \fBx\fP <= 100.0.
60.TP
61\fB-tolerant \fI{\fBfalse\fP|\fBtrue\fP}\fP
62Print a warning about broken \fBmlmon.out\fP files, but do not exit.
63.SH "SEE ALSO"
64.BR mlton (1)
65and the \fBMLton Guide\fP.