[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Understanding the Diagnostic Subsystem for AIX

dlog_read

Purpose

Read an entry from the Diagnostic Event Log at the specified offset.

Syntax

#include                <diag/diag_log.h>

dlEntry *dlog_read(dl_info *dlogInfo,int index)

Description

The dlog_read subroutine will read a Diagnostic Event Log entry at the specified offset, which is determined from the index. It will return a pointer to a structure of format:

typedef struct _logEntry {
        char type;                      /* Log Type */
        char identifier[5];             /* Diagnostic Log identifier */
        unsigned int el_identifier;     /* Error log identifier */
        int timestamp;
        unsigned int seqNum;            /* order in which event is logged */
        unsigned int el_seqNum;         /* Error log sequence number */
        unsigned int    session;        /* Diag Session's PID */
        unsigned int    testMode;       /* Diagnostics test mode - hex value*/
        resource_t *res_p;              /* Resource information */
        int resSize;                    /* Size of resource info */
        void *errorInfo;                /* Error information */
        int errorSize;                  /* Size of error info */
} dlEntry;
typedef struct resource {
    char name[NAME_SIZE];
    int locSize;
    char *location;                    /* Logical or Physical               */
    short set;
    short msg;
    char catName[NAME_SIZE];
} resource_t;

Parameters

Parameter Description
dlogInfo Pointer to structure of format:
 typedef struct _log_info {
    int fd;                            /* File descriptor                   */
    int lockId;                        /* ODM Lock id                       */
    dl_att *dlAtt;                     /* Pointer to log attributes         */
    dl_einfo *dlArray;                 /* Pointer to log array              */
} dl_info;

typedef struct _log_einfo {
    int version;                       /* Entry Version                     */
    char logType;                      /* Log Type - I,S,N,E,X              */
    unsigned int size;                 /* Entry Size                        */
    unsigned int offset;               /* Offset from the file's beginning  */
} dl_einfo;

typedef struct _log_att {
    int version;                       /* Version                           */
    unsigned int numEntries;           /* number of log entried             */
    unsigned int lastIndex;            /* index of latest entry             */
    unsigned int nextSeqNum;           /* sequence number of next log entry */
    unsigned int maxLogSize;           /* maximum size of log               */
    unsigned int arrayOffset;          /* array offset                      */
    unsigned int wrapCount;            /* number of times file has wrapped  */
} dl_att;                                                                       
index Index into Diagnostic Event log array for specific entry

Return Value

Upon successful completion, a pointer to dlEntry is returned. Otherwise, a value of NULL is returned.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]