Unix |
Unix v6 |
|
![]() |
monitor(3) |
![]() |
monitor prepare execution profile monitor(lowpc, highpc, buffer, bufsize)
int lowpc( ), highpc( ), buffer[ ], bufsize; is an interface to the system’s profile entry (II). and are the names of two functions; is the address of a (user supplied) array of integers. arranges for the system to sample the user’s program counter periodically and record the execution histogram in the buffer. The lowest address sampled is that of and the highest is just below For the results to be significant, especially where there are small, heavily used routines, it is suggested that the buffer be no more than a few times smaller than the range of locations sampled. To profile the entire program, it is sufficient to use |
extern etext; |
|
... |
||
monitor(2, &etext, buf, bufsize); is a loader-defined symbol which lies just above all the program text. To stop execution monitoring and write the results on the file use |
||
monitor(0); Then, when the program exits, prof (I) can be used to examine the results. It is seldom necessary to call this routine directly; the option of is simpler if one is satisfied with its default profile range and resolution. mon.out prof (I), profil (II), cc (I) |
![]() |
monitor(3) | ![]() |