profil(2) CLIX profil(2)
NAME
profil - Execution time profile
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
void profil(
char *buff ,
int bufsiz ,
int offset ,
int scale );
PARAMETERS
buff Specifies the address of the first profiling location.
bufsiz Specifies the size in bytes of the profiling buffer.
offset Specifies the base of the range of PCs to profile.
scale Specifies the number of PCs grouped into a single profiling entry.
DESCRIPTION
The profil() function allows a program to obtain a histogram with program
execution locality. The buff variable points to an area of memory whose
length (in bytes) is given by bufsiz. After this call, the user's program
counter (pc) is examined for each clock tick. Then the value of offset is
subtracted from the pc, and the remainder is multiplied by scale. If the
resulting number corresponds to an entry inside buff, that entry is
incremented. An entry is defined as a series of bytes with length
sizeof(short).
The scale is interpreted as an unsigned, fixed-point fraction with binary
point at the left: 0177777 (octal) gives a one-to-one mapping of pc's to
entries in buff; 077777 (octal) maps each pair of instruction entries
together. 02(octal) maps all instructions onto the beginning of buff
(producing a non-interrupting core clock).
Profiling is turned off by giving a scale of 0 or 1. It is rendered
ineffective by giving a bufsiz of 0. Profiling is turned off when an
exec() function is run, but remains on in both child and parent after a
fork() function call. Profiling will be turned off if an update in buff
would cause a memory fault.
EXAMPLES
2/94 - Intergraph Corporation 1
profil(2) CLIX profil(2)
To profile execution of the first 4 kilobytes of a process' text area into
4 separate profiling locations:
short profil_buf[4];
profil(profil_buf, 4 * sizeof(short), text_start, 0100);
RETURN VALUES
Not defined.
RELATED INFORMATION
Commands: prof(1)
Functions: times(2), monitor(3)
2 Intergraph Corporation - 2/94