BSD 4_2 development
[unix-history] / usr / man / man2 / profil.2
CommitLineData
9963d26a
C
1.TH PROFIL 2 "12 February 1983"
2.UC 4
3.SH NAME
4profil \- execution time profile
5.SH SYNOPSIS
6.nf
7.B profil(buff, bufsiz, offset, scale)
8.B char *buff;
9.B int bufsiz, offset, scale;
10.fi
11.SH DESCRIPTION
12.I Buff
13points to an area of core whose length (in bytes) is given by
14.IR bufsiz .
15After this call, the user's program counter (pc)
16is examined each clock tick (10 milliseconds);
17.I offset
18is subtracted from it, and the result multiplied by
19.IR scale .
20If the resulting number corresponds to a word
21inside
22.I buff,
23that word is incremented.
24.PP
25The scale is interpreted as an unsigned,
26fixed-point fraction with binary point at the
27left: 0x10000 gives a 1-1 mapping of pc's to words
28in
29.I buff;
300x8000 maps each pair of instruction words
31together.
320x2 maps all instructions onto the beginning of
33.I buff
34(producing a non-interrupting core clock).
35.PP
36Profiling is turned off by giving a
37.I scale
38of 0 or 1.
39It is rendered
40ineffective by giving a
41.I bufsiz
42of 0.
43Profiling is turned off when an
44.I execve
45is executed, but remains on in child and parent both
46after a
47.IR fork .
48Profiling is turned off if an update in
49.I buff
50would cause a memory fault.
51.SH "RETURN VALUE
52A 0, indicating success, is always returned.
53.SH "SEE ALSO"
54gprof(1), setitimer(2), monitor(3)