Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
SysMonitor


NAME

SysMonitor - execution time profiler

SYNOPSIS

PROCEDURE Start;
PROCEDURE Stop(s: Streams.Stream);

DESCRIPTION

SysMonitor is a system-dependant module that allows to generate an execution time profile that is based on profil(2).

During its initialization, a profil(2) buffer is allocated that is as large as the text segment. A profil(2) buffer consists of unsigned 16-bit counters. When profiling starts, the operating system increments on each clock tick the counter within the buffer that corresponds to the currently executed instruction. If a program runs for a sufficient number of clock ticks, the resulting statistics gives a rough impression how much time is spent within each procedure.

Start initializes the entire profil(2) buffer to zeroes and starts profiling.

Stop stops profiling and prints the resulting statistics to the given stream. An output line is generated for each procedure with at least one non-zero counter in the following format: Some optional spaces followed by a whole positive number, followed by one space and a qualified procedure name (module and procedure name, separated by a dot). The order of the output lines depends only of the order of modules and procedures within the SysModules data structure.

SEE ALSO

profil(2)
Execution time profiling interface of UNIX.
SysModules
Data structure
SysSegments
The segment with number 0 of SysSegments is considered to be the text segment.

BUGS

Ambiguities caused by multiple procedures with the same name within the same module cannot be resolved.

SysMonitor is not yet prepared for dynamically loaded modules.


Edited by: borchert, last change: 2005/08/25, revision: 1.1, converted to HTML: 2005/08/25

Oberon || Library || Module Index || Search Engine || Definition || Module