diff options
Diffstat (limited to 'man/ocamlcp.m')
-rw-r--r-- | man/ocamlcp.m | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/man/ocamlcp.m b/man/ocamlcp.m new file mode 100644 index 000000000..ddaee1231 --- /dev/null +++ b/man/ocamlcp.m @@ -0,0 +1,88 @@ +.TH CSLCP 1 + +.SH NAME +ocamlcp \- The Objective Caml profiling compiler + +.SH SYNOPSIS +.B ocamlcp +[ +.I ocamlc options +] +[ +.BI \-p \ flags +] +.I filename ... + +.SH DESCRIPTION +The +.B ocamlcp +script is a front-end to +.BR ocamlc (1) +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 +file ocamlprof.dump, which can be read using +.BR ocamlprof (1). + +.B ocamlcp +accepts the same arguments and options as +.BR ocamlc (1). + +.SH OPTIONS + +In addition to the +.BR ocamlc (1) +options, +.B ocamlcp +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 +.B ocamlcp \-pfilm +profiles function calls, if... then... else..., loops, and pattern +matching. + +Calling +.BR ocamlcp (1) +without the +.B \-p +option defaults to +.B \-p fm +meaning +that only function calls and pattern matching are profiled. + +.SH SEE ALSO +.BR ocamlc (1), +.BR ocamlprof (1). +.br +.I The Objective Caml user's manual, +chapter "Profiling". |