1996-05-10 06:27:26 -07:00
|
|
|
.TH OCAMLCP 1
|
1995-11-02 08:54:37 -08:00
|
|
|
|
|
|
|
.SH NAME
|
1996-04-30 07:53:58 -07:00
|
|
|
ocamlcp \- The Objective Caml profiling compiler
|
1995-11-02 08:54:37 -08:00
|
|
|
|
|
|
|
.SH SYNOPSIS
|
1996-04-30 07:53:58 -07:00
|
|
|
.B ocamlcp
|
1995-11-02 08:54:37 -08:00
|
|
|
[
|
1996-04-30 07:53:58 -07:00
|
|
|
.I ocamlc options
|
1995-11-02 08:54:37 -08:00
|
|
|
]
|
|
|
|
[
|
|
|
|
.BI \-p \ flags
|
|
|
|
]
|
|
|
|
.I filename ...
|
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
The
|
1996-04-30 07:53:58 -07:00
|
|
|
.B ocamlcp
|
1995-11-02 08:54:37 -08:00
|
|
|
script is a front-end to
|
1996-04-30 07:53:58 -07:00
|
|
|
.BR ocamlc (1)
|
1995-11-02 08:54:37 -08:00
|
|
|
that instruments the source code, adding code to record how many times
|
|
|
|
functions are called, branches of conditionals are taken, ...
|
|
|
|
Execution of instrumented code produces an execution profile in the
|
1996-04-30 07:53:58 -07:00
|
|
|
file ocamlprof.dump, which can be read using
|
|
|
|
.BR ocamlprof (1).
|
1995-11-02 08:54:37 -08:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
.B ocamlcp
|
1995-11-02 08:54:37 -08:00
|
|
|
accepts the same arguments and options as
|
1996-04-30 07:53:58 -07:00
|
|
|
.BR ocamlc (1).
|
1995-11-02 08:54:37 -08:00
|
|
|
|
|
|
|
.SH OPTIONS
|
|
|
|
|
|
|
|
In addition to the
|
1996-04-30 07:53:58 -07:00
|
|
|
.BR ocamlc (1)
|
1995-11-02 08:54:37 -08:00
|
|
|
options,
|
1996-04-30 07:53:58 -07:00
|
|
|
.B ocamlcp
|
1995-11-02 08:54:37 -08:00
|
|
|
accepts the following option controlling the amount of profiling
|
|
|
|
information:
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-p \ letters
|
|
|
|
The letters following
|
|
|
|
.B -p
|
|
|
|
indicate which parts of the program should be profiled:
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.B a
|
|
|
|
all options
|
|
|
|
.TP
|
|
|
|
.B f
|
|
|
|
function calls : a count point is set at the beginning of function bodies
|
|
|
|
.TP
|
|
|
|
.B i
|
|
|
|
if... then... else: count points are set in
|
|
|
|
both "then" branch and "else" branch
|
|
|
|
.TP
|
|
|
|
.B l
|
|
|
|
while, for loops: a count point is set at the beginning of
|
|
|
|
the loop body
|
|
|
|
.TP
|
|
|
|
.B m
|
|
|
|
"match" branches: a count point is set at the beginning of the
|
|
|
|
body of each branch
|
|
|
|
.TP
|
|
|
|
.B t
|
|
|
|
try...with branches: a count point is set at the
|
|
|
|
beginning of the body of each branch
|
|
|
|
|
|
|
|
For instance, compiling with
|
1996-04-30 07:53:58 -07:00
|
|
|
.B ocamlcp \-pfilm
|
1995-11-02 08:54:37 -08:00
|
|
|
profiles function calls, if... then... else..., loops, and pattern
|
|
|
|
matching.
|
|
|
|
|
|
|
|
Calling
|
1996-04-30 07:53:58 -07:00
|
|
|
.BR ocamlcp (1)
|
1995-11-02 08:54:37 -08:00
|
|
|
without the
|
|
|
|
.B \-p
|
|
|
|
option defaults to
|
|
|
|
.B \-p fm
|
|
|
|
meaning
|
|
|
|
that only function calls and pattern matching are profiled.
|
|
|
|
|
|
|
|
.SH SEE ALSO
|
1996-04-30 07:53:58 -07:00
|
|
|
.BR ocamlc (1),
|
|
|
|
.BR ocamlprof (1).
|
1995-11-02 08:54:37 -08:00
|
|
|
.br
|
1996-04-30 07:53:58 -07:00
|
|
|
.I The Objective Caml user's manual,
|
1995-11-02 08:54:37 -08:00
|
|
|
chapter "Profiling".
|