error_log_get

Purpose

Returns error-log entries.

Syntax


#include     <diag/diag.h>

int  error_log_get ( option, criteria, err_data )
int option;
char  *criteria;
struct errdata *err_data;

Description

The error_log_get subroutine allows the Diagnostic Application (DA) to query the error log for entries.

Implementation Specifics

The NVRAMEL option is only supported on the POWER® processor-based platform:

Parameters

Parameter Description
option Describes the operation to be performed. The following values are defined:
INIT
Initializes error log retrieve.
SUBSEQ
Gets next error-log entry.
TERMI
Ends error log retrieve.
NVRAMEL
Use the NVRAM error log as the source for the error log retrieve. Only the following members of struct errdata are available when the error log is obtained from NVRAM:
  • time_stamp
  • err_id
  • resource
  • detail_data_len
  • detail_data
Note: This option is only supported on the POWER® processor-based platform.
INIT_IGNORE_LRA
Intializes error log retrieval and does not halt when a REPLACED_FRU entry is reached. Also, REPLACED_FRU entries can be returned in the err_data parameter. SUBSEQ calls following an INIT_IGNORE_LRA also do not halt when a REPLACED_FRU entry is reached.
INIT_NEW_ONLY
Initializes error log retrieval and returns the first error log entry matching the criteria that has not been previously analyzed by diagnostics.
SUBSEQ_NEW_ONLY
Gets the next error log entry matching the criteria that has not been previously analyzed by diagnostics.
criteria Used with the INIT option to specify which device to obtain the error log data for and how far back to search. This parameter can be set to any valid option used by the errpt command.

When used with the NVRAMEL option, this can be either a list of resource names (with the -N switch) or an error ID (with the -j switch), but not both.

struct errdata Data type that contains the following data filled in for use by the DA.

struct errdata {
      unsigned   sequence;       /* sequence number of entry  */
      unsigned   time_stamp;     /* entry time stamp  */
      unsigned   err_id;         /* error ID code  */
      char       *machine_id;    /* machine ID  */
      char       *node_id;       /* node  */
      char       *class;         /* H=hardware, S=software  */
      char       *type;          /* PERM,TEMP,PERF,PEND,UNKN  */
      char       *resource;      /* Configured device name  */ 
      char       *vpd_data;      /* VPD info  */
      char       *conn_where;    /* connwhere field of CuDv  */
      char       *location;      /* location field of CuDv  */
      unsigned detail_data_len;  /* length of detail data  */
      char     *detail_data;     /* detail data  */

Return Value

Return values are dependent on the option performed:

Return Value Description
INIT
0
No error
1
Error-log entry available
-1
Error obtaining data
SUBSEQ
0
No more entries available
1
Error-log entry available
0:
TERMI
0
Terminate successful
NVRAMEL
0
No entries matching criteria
1
Error-log entry available
-1
Error accessing NVRAM
-2
Invalid criteria
0:
INIT_IGNORE_LRA
0
No Error
1
Error-log entry available
-1
Error obtaining data
INIT_NEW_ONLY
0
No Error
1
Error-log entry available and no previously analyzed entries were skipped.
2
Error-log entry available and at least one previously analyzed entry was skipped.
SUBSEQ_NEW_ONLY
0
No more entries available
1
Error-log entry available and no previously analyzed entries were skipped.
2
Error-log entry available and at least one previously analyzed entry was skipped.