Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ monitor(3C) — A/UX 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

profil(2)

end(3C)

cc(1)

prof(1)




monitor(3C) monitor(3C)
NAME monitor - prepares an execution profile SYNOPSIS #include <mon.h> void monitor(lowpc, highpc, buffer, bufsize, nfunc) int(*lowpc)(), (*highpc)(); WORD *buffer; int bufsize, nfunc; DESCRIPTION An executable program created by cc -p automatically includes calls for monitor with default parameters; monitor needn't be called explicitly except to gain fine control over profiling. monitor is an interface to profil(2). lowpc and highpc are the addresses of two functions; buffer is the address of a (user supplied) array of bufsize elements of type WORD (defined in the <mon.h> header file). monitor arranges to record a histogram in the buffer. This histogram shows periodically sampled values of the program counter and counts of calls of certain functions. The lowest address sampled is that of lowpc; the highest address is just below highpc. lowpc may not equal 0 for this use of monitor. nfunc is the maximum number of call counts that can be kept; only calls of functions compiled with the profiling option -p of cc(1) are recorded. (The C Library and Math Library supplied when cc -p is used also have call counts recorded.) 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((int (*)())2, etext, buf, bufsize, nfunc); etext lies just above all the program text; see end(3C). To stop execution monitoring and write the results on the file mon.out, use monitor ((int (*)())0, 0, 0, 0, 0); prof(1) can then be used to examine the results. FILES mon.out Output file January 1992 1



monitor(3C) monitor(3C)
/lib/libp/libc.a Library file /lib/libp/libm.a Library file SEE ALSO profil(2), end(3C) cc(1), prof(1) in A/UX Command Reference 2 January 1992

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