217 lines
4.2 KiB
HTML
217 lines
4.2 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of OCAMLCP</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>OCAMLCP</H1>
|
|
Section: User Commands (1)<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<P>
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
ocamlcp, ocamloptp - The OCaml profiling compilers
|
|
<P>
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>ocamlcp</B>
|
|
|
|
[
|
|
<I>ocamlc options</I>
|
|
|
|
]
|
|
[
|
|
<B>-P</B><I> flags</I>
|
|
|
|
]
|
|
<I>filename ...</I>
|
|
|
|
<P>
|
|
<B>ocamloptp</B>
|
|
|
|
[
|
|
<I>ocamlopt options</I>
|
|
|
|
]
|
|
[
|
|
<B>-P</B><I> flags</I>
|
|
|
|
]
|
|
<I>filename ...</I>
|
|
|
|
<P>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The
|
|
<B>ocamlcp</B>
|
|
|
|
and
|
|
<B>ocamloptp</B>
|
|
|
|
commands are front-ends to
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlc">ocamlc</A></B>(1)
|
|
|
|
and
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlopt">ocamlopt</A></B>(1)
|
|
|
|
that instrument the source code, adding code to record how many times
|
|
functions are called, branches of conditionals are taken, etc.
|
|
Execution of instrumented code produces an execution profile in the
|
|
file ocamlprof.dump, which can be read using
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlprof">ocamlprof</A></B>(1).
|
|
|
|
<P>
|
|
<B>ocamlcp</B>
|
|
|
|
accepts the same arguments and options as
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlc">ocamlc</A></B>(1)
|
|
|
|
and
|
|
<B>ocamloptp</B>
|
|
|
|
accepts the same arguments and options as
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlopt">ocamlopt</A></B>(1).
|
|
|
|
There is only one exception: in both cases, the
|
|
<B>-pp</B>
|
|
|
|
option is not supported. If you need to preprocess your source files,
|
|
you will have to do it separately before calling
|
|
<B>ocamlcp</B>
|
|
|
|
or
|
|
<B>ocamloptp</B>.
|
|
|
|
<P>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<P>
|
|
In addition to the
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlc">ocamlc</A></B>(1)
|
|
|
|
or
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlopt">ocamlopt</A></B>(1)
|
|
|
|
options,
|
|
<B>ocamlcp</B>
|
|
|
|
and
|
|
<B>ocamloptp</B>
|
|
|
|
accept one option to control the kind of profiling information, the
|
|
<B>-P</B><I> letters</I>
|
|
|
|
option. The
|
|
<I>letters</I>
|
|
|
|
indicate which parts of the program should be profiled:
|
|
<DL COMPACT>
|
|
<DT id="1"><B>a</B>
|
|
|
|
<DD>
|
|
all options
|
|
<DT id="2"><B>f</B>
|
|
|
|
<DD>
|
|
function calls : a count point is set at the beginning of each function body
|
|
<DT id="3"><B>i</B>
|
|
|
|
<DD>
|
|
<B>if</B> ...<B> then</B> ...<B> else</B>:
|
|
|
|
count points are set in both
|
|
<B>then</B> and<B> else</B>
|
|
|
|
branches
|
|
<DT id="4"><B>l</B>
|
|
|
|
<DD>
|
|
<B>while</B>,<B> for</B>
|
|
|
|
loops: a count point is set at the beginning of the loop body
|
|
<DT id="5"><B>m</B>
|
|
|
|
<DD>
|
|
<B>match</B>
|
|
|
|
branches: a count point is set at the beginning of the
|
|
body of each branch of a pattern-matching
|
|
<DT id="6"><B>t</B>
|
|
|
|
<DD>
|
|
<B>try</B> ...<B> with</B>
|
|
|
|
branches: a count point is set at the beginning of the body of each
|
|
branch of an exception catcher
|
|
<P>
|
|
</DL>
|
|
<P>
|
|
|
|
For instance, compiling with
|
|
<B>ocamlcp -P film</B>
|
|
|
|
profiles function calls,
|
|
<B>if</B> ...<B> then</B> ...<B> else</B> ...,
|
|
|
|
loops, and pattern matching.
|
|
<P>
|
|
Calling
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlcp">ocamlcp</A></B>(1)
|
|
|
|
or
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamloptp">ocamloptp</A></B>(1)
|
|
|
|
without the
|
|
<B>-P</B>
|
|
|
|
option defaults to
|
|
<B>-P fm</B>,
|
|
|
|
meaning that only function calls and pattern matching are profiled.
|
|
<P>
|
|
Note: for compatibility with previous versions,
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlcp">ocamlcp</A></B>(1)
|
|
|
|
also accepts the option
|
|
<B>-p</B>
|
|
|
|
with the same argument and meaning as
|
|
<B>-P</B>.
|
|
|
|
<P>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlc">ocamlc</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlopt">ocamlopt</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlprof">ocamlprof</A></B>(1).
|
|
|
|
<BR>
|
|
|
|
<I>The OCaml user's manual</I>,
|
|
|
|
chapter "Profiling".
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="7"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="8"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="9"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="10"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="11"><A HREF="#lbAF">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:20 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|