sigmask
[unix-history] / usr / src / lib / libc / sys / profil.2
CommitLineData
c579fd7e
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
ebff5f1a 5.\" @(#)profil.2 6.1 (Berkeley) %G%
c579fd7e 6.\"
ebff5f1a 7.TH PROFIL 2 ""
c579fd7e
KM
8.UC 4
9.SH NAME
10profil \- execution time profile
11.SH SYNOPSIS
12.nf
13.B profil(buff, bufsiz, offset, scale)
14.B char *buff;
15.B int bufsiz, offset, scale;
16.fi
17.SH DESCRIPTION
18.I Buff
19points to an area of core whose length (in bytes) is given by
20.IR bufsiz .
21After this call, the user's program counter (pc)
8a9565d6 22is examined each clock tick (10 milliseconds);
c579fd7e
KM
23.I offset
24is subtracted from it, and the result multiplied by
25.IR scale .
26If the resulting number corresponds to a word
27inside
28.I buff,
29that word is incremented.
30.PP
31The scale is interpreted as an unsigned,
32fixed-point fraction with binary point at the
8a9565d6 33left: 0x10000 gives a 1-1 mapping of pc's to words
c579fd7e
KM
34in
35.I buff;
8a9565d6 360x8000 maps each pair of instruction words
c579fd7e 37together.
8a9565d6 380x2 maps all instructions onto the beginning of
c579fd7e
KM
39.I buff
40(producing a non-interrupting core clock).
41.PP
42Profiling is turned off by giving a
43.I scale
44of 0 or 1.
45It is rendered
46ineffective by giving a
47.I bufsiz
48of 0.
49Profiling is turned off when an
8a9565d6 50.I execve
c579fd7e
KM
51is executed, but remains on in child and parent both
52after a
53.IR fork .
8a9565d6 54Profiling is turned off if an update in
c579fd7e
KM
55.I buff
56would cause a memory fault.
8a9565d6
KM
57.SH "RETURN VALUE
58A 0, indicating success, is always returned.
c579fd7e 59.SH "SEE ALSO"
8a9565d6 60gprof(1), setitimer(2), monitor(3)