Starts and stops program address sampling for execution profiling.
Standard C Library (libc.a)
void profil ( ShortBuffer, BufferSize, Offset, Scale)
OR
void profil ( ProfBuffer, -1, 0, 0)
unsigned short *ShortBuffer;
struct prof *ProfBuffer;
unsigned int Buffersize, Scale;
unsigned long Offset;
The profil subroutine arranges to record a histogram of periodically sampled values of the calling process program counter. If BufferSize is not -1:
Octal | Hex | Meaning |
---|---|---|
0177777 | 0xFFFF | Maps approximately each pair of bytes in the instruction space to a unique short in the ShortBuffer parameter. |
077777 | 0x7FFF | Maps approximately every four bytes to a short in the ShortBuffer parameter. |
02 | 0x0002 | Maps all instructions to the same location, producing a noninterrupting core clock. |
01 | 0x0001 | Turns profiling off. |
00 | 0x0000 | Turns profiling off. |
If the value of the BufferSize parameter is -1:
caddr_t p_low; caddr_t p_high; HISTCOUNTER *p_buff; int p_bufsize; uint p_scale;
If the p_scale member has the value of -1, a value for it is computed based on p_low, p_high, and p_bufsize; otherwise p_scale is interpreted like the scale argument in the first synopsis. The p_high members in successive structures must be in ascending sequence. The array of structures is ended with a structure containing a p_high member set to 0; all other fields in this last structure are ignored.
The p_buff buffer pointers in the array of prof structures must point into a single contiguous buffer space.
In every case:
The profil subroutine always returns a value of 0. Otherwise, the errno global variable is set to indicate the error.
The profil subroutine is unsuccessful if one or both of the following are true:
The exec (exec: execl, execle, execlp, execv, execve, execvp, or exect Subroutine) subroutines, fork (fork, f_fork, or vfork Subroutine) subroutine, moncontrol (moncontrol Subroutine) subroutine, monitor (monitor Subroutine) subroutine, monstartup (monstartup Subroutine) subroutine.
The prof command.