The PTRACE macro creates a trace table entry and places it in the system trace table. The entry consists of an event identifier, the contents of a designated range of general registers or storage locations, and system supplied status information.
The PTRACE macro can only be issued with DAT-ON. The caller must be in key 0 and supervisor state but can be in cross memory mode and in either 24 or 31-bit addressing mode. All addresses passed to the PTRACE routine are treated as 31-bit addresses. PTRACE users must include the IHAPSA and IHATRVT mapping macros and register 13 must point to a 72-byte save area that can be used by the PTRACE service.
PTRACE accepts the TRACEMODE=TRACG option to request the use of TRACG to record trace data. This option alters the interpretation of the existing REGS and SAVEAREA options.
The requirements for the caller are:
Environmental factor | Requirement |
---|---|
Minimum authorization: | Supervisor state, key 0 |
Dispatchable unit mode: | Task or SRB |
Cross memory mode: | Any |
AMODE: | 24- or 31-bit |
ASC mode: | Primary |
Interrupt Status: | Enabled or disabled for I/O or external interrupts |
Locks: | Any locks may be held |
Control parameters: | Must be in the primary address space |
The PTRACE macro can only be issued with DAT-ON. All addresses passed to the PTRACE routine are treated as 31-bit addresses. PTRACE users must include the IHAPSA and IHATRVT mapping macros and register 13 must point to a 72-byte save area that can be used by the PTRACE service.
None.
After the caller issues the macro, the macro might use some registers as work registers or might change the contents of some registers. When the macro returns control to the caller, the contents of these registers are not the same as they were before the macro was issued. Therefore, if the caller depends on these registers containing the same value before and after issuing the macro, the caller must save these registers before issuing the macro and restore them after the system returns control.
None.
The PTRACE macro is written as follows:
Syntax | Description |
---|---|
name | name: Symbol. Begin name in column 1. |
␢ | One or more blanks must precede PTRACE. |
PTRACE | |
␢ | One or more blanks must follow PTRACE. |
TYPE=USRn | n: hexadecimal digit 0 - F. |
,REGS=(reg1,reg2) | Default: REGS=(1) |
,REGS=(1) | reg1: decimal digit 2 - 12. |
reg2: decimal digit 2 - 12. | |
,SAVEAREA=STANDARD | |
,SAVEAREA=F4SA | |
,TRACEMODE=TRACE | Default: TRACE |
,TRACEMODE=TRACG | |
The parameters are explained as follows:
If REGS=(reg1,reg2) is specified, the data is located in a range of registers, where reg1 specifies the first register in the range and reg2 specifies the last register in the range. The register number, reg2, must always be greater than or equal to the register number, reg1. A maximum of 11 words of data can be indicated for tracing using REGS=(reg1,reg2).
If REGS=(1) is specified or used as the default, register 1 must contain the 31-bit address of a parameter list. The high order bit of this address must be set to 0. If REGS=(1) is specified, up to 1024 words of data can be recorded. The parameter list contains N+1 fullword entries. The first word contains the number of words of data (N) to be recorded. This is followed by the N words of data to be placed in the user's trace entries.
For TRACEMODE=TRACG this refers to a range of 64-bit registers.
IF F4SA is used, specifies 64-bit GPR 13 contains the address of a 144-byte save area in F4SA format for TRACEMODE=TRACG.
When control returns to the caller, registers 2-13 are restored to their original values, but the original contents of registers 0, 1, 14, and 15 are destroyed. On exit, register 15 contains a return code.
The hexadecimal return code from the PTRACE macro is as follows:
Return Code | Meaning |
---|---|
00 | Meaning: The function completed successfully. |
PTRACE TYPE=USR4,REGS=(5,7),SAVEAREA=STANDARD
PTRACE TYPE=USRC,REGS=(1),SAVEAREA=STANDARD