profil(2) DG/UX R4.11MU05 profil(2)
NAME
profil - set up execution time profiling for a process
SYNOPSIS
#include <unistd.h>
void profil (buff, bufsiz, offset, scale)
unsigned short * buff;
unsigned int bufsiz;
unsigned int offset;
unsigned int scale;
where:
buff A pointer to the profiling buffer, an array of bytes in the
user's address space
bufsiz The number of bytes in the profiling buffer
offset The offset by which the profiling program counter (PC) is
adjusted before being multiplied by scale
scale A value by which the PC is multiplied before indexing into
the buffer array
DESCRIPTION
After the profil call, the user's program counter (PC) is examined at
each clock tick. The value of offset is subtracted from the PC, and
the result is multiplied by scale. If the resulting number
corresponds to an entry in buff, that entry is incremented. An entry
is defined as a series of bytes with length equal to sizeof(short).
Scale is interpreted as an unsigned, fixed-point number with the
binary point 16 bits from the right. For a machine whose
instructions are 32 bits in size, 0X8000 gives a 1-1 mapping of
instructions to entries in buff; 0x4000 maps each pair of
instructions together, etc.
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
you call exec(2) but remains on in both the child and parent after a
call to fork(2). Profiling will be turned off if an update in buff
would cause a memory fault.
RETURN VALUE
None.
DIAGNOSTICS
None.
SEE ALSO
exec(2).
Licensed material--property of copyright holder(s)