profil(2)profil(2)Nameprofil - execution time profile
Syntax
void profil(buff, bufsiz, offset, scale)
char *buff;
int bufsiz, offset, scale;
Description
The buff points to an area of core whose length (in bytes) is given by
bufsiz. After this call, the user's program counter (pc) is examined
each clock tick (on RISC machines, 4 milliseconds; on VAX machines, 10
milliseconds); offset is subtracted from the pc, and the result is mul‐
tiplied by scale. If the resulting number corresponds to a word inside
buff, that word is incremented.
The scale is interpreted as an unsigned, fixed-point fraction with
binary point at the left: 0x10000 gives a 1-1 mapping of program
counter's to words in buff; 0x8000 maps each pair of instruction words
together. 0x2 maps all instructions onto the beginning of buff, pro‐
ducing 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
execve is executed, but remains on in both child and parent after a
fork. Profiling is turned off if an update in buff would cause a mem‐
ory fault.
See Alsogprof(1) (for VAX only), setitimer(2), monitor(3)profil(2)