Program Monitors
- a program that gathers information about a running program is called
a program monitor
- the information produced by a program monitor can vary from a summary
report to an animated visualization
- generally speaking, program visualization is just one method of using
information that a program monitor produces
- most program monitors are based on sequences of events (event streams)
- an event can be almost anything that happens during program execution
Program Monitors
- in this event model of program activity, there is an event source,
ES, that produces events and a report processor, RP, that interprets events:
- this model can be instantiated in many ways; for example as separate
processes connected by a pipe, as a single program, or as threads working
in a common environment; the separation into components is done only to
make the description easier
- the possibility of feedback from RP to ES applies only to certain configurations
Event Reporters
- some event reporters operate in "flight-recorder" mode:
Event Sources
- the event source can take many forms
- one form is instrumentation of the source program:
- instrumentation may be added manually, produced by a preprocessor,
or by source-language constructs inserted by a compiler
- the distinguishing characteristic of this model is that events are
limited to those that can be produced by source-language constructs
- source-code instrumentation increases program size, sometimes dramatically
- it also often affects program behavior and performance
Source-Code Instrumentation
- source-code instrumentation done by hand is error-prone, usually is
work-intensive, and has to be done for every program that is monitored
- hand-done instrumentation can, however, be selective
- source-code instrumentation done by a preprocessor can be applied easily
to different programs
- it is difficult to do selective source-code instrumentation with a
preprocessor
- it is difficult to write a correct and robust preprocessor for most
programming languages
- it is a major undertaking to modify a compiler to insert source-code
instrumentation
- instrumentation can be added to the implementation itself:
- note that in this model, the program itself is not modified
- such instrumentation is not limited to source-language constructs;
it can produce events that are not representable in the source code
- on the other hand, it may not be able to produce events for all source-code
constructs
- implementation instrumentation sometimes can be done in ways that do
not significantly affect program behavior or performance
- producing an instrumenting compiler or instrumented run-time system
is a major effort, both in design and implementation, but once done pays
off in ease of getting event reports for different programs