Record Formats [ User Logging Programmer's Guide ] MPE/iX 5.0 Documentation
User Logging Programmer's Guide
Appendix B Record Formats
Record formats are required for direct access to the logging files by the
user. The following logging record formats indicate where information
resides during the logging process.
Logging Record Format:
record size = 128 words
user area = 119 words
0 2 3 4 6 7 11 12 24 25 127
----------------------------------------------------------------------------
| | | | | | | | | | |
| rec# | cksum | code | time | date | logid | log# | creator | pcb | |
|------|-------|------|------|------|-------|------|---------|-----|-------|
Log Record at OPENLOG
0 2 3 4 6 7 8 9 127
----------------------------------------------------------------------------
| | | | | | | | |
| rec# | cksum | code | time | date | log# | len | user area |
|------|-------|------|------|------|------|-----|-------------------------|
Log Record at WRITELOG
0 2 3 4 6 7 11 12 24 25 127
----------------------------------------------------------------------------
| | | | | | | | | | |
| rec# | cksum | code | time | date | logid |log# | creator | pcb | |
|------|-------|------|------|------|-------|-----|---------|-----|--------|
Log Record at CLOSELOG
0 2 3 4 6 7 127
----------------------------------------------------------------------------
| | | | | | |
| rec# | cksum | code | time | date | |
|------|-------|------|------|------|--------------------------------------|
Crash Mark
0 2 3 4 6 7 11 127
----------------------------------------------------------------------------
| | | | | | | |
| rec# | cksum | code | time | date | logid | |
|------|-------|------|------|------|-------|------------------------------|
Header Record (Start/Restart)
0 2 3 4 6 7 11 127
----------------------------------------------------------------------------
| | | | | | | |
| rec# | cksum | code | time | date | logid | |
|------|-------|------|------|------|-------|------------------------------|
Trailer Record (Stop)
0 2 3 4 6 7 127
----------------------------------------------------------------------------
| | | | | | |
| rec# | cksum | code | time | date | |
|------|-------|------|------|------|--------------------------------------|
Null Record
0 2 3 4 6 7 8 9 127
----------------------------------------------------------------------------
| | | | | | | | |
| rec# | cksum | code | time | date | log# | len | user area |
|------|-------|------|------|------|------|-----|-------------------------|
Begin Transaction Marker
0 2 3 4 6 7 8 9 127
----------------------------------------------------------------------------
| | | | | | | | |
| rec# | cksum | code | time | date | log# | len | user area |
|------|-------|------|------|------|------|-----|-------------------------|
End Transaction Marker
0 2 3 4 6 7 11 12 14
---------------------------------------------------------------------
| | | | | | | seq | | |
| rec# | cksum | code | time | date | logid | num | c-time | c-date |
|------|-------|------|------|------|-------|-----|--------|--------|
15 33 34 52 53 71 72 127
----------------------------------------------------------------------------
| | | | | | | |
| f-file-name | f-type | p-file-name | p-type | c-file-name | c-type | |
|-------------|--------|-------------|--------|-------------|--------|-----|
Log Record at CHANGELOG
Table B-1 lists the code definitions of record formats, and Table B-2
lists the data fields of log records. (Notes for each follow the
tables.)
Table B-1. Code Definition
----------------------------------------------------------------------------------------------
| Code= | # | Definition |
----------------------------------------------------------------------------------------------
| (8:8) | 1 | Open log record |
| | 2 | User/subsystem record |
| | 3 | Close log record |
| | 4 | Header record |
| | 5 | Trailer record |
| | 6 | Restart record |
| | 7 | Continuation of user subsystem record |
| | 9 | Crash marker |
| | 10 | End transaction record |
| | 11 | Begin transaction record |
| | 12 | Change log record (resides in new file; points to old file) |
| | 13 | Change log record (resides in old file; points to new file) |
| | 32 | Null record |
----------------------------------------------------------------------------------------------
| (0:8) | | Subsystem code (can be specified with Privmode only) |
----------------------------------------------------------------------------------------------
Code Definition Notes:
The code in the second byte of Word 3 of each logging record identifies
the type of record. For example, a "1" in the second half of the third
word indicates an OPENLOG record.
Privileged users can define a subsystem code in the first half of the
logging record code word bits (0:8). This code is passed in the index
parameter of the OPENLOG intrinsic.
The null record is used as a filler.
If Code = 12, then p-file-name = previous file in the set and p-file-name
= previous file type in the set.
If Code = 13, then p-file-name = next file in the set and p-file-name =
next file type in the set.
Table B-2. Data Fields of Log Records
--------------------------------------------------------------------------------------------
| Field | Description |
--------------------------------------------------------------------------------------------
| REC# | Double Integer |
| CKSUM | Integer |
| CODE | Integer |
| TIME | Double Integer (from CLOCK intrinsic) |
| DATE | Integer (from CALENDAR intrinsic) |
| LOGID | ASCII |
| LOG# | Integer |
| LEN | Integer |
| USERAREA | ASCII |
| CREATOR | ASCII (Name of user which opened the file) |
| PCB | Integer |
| SEQ NUM | Integer |
| C-DATE | Double Integer |
| C-TIME | Double |
| F-FILE-NAME | ASCII |
| P-FILE-NAME | ASCII |
| C-FILE-NAME | ASCII |
| F-TYPE | Integer |
| P-TYPE | Integer |
| C-TYPE | Integer |
--------------------------------------------------------------------------------------------
Data Fields of Log Records Notes:
The checksum (CKSUM) algorithm uses the Exclusive-Or (XOR) function
against a base of negative one.
The length field (LEN) contains the length passed to WRITELOG, BEGINLOG,
or ENDLOG. If a CONTINUATION record is part of the transaction, that
record will also contain the data length. For example, if a length of
140 (words) is passed to the intrinsic, the LEN field will contain 140.
Since the user area will only accommodate 119 words the remaining 21
words will be stored in the CONTINUATION record. The LEN field of the
CONTINUATION record will indicate the total number of words in the
transaction (140 in this example). A positive number indicates 16-bit
words; a negative number refers to 8-bit bytes.
MPE/iX 5.0 Documentation