Standalone Logtool for MPE/iX

FIELD`FORMAT (32,INT,10)
VAR`LABELS [ 1 ] "F1:"
COMMENT " This defines the case variant "1" of
(YET_ANOTHER_TYPE) from the above record "
TAG`ID 1 {This tag is to be used with RECORD`ID 1}
RECORD`LENGTH 32 {Must match length given in FIELD`FORMAT}
RECORD`LABEL
VARIANT [ 2 ] (0)
[ 4 ] (1) {Use this TAG`ID when field 3 of}
{previous TAG`ID has a value of zero}
N`FIELDS 2
FIELD`FORMAT (8,INT,10) (24,junk)
VAR`LABELS [ 1 ] "F2:"
As in the above example, TAG`IDs may be nested. Variants without tags are not supported. Consider the following:
TYPE
some_record = RECORD
case integer of
0 : (f1 : type1);
1 : (f2 : type2);
2 : (f3 : type3);
END;
LOGTOOL
does not know which of the variants to print, since it has no idea which variant the data matches.
RECORD`ID Installation Example
This section describes in detail the process required for LOGTOOL to decode a log entry. Normally, when LOGTOOL is
instructed to display the contents of a system log file, it searches through the LOGTOOL data structures for a
RECORD`ID definition. If a RECORD`ID definition cannot be found, the log entry is displayed based on the
definition located.
For the following example, the log entry will be that of the MPE/iX low-level I/O (LLIO) system which consists of
many software modules called "I/O managers." This log entry has the unique attribute that the record definition is
written in parts. The log entry itself is written in two parts. A main header which displays information common to all
"I/O managers" and a LLIO software dependent portion, which contains information specific to one software module.
The PASCAL declaration for the log entry header information is as follows:
type
io_fixed_rec_type = record
product_name : dac_prodnum_type; { Name: i.e. "HP7933" }
pdev : pdev_str; { Physical path i.e. "1.1.3" }
ldev : ldev_str; { Logical device name }
dev_class_code : shortint; {`ID for DISC, TAPE, etc }
diag_msg_class : bit8; { Indicates HW/SW/OTHER I/O err }
llio_stat : integer; { HPE status }
log_all_retries : boolean; { TRUE if retries not summarized }
retry_again : boolean; { TRUE if log_all_entries&will retry }
io_worked : boolean; { Did I/O finally work ? }
run_autodiag : boolean; { Were Auto diagnostics run? }
retry_count : shortint; { N'th retry OR Total retries }
mgr_port_num : integer; { port number of manager }
tran_num : integer; { transaction number }
hdwr_len : shortint; { # of valid bytes in the HDWR_STAT}
hdwr_stat : hdwr_stat_type; { Hardware status bytes }
end; {io_fixed_rec_type}
io_event_array = packed array [ 1..max_buff_bytes ] of char;
io_var_rec_type = record
data_len : shortint; { # of valid bytes in DATA }
mgr_code : shortint; { Uniquely IDs the mgr }
case boolean of
true : (data : packed array [1..max_event_count] of io_event_array);