File:  [Research Unix] / researchv10dc / dist / man / v4 / manx / mon.3
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:34 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Dan Cross

.th MONITOR III 5/10/73
.sh NAME
monitor \*- prepare execution profile
.sh SYNOPSIS
.ft B
monitor(lowpc, highpc, buffer, bufsize)
.br
int lowpc( ), highpc( ), buffer[ ], bufsize;
.sh DESCRIPTION
.it Monitor
is an interface to the system's profile entry (II).
.it lowpc
and
.it highpc
are the names of two functions;
.it buffer
is the address of a (user supplied)
array of
.it bufsize
integers.
.it Monitor
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
.it lowpc
and the highest is
just below \fIhighpc\fR.
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.
.s3
To profile the entire program,
it is sufficient to use
.s3
	extern etext;
	...
	monitor(2, &etext, buf, bufsize);
.s3
.it etext
is a loader-defined symbol which lies just above all the
program text.
.s3
To stop execution monitoring and write the results
on the file \fBmon.out\fR.
use
.s3
	monitor(0);
.s3
Then, when the program exits, prof (I) can be used
to examine the results.
.sh FILES
mon.out
.sh "SEE ALSO"
prof (I), profil (II)

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.