~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to man/ocamlcp.m

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Zacchiroli
  • Date: 2009-02-22 08:49:13 UTC
  • mfrom: (12.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090222084913-3i0uw2bhd0lgw0ok
* Uploading to unstable
* debian/control: bump dh-ocaml to (>= 0.4) to avoid buggy ocamlinit.mk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
\" $Id: ocamlcp.m,v 1.4 2008/09/15 14:05:30 doligez Exp $
 
2
 
1
3
.TH OCAMLCP 1
2
4
 
3
5
.SH NAME
16
18
.SH DESCRIPTION
17
19
The
18
20
.B ocamlcp
19
 
script is a front-end to
 
21
command is a front-end to
20
22
.BR ocamlc (1)
21
23
that instruments the source code, adding code to record how many times
22
24
functions are called, branches of conditionals are taken, ...
36
38
.B ocamlcp
37
39
accepts the following option controlling the amount of profiling
38
40
information:
39
 
 
40
41
.TP
41
 
.BR \-p \ letters
42
 
The letters following
43
 
.B -p
 
42
.BI \-p \ letters
 
43
The
 
44
.I letters
44
45
indicate which parts of the program should be profiled:
45
 
 
46
46
.TP
47
47
.B a
48
48
all options
49
49
.TP
50
50
.B f
51
 
function calls : a count point is set at the beginning of function bodies
 
51
function calls : a count point is set at the beginning of each function body
52
52
.TP
53
53
.B i
54
 
if... then... else: count points are set in
55
 
both "then" branch and "else" branch
 
54
.BR if \ ... \ then \ ... \ else :
 
55
count points are set in both
 
56
.BR then \ and \ else
 
57
branches
56
58
.TP
57
59
.B l
58
 
while, for loops: a count point is set at the beginning of
59
 
the loop body
 
60
\BR while , \ for
 
61
loops: a count point is set at the beginning of the loop body
60
62
.TP
61
63
.B m
62
 
"match" branches: a count point is set at the beginning of the
63
 
body of each branch
 
64
.B match
 
65
branches: a count point is set at the beginning of the
 
66
body of each branch of a pattern-matching
64
67
.TP
65
68
.B t
66
 
try...with branches: a count point is set at the
67
 
beginning of the body of each branch
68
 
 
69
 
For instance, compiling with 
70
 
.B ocamlcp \-pfilm
71
 
profiles function calls, if... then... else..., loops, and pattern
72
 
matching.
73
 
 
74
 
Calling 
 
69
.BR try \ ... \ with
 
70
branches: a count point is set at the beginning of the body of each
 
71
branch of an exception catcher
 
72
 
 
73
.PP
 
74
For instance, compiling with
 
75
.B ocamlcp\ \-pfilm
 
76
profiles function calls,
 
77
.BR if \ ... \ then \ ... \ else \ ...,
 
78
loops, and pattern matching.
 
79
 
 
80
Calling
75
81
.BR ocamlcp (1)
76
82
without the
77
83
.B \-p
78
84
option defaults to
79
 
.B \-p fm
80
 
meaning
81
 
that only function calls and pattern matching are profiled.
 
85
.B \-p\ fm
 
86
meaning that only function calls and pattern matching are profiled.
 
87
 
 
88
Note: due to the implementation of streams and stream patterns as
 
89
syntactic sugar, it is hard to predict what parts of stream expressions
 
90
and patterns will be profiled by a given flag.  To profile a program with
 
91
streams, we recommend using
 
92
.BR ocamlcp\ \-p\ a .
82
93
 
83
94
.SH SEE ALSO
84
95
.BR ocamlc (1),
85
96
.BR ocamlprof (1).
86
97
.br
87
 
.I The Objective Caml user's manual,
 
98
.IR "The Objective Caml user's manual" ,
88
99
chapter "Profiling".