Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

gprof(1)

setitimer(2)

monitor(3)

profil(2)

Name

profil − 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 multiplied 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, 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 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 memory fault. 

See Also

gprof(1) (for VAX only), setitimer(2), monitor(3)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026