\" $Id: ocamlcp.m,v 1.4 2008/09/15 14:05:30 doligez Exp $ .TH JOCAMLCP 1 .SH NAME Jocamlcp \- The JoCaml profiling compiler .SH SYNOPSIS .B jocamlcp [ .I jocamlcp options ] [ .BI \-p \ flags ] .I filename ... .SH DESCRIPTION The .B jocamlcp command is a front-end to .BR jocamlc (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 jocamlprof (1). .B jocamlcp accepts the same arguments and options as .BR jocamlc (1). .SH OPTIONS In addition to the .BR jocamlc (1) options, .B jocamlcp accepts the following option controlling the amount of profiling information: .TP .BI \-p \ letters The .I letters 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 each function body .TP .B i .BR if \ ... \ then \ ... \ else : count points are set in both .BR then \ and \ else branches .TP .B l \BR while , \ for loops: a count point is set at the beginning of the loop body .TP .B m .B match branches: a count point is set at the beginning of the body of each branch of a pattern-matching .TP .B t .BR try \ ... \ with branches: a count point is set at the beginning of the body of each branch of an exception catcher .PP For instance, compiling with .B jocamlcp\ \-pfilm profiles function calls, .BR if \ ... \ then \ ... \ else \ ..., loops, and pattern matching. Calling .BR jocamlcp (1) without the .B \-p option defaults to .B \-p\ fm meaning that only function calls and pattern matching are profiled. Note: due to the implementation of streams and stream patterns as syntactic sugar, it is hard to predict what parts of stream expressions and patterns will be profiled by a given flag. To profile a program with streams, we recommend using .BR jocamlcp\ \-p\ a . .SH SEE ALSO .BR jocamlc (1), .BR jocamlprof (1). .br .IR "The Objective Caml user's manual" , chapter "Profiling".