Research V4 development
[unix-history] / man / manx / mon.3
CommitLineData
76b79f1f
KT
1.th MONITOR III 5/10/73
2.sh NAME
3monitor \*- prepare execution profile
4.sh SYNOPSIS
5.ft B
6monitor(lowpc, highpc, buffer, bufsize)
7.br
8int lowpc( ), highpc( ), buffer[ ], bufsize;
9.sh DESCRIPTION
10.it Monitor
11is an interface to the system's profile entry (II).
12.it lowpc
13and
14.it highpc
15are the names of two functions;
16.it buffer
17is the address of a (user supplied)
18array of
19.it bufsize
20integers.
21.it Monitor
22arranges for the system to sample the user's
23program counter periodically
24and record the execution histogram in
25the buffer.
26The lowest address sampled
27is that of
28.it lowpc
29and the highest is
30just below \fIhighpc\fR.
31For the results to be significant,
32especially where there are small, heavily
33used routines,
34it is suggested that the buffer be no more
35than a few times smaller than the range
36of locations sampled.
37.s3
38To profile the entire program,
39it is sufficient to use
40.s3
41 extern etext;
42 ...
43 monitor(2, &etext, buf, bufsize);
44.s3
45.it etext
46is a loader-defined symbol which lies just above all the
47program text.
48.s3
49To stop execution monitoring and write the results
50on the file \fBmon.out\fR.
51use
52.s3
53 monitor(0);
54.s3
55Then, when the program exits, prof (I) can be used
56to examine the results.
57.sh FILES
58mon.out
59.sh "SEE ALSO"
60prof (I), profil (II)