PREVIOUS

Program Surveillance

Monitor Call Instruction
C6, which must be a data key, defines which classes of the monitor call instruction are to be enabled. The monitor mask bits are the low order 16 bits of the data key, which correspond to monitor classes 0 to 15, respectively. If a bit is one then the corresponding class is enabled and a monitor call instruction specifying that class will cause a trap. The rest of the data key is reserved and must be zero.

Program Event Recording (PER)
C7 through C9 control program event recording if bit P in C4 is on. Otherwise, they do not influence the process in the domain.

Figure 2-13

The right 48 bits of the values of the data keys in C7 and C8 define the program events in BISG (successful branch, instruction completion, storage alteration, and general register alteration respectively), the start address in ssss ..., and the end address in eeee ... For further information see the Program Event Recording section of IBM System/370 Principles of Operation.

When a program event occurs, C9 receives a data key. The low six bytes of data contain, in the high two bytes, the PER code (returned in locations 150 and 151 by the 370 hardware) and, in the low four bytes, the PER address (returned in locations 152 through 155 by the 370 hardware). The rest of the data key is unspecified.

When a program event occurs, the trap code for the event, as well as other possible simultaneous traps, is placed in C5. See the section in this chapter entitled, "Trapping".

Programming note: The PER facilities as they appear to the KeyKOS user are transformed somewhat from how they are described in the IBM System/370 Principles of Operation. A program event detected in the execution of an instruction causes setting of C9 and the PER bit in the trap code only once per (conceptual) execution of the instruction. This setting occurs after the event has occurred and before any new instruction in that domain has started. (It may occur before the end of execution of the instruction that produced the event.) Thus, the instruction fetch event may not be reported until the instruction concludes.

PER and Key Invocations
An explicit key invocation is the event that occurs in a domain, beginning when the domain executes a CALL, RETURN, or FORK invocation, and ending when the domain is about to execute the next instruction.

For purposes of program event recording, an explicit invocation is treated as an instruction. The instruction fetch event will occur at the end of the instruction just as if the invocation had been an ordinary instruction. If a register is altered and that register is being monitored for alteration, the register alteration event will occur. (FORK invocations do not modify registers.)

Implicit invocations do not cause program events; key invocations do not cause successful branch events.

When the parameter string of the invoked domain is specified by its virtual address, a storage alteration event may occur in the invoked domain. The event will occur only if some portion of the parameter string is being monitored for alteration.

It is implementation dependent whether storage of the byte string in only the portion of the parameter string that is not being monitored causes a program event.

The following detail explains some other side effects of PER and explicit invocations. This detail is necessary only to explain the consequences of using a domain key to a calling domain.

NEXT