SALINFO_DECODE(8)

NAME
salinfo_decode - decode Itanium SAL error records

SYNOPSIS
salinfo_decode [-d] -t type -D directory
salinfo_decode [-d] filename

DESCRIPTION
salinfo_decode extracts and decodes CMC/CPE/MCA/INIT records from SAL. It can decode a saved record from a file, or it can request records from the kernel, decode them, save the raw and decoded records, and clear them from SAL.

  OPTIONS

-d  Each -d increments the debug level.

-t type
    Specifies the type of record to monitor. Must be one of "cmc", "cpe", "mca", or "init" in lower case. The type is used as the third qualifier to access /proc/sal/type/{event,data}.

-D directory
    Specifies the directory where the raw records and the decoded text will be written. The raw record is written to directory/raw, the decoded text is written to directory/decoded. The filenames are constructed from the record timestamp (year, month, day, hours, minutes, seconds), the record type, the cpu number and a suffix starting at '.0' to separate multiple events with the same timestamp.

If either type or directory is specified, then both are required. If neither is supplied, then a filename must be supplied.

  OPERATION
When type and directory are supplied, salinfo_decode will open /proc/sal/type/event and wait until the kernel supplies the number of a cpu that has a record of this type. salinfo_decode then :-

*   Reads the record from the kernel.
*   Extracts the timestamp.
*   Generates a unique filename from the timestamp, type, and cpu number.
*   Writes the raw record to directory/raw.
*   Decodes the raw record into directory/decoded, calling salinfo_decode_oem to decode any OEM data as required (only if salinfo_decode_oem exists).
*   Clears the record from SAL.
*   Waits for another record of this type.

When only a filename is specified, salinfo_decode assumes it is a raw record, reads it, and decodes it without invoking SAL.

  OEM DATA
The Itanium SAL specification defines the overall structure of SAL error records, but the records may contain platform-specific information. To decode platform-specific OEM data, salinfo_decode attempts to invoke a program called salinfo_decode_oem. If that program does not exist, or it exists but does not decode the OEM data, the OEM data is printed in hex. salinfo_decode_oem is invoked with the same file descriptors as salinfo_decode. In particular, both programs can access the file descriptor used to read the raw record.

Communication between salinfo_decode and salinfo_decode_oem is via a pair of pipes, which salinfo_decode_oem sees as file descriptors 0 and 1. To decode OEM data, salinfo_decode writes this data to salinfo_decode_oem via a pipe :-

*   A line of "==== salinfo_decode_oem start ====".
*   A variable number of lines of the form "key=value". salinfo_decode_oem must ignore keys that it does not recognise. At a minimum, values must be supplied for these keys :-
    -   fd_data - file descriptor for accessing the raw record.
    -   use_sal - 1 if the raw record is being accessed via SAL.
    -   cpu - the cpu that the record belongs to, -1 for records that are not being read directly from SAL.
    -   raw_length - the length of the raw record.
    -   oem_section_offset - the offset of the section containing the OEM data to decode.
*   A line of "==== salinfo_decode_oem record ====".
*   The raw record, exactly raw_length bytes, followed by a newline.
*   A line of "==== salinfo_decode_oem end ====".

salinfo_decode_oem reads the above data on fd 0, decodes the OEM data if possible and writes the decoded output on its fd 1. Output from salinfo_decode_oem consists of :-

*   A line of "==== salinfo_decode_oem start ====".
*   The decoded OEM data. If salinfo_decode_oem cannot decode this OEM data, it returns no data here, and salinfo_decode will print the OEM data in hex.
*   A line of "==== salinfo_decode_oem end ====".