[AIX 진단 서브시스템 10] 진단 라이브러리 (1) 진단 이벤트 로그 조회 함수와 자료 구조

핵심 정리

  • 진단 라이브러리 /usr/lib/libdiag.a는 관리·사용자 응용 프로그램용 인터페이스(진단 이벤트 로그 함수와 자료 구조)와 진단 응용 프로그램용 인터페이스(ODM, 장치 구성, FRU 버킷, 카탈로그, 메뉴, 장치 속성, 이벤트 로그, 기타)를 담습니다.
  • 진단 이벤트 로그 조회 순서: query_log에 검색 조건을 채우고(쓰지 않는 필드는 0) → dlog_numMatches로 개수를 세거나 dlog_query로 결과(query_results)를 받고 → dlog_query_cleanup으로 메모리를 돌려줍니다.
  • 결과 항목 query_output에는 로그 형식(I, S, N, E, X), 순번, 시각, 세션 PID, 시험 모드(IS_*_MODE 매크로로 해석), 자원 이름·위치와 SRN(dl_srn), 메뉴 목표(dl_menugoal), 파티션(dl_partition), SRC(dl_srn_src) 포인터가 들어 있습니다.
  • 이름, SRN, 메뉴 목표, SRC 조건은 ent*, 651*, BF0*처럼 앞부분만 지정할 수 있습니다. openEvents는 마지막 수리 작업 뒤의 항목만 찾습니다.
  • dl_srn_src의 action_flags는 IS_REPORT_EXTERNALLY·IS_CALL_HOME_REQD로, subsysid와 event_sev는 플랫폼 하위 시스템과 심각도 표로 해석합니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (내용이 같음)
원문 Understanding the Diagnostic Subsystem for AIX — 5.3판 3장(104116쪽), 6.1판 99108쪽
라이브러리 /usr/lib/libdiag.a
헤더 diag/diag_log.h

이 절은 관리 응용 프로그램과 사용자 응용 프로그램을 위한 응용 프로그래밍 인터페이스를 설명합니다. 여기서 설명하는 호출은 진단 라이브러리 /usr/lib/libdiag.a에 들어 있습니다.

사용자 응용 프로그램이 쓸 수 있도록 내보낸 프로그래밍 인터페이스는 다음과 같습니다.

  • 진단 이벤트 로그 함수
  • 진단 이벤트 로그 자료 구조

이 절은 진단 응용 프로그램을 위한 응용 프로그래밍 인터페이스도 설명합니다. 이 호출도 진단 라이브러리 /usr/lib/libdiag.a에 들어 있습니다.

내보낸 프로그래밍 인터페이스 전체는 다음과 같습니다.

  • ODM 객체 클래스 함수
  • 장치 구성
  • FRU 버킷 함수
  • 카탈로그 파일 함수
  • 메뉴 함수
  • 장치 속성, 특성
  • 진단 이벤트 로그 함수
  • 기타

다음 함수를 자세히 설명합니다.

영어 원문

Diagnostic library

This section provides information on application programming interfaces to administrative and user applications. The calls described are contained in the /usr/lib/libdiag.a diagnostic library.

The following is a list of exported programming interfaces available for user applications:

  • Diagnostic Event Log Functions

  • Diagnostic Event Log Data Structures

This section provides information on application programming interfaces to the Diagnostic Applications. The calls described are contained in the /usr/lib/libdiag.a diagnostic library.

The following is a list of all the exported programming interfaces available:

  • ODM Object Class Functions

  • Device Configuration

  • FRU Bucket Functions

  • Catalog File Functions

  • Menu Functions

  • Device Attributes, Properties

  • Diagnostic Event Log Functions

  • Miscellaneous

The following functions are described in detail:

dlog_numMatches 서브루틴

목적

입력한 조건에 맞는 진단 이벤트 로그 항목의 수를 셉니다.

구문

text
#include <diag/diag_log.h>
int dlog_numMatches(query_log *criteria)

설명

dlog_numMatches 서브루틴은 입력한 조건에 맞는 진단 이벤트 로그 항목의 수를 셉니다.

매개변수

매개변수 설명
criteria 진단 이벤트 로그를 검색할 조건. 쓰지 않는 필드는 0으로 설정해야 합니다.
matches 입력 조건에 맞는 항목의 수(원문에 있는 항목이지만 구문에는 이 매개변수가 없습니다)

반환값

값 뜻
0 성공
-1 진단 이벤트 로그를 열 수 없음
-2 진단 이벤트 로그를 읽다가 오류가 남
-3 검색 조건이 올바르지 않음
-4 메모리를 할당할 수 없음
-5 맞는 항목이 너무 많아 오류가 남
영어 원문

dlog_numMatches subroutine

Purpose

Count the number of diagnostic event log for entries matching an input criteria.

Syntax

text
#include <diag/diag_log.h>
int dlog_numMatches(query_log *criteria)

Description

The dlog_numMatches subroutine counts the number of diagnostic event log entries matching an input criteria.

Parameters

  • criteria — Criteria used to search the diagnostic even t log. Unused fields must be set to 0.
  • matches — Count of the number of entries matching the input criteria.

Return Value

The dlog_numMatches subroutine returns one of the following values:

  • 0 — If successful
  • -1 — The diagnostic event log could not be opened
  • -2 — An error occurs reading from the diagnostic event log
  • -3 — The search criteria is invalid
  • -4 — Memory could not be allocated
  • -5 — An error occurred due to too many matches.

dlog_query 서브루틴

목적

입력한 조건에 맞는 항목을 진단 이벤트 로그에서 조회합니다.

구문

text
#include <diag/diag_log.h>
int dlog_query(query_log *criteria, query_results *results)

설명

dlog_query 서브루틴은 입력한 조건에 맞는 항목을 진단 이벤트 로그에서 조회합니다.

매개변수

매개변수 설명
criteria 진단 이벤트 로그를 검색할 조건. 쓰지 않는 필드는 0으로 설정해야 합니다.
results 입력 조건에 맞는 항목 목록의 포인터를 담은 구조체. 항목은 진단 이벤트 로그 순번 순(가장 큰 것부터)으로 정렬해 돌려줍니다.

반환값

값 뜻
0 성공
-1 진단 이벤트 로그를 열 수 없음
-2 진단 이벤트 로그를 읽다가 오류가 남
-3 검색 조건이 올바르지 않음
-4 메모리를 할당할 수 없음
영어 원문

dlog_query subroutine

Purpose

Query the diagnostic event log for entries matching an input criteria.

Syntax

text
#include <diag/diag_log.h>
int dlog_query(query_log *criteria, query_results *results)

Description

The dlog_query subroutine queries the diagnostic event log for entries matching an input criteria.

Parameters

  • criteria — Criteria used to search the diagnostic event log. Unused fields must be set to 0.
  • results — Structure containing a pointer to a list of entries matching the input criteria.Entries are returned sorted by diagnostic event log sequence number (highest first).

Return Value

The dlog_query subroutine returns one of the following values:

  • 0 — If successful
  • -1 — The diagnostic event log could not be opened
  • -2 — An error occurs reading from the diagnostic event log
  • -3 — The search criteria is invalid
  • -4 — Memory could not be allocated

dlog_query_cleanup 서브루틴

목적

진단 이벤트 로그 조회 중 할당한 메모리를 해제합니다.

구문

text
#include <diag/diag_log.h>
int dlog_query_cleanup(query_results *results)

설명

dlog_query_cleanup 서브루틴은 dlog_query를 부르는 동안 할당한 메모리를 회수합니다.

매개변수

매개변수 설명
results 입력 조건에 맞는 항목 목록의 포인터를 담은 구조체

반환값

값 뜻
0 성공
-1 실패
영어 원문

dlog_query_cleanup subroutine

Purpose

Free memory allocated during a diagnostic event log query.

Syntax

text
#include <diag/diag_log.h>
int dlog_query_cleanup(query_results *results)

Description

The dlog_query_cleanup subroutine reclaims memory allocated during calls to dlog_query.

Parameters

  • results — Structure containing a pointer to a list of entries matching the input criteria.

Return Value

The dlog_query_cleanup subroutine returns one of the following values:

  • 0 — If successful
  • -1 — If unsuccessful

dl_fru_src 구조체

dl_fru_src 구조체는 dl_srn_src와 함께 씁니다. 고장을 해결하는 데 필요한 FRU나 절차(Procedure)의 목록을 정의합니다.

dl_fru_src 구조체는 diag_log.h에 다음과 같이 정의되어 있습니다.

text
typedef struct _log_fru_src {
    int  type;
    char priority[2];
    char loc[RPA_LOC_SIZE];
    char frupn[RPA_FRU_PN_SIZE];
    char frusn[RPA_FRU_SN_SIZE_NN];
    char ccin[RPA_CCIN_SIZE_NN];
    char proc_id[RPA_PROC_SIZE];
    struct _log_fru_src *nextfru;
} dl_fru_src;
필드 설명
type FRU 유형(아래 표)
priority FRU 교체·절차 우선순위(아래 표)
loc FRU의 위치 코드
frupn FRU 부품 번호(있으면)
frusn FRU 일련 번호(있으면)
ccin CCIN(있으면)
proc_id 절차 ID(있으면). frupn과 함께 쓰지 않습니다.
next_fru 다음 FRU의 포인터(구조체 정의의 이름은 nextfru)

type 값:

값 뜻
RPA_FRUTYPE_NORMAL 일반 하드웨어 FRU
RPA_FRUTYPE_CODE 절차 ID 필드로 설명하는 코드 FRU
RPA_FRUTYPE_C_PROC 구성 절차가 필요함
RPA_FRUTYPE_M_PROC 유지 보수 절차가 필요함
RPA_FRUTYPE_EXT 외부 FRU
RPA_FRUTYPE_EXT_CODE 절차 ID 필드로 설명하는 외부 코드 FRU
RPA_FRUTYPE_TOOL 목록의 다른 FRU에 필요한 도구
RPA_FRUTYPE_SYMBOL FRU를 구하거나 다루는 절차 ID

priority 값:

값 뜻
H 높은 우선순위이며 반드시 호출(call-out). FRU 교체나 절차 수행이 필수입니다. H 우선순위 호출이 여럿이면 한 묶음으로 처리합니다.
M 중간 우선순위. M 우선순위 FRU·절차는 주어진 순서대로 하나씩 처리합니다.
A 중간 우선순위 묶음 A. A 우선순위 FRU·절차는 한 묶음으로 처리합니다.
B 중간 우선순위 묶음 B. 한 묶음으로 처리합니다.
C 중간 우선순위 묶음 C. 한 묶음으로 처리합니다.
L 낮은 우선순위. 다른 우선순위 호출로 문제가 풀리지 않았을 때만 처리합니다.
영어 원문

dl_fru_src structure

The dl_fru_src structure is used with the dl_srn_src. This structure defines a list of FRUs or Procedures needed to resolve the failure.

The dl_fru_src structure is defined in diag_log.h, as:

text
typedef struct _log_fru_src {
    int  type;
    char priority[2];
    char loc[RPA_LOC_SIZE];
    char frupn[RPA_FRU_PN_SIZE];
    char frusn[RPA_FRU_SN_SIZE_NN];
    char ccin[RPA_CCIN_SIZE_NN];
    char proc_id[RPA_PROC_SIZE];
    struct _log_fru_src *nextfru;
} dl_fru_src;
  • type — FRU type, one of the following: RPA_FRUTYPE_NORMAL - normal Hardware FRU. RPA_FRUTYPE_CODE - code FRU described by procedure id field. RPA_FRUTYPE_C_PROC - configuration procedure required. RPA_FRUTYPE_M_PROC - maintainence procedure required. RPA_FRUTYPE_EXT - external FRU. RPA_FRUTYPE_EXT_CODE - external code FRU described by procedure d field RPA_FRUTYPE_TOOL - a tool required by another FRU in the list. RPA_FRUTYPE_SYMBOL - procedure id for acquiring or working with a FRU.
  • priority — FRU Replacement/Procedure Priority, one of the following: H High priority and mandatory call-out. Replacing the FRU, or performing the Procedure is manadatory. Multiple call-outs with "H" priority should be acted on as a group. M Medium priority. Each FRU/Procedure with "M" priority are should be acted on, one at a time, in the order given. A Medium priority group A. Each FRU/Procedure with "A" priority are should be acted on as a group. B Medium priority group B. Each FRU/Procedure with "B" priority are should be acted on as a group. C Medium priority group C. Each FRU/Procedure with "C" priority are should be acted on as a group. L Low priority. Each FRU/Procedure with "L" priority should be acted on only after all other priority call-outs failed to resolve the problem.
  • loc — Location code of the FRU
  • frupn — FRU Part Number if available
  • frusn — FRU Serial Number if available
  • ccin — CCIN if available
  • proc_id — Procedure Id if available. Mutually exclusive with frupn.
  • next_fru — Pointer to next FRU

dl_partition 구조체

dl_partition 구조체는 query_output 구조체 안에 들어 있으며 diag_log.h에 정의되어 있습니다.

dl_partition 구조체의 정의는 다음과 같습니다.

text
typedef struct _log_partition {
   int version;
   short callHomeFlg;
   int strSize;
   char *name;
   char *id;
   char *hostname;
   char *typeModel;
   char *sn;
   char *dev_typeModel;
   char *dev_sn;
}dl_partition;
필드 설명
version 진단용으로 예약
callHomeFlg 진단용으로 예약
strSize 다음 문자열들을 모두 합친 길이
name 파티션 이름
id 파티션 ID
hostname uname -n으로 얻은 시스템의 호스트 이름
typeModel 기계 유형과 모델
sn 기계 일련 번호
dev_typeModel 고장 난 장치의 유형과 모델
dev_sn 고장 난 장치의 일련 번호
영어 원문

dl_partition structure

The dl_partition structure is contained within the query_output structure. The dl_partition structure is defined in diag_log.h.

The dl_partition structure is defined as:

text
typedef struct _log_partition {
   int version;
   short callHomeFlg;
   int strSize;
   char *name;
   char *id;
   char *hostname;
   char *typeModel;
   char *sn;
   char *dev_typeModel;
   char *dev_sn;
}dl_partition;
  • version — Reserved for diagnostic use.
  • callHomeFlg — Reserved for diagnostic use.
  • strSize — Combined length of all the following strings.
  • name — Partition name.
  • id — Partition id.
  • hostname — The hostname of the system taken from uname -n.
  • typeModel — Machine type and model.
  • sn — Machine serial number.
  • dev_typeModel — Failing device's type and model.
  • dev_sn — Failing device's serial number.

dl_menugoal 구조체

dl_menugoal 구조체는 query_output 구조체 안에 들어 있으며 diag_log.h에 정의되어 있습니다.

dl_menugoal 구조체의 정의는 다음과 같습니다.

text
typedef struct _log_menugoal {
   char *id;
   char *text;
}dl_menugoal;
필드 설명
id 여섯 자리 메뉴 번호
text 번역된 메뉴 목표(menugoal) 텍스트
영어 원문

dl_menugoal structure

The dl_menugoal structure is contained within the query_output structure. The dl_menugoal structure is defined in diag_log.h.

The query_fru structure is defined as:

text
typedef struct _log_menugoal {
   char *id;
   char *text;
}dl_menugoal;
  • id — Six digit menu number.
  • text — Translated menugoal text.

dl_srn 구조체

dl_srn 구조체는 query_output 구조체 안에 들어 있으며 diag_log.h에 정의되어 있습니다.

dl_srn 구조체의 정의는 다음과 같습니다.

text
typedef struct _log_srn {
   char *name;
   char *srn;
   char *errorText;
   query_fru *frus;
}dl_srn;
필드 설명
name SRN의 장치 이름
srn 서비스 요청 번호(Service Request Number)
errorText SRN의 번역된 설명 텍스트
frus SRN의 FRU 목록 포인터
영어 원문

dl_srn structure

The dl_srn structure is contained within the query_output structure. The dl_srn structure is defined in diag_log.h.

The dl_srn structure is defined as:

text
typedef struct _log_srn {
   char *name;
   char *srn;
   char *errorText;
   query_fru *frus;
}dl_srn;
  • name — SRN's device name.
  • srn — The Service Request Number.
  • errorText — SRN's translated description text.
  • frus — Pointer to the SRN's FRU list.

dl_srn_src 구조체

dl_srn_src 구조체는 query_output 구조체 안에 들어 있으며 diag_log.h 헤더 파일에 정의되어 있습니다.

dl_srn_src 구조체의 정의는 다음과 같습니다.

text
typedef struct _log_srn_src {
    char name[NAME_SIZE];
    char src[MAX_SRC_SIZE];
    char *errorText;
    dl_descText frubDesc;
    dl_fru_src *frus;
    char crid[2];
    unsigned int plid;
    unsigned int action_flags;
    unsigned int subsysid;
    unsigned int event_sev;
    unsigned int refc2;
    unsigned int refc3;
    unsigned int refc4;
    unsigned int refc5;
    unsigned int refc6;
    unsigned int refc7;
    unsigned int refc8;
    unsigned int refc9;
} dl_srn_src;
필드 설명
name 오류를 감지한 장치 이름
errorText 고장의 번역된 설명
frubDesc errorText가 가리키는 메시지의 원본 데이터를 담은 구조체입니다(정의는 아래). catName은 메시지 카탈로그 파일 이름, set은 메시지의 세트 ID, msg는 메시지 ID입니다.
frus SRC의 FRU 목록 포인터. dl_fru_src 설명을 봅니다.
crid 플랫폼 오류 로그 작성자(creator) ID
plid 플랫폼 로그 ID
action_flags 이 고장의 보고 동작. 16진 값으로 저장하며, 해석용 매크로는 아래 표와 같습니다.
subsysid 플랫폼 하위 시스템 식별 값(아래 표)
event_sev 플랫폼 이벤트 심각도 값(아래 표)
refc2 - refc9 확장 참조 코드(reference code) 값

frubDesc의 형 dl_descText는 다음과 같습니다.

c
typedef struct _log_descText {
    char catName[NAME_SIZE];
    short set;
    short msg;
} dl_descText;

action_flags를 해석하는 diag_log.h의 매크로:

매크로 1을 돌려주는 경우
IS_REPORT_EXTERNALLY(action_flags) 서비스 포컬 포인트(Service Focal Point) 같은 외부 프로그램에 고장을 보고해야 할 때
IS_CALL_HOME_REQD(action_flags) IBM 서비스에 고장을 자동으로 보고해야 할 때

subsysid 값:

값 하위 시스템
0x10-0x1F 프로세서
0x20-0x2F 메모리
0x30-0x3F I/O
0x40-0x4F I/O 어댑터, 장치, 주변 장치
0x50-0x5F CEC 하드웨어
0x60-0x6F 전원·냉각
0x70-0x79 기타
0x7A-0x7F 감시(Surveillance) 오류
0x80-0x8F 플랫폼 오류
0x90-0x9F 소프트웨어
0xA0-0xAF 외부 환경
0xB0-0xFF 예약

event_sev 값:

값 심각도
0x10 복구된 오류
0x20 예측 오류, 일반
0x21 예측 오류, 성능 저하
0x22 예측 오류, 플랫폼 재IPL 뒤 고쳐질 수 있음
0x23 예측 오류, IPL 뒤 고쳐질 수 있음, 성능 저하
0x24 예측 오류, 중복성 상실
0x40 복구되지 않은 오류, 일반
0x41 복구되지 않은 오류, 우회했으나 성능 저하
0x44 복구되지 않은 오류, 우회했으나 중복성 상실
0x45 복구되지 않은 오류, 우회했으나 중복성과 성능 상실
0x48 복구되지 않은 오류, 우회했으나 기능 상실
0x60 진단 시험 중 오류, 일반
0x61 진단 시험 중 오류, 자원이 잘못된 결과를 낼 수 있음
영어 원문

dl_srn_src structure

The dl_srn_src structure is contained within the query_output structure. The dl_srn_src structure is defined in the diag_log.h header file.

The dl_srn_src structure is defined as:

(20줄짜리 예는 위 한글 본문에 그대로 실었습니다.)

  • name — Device Name that detected the error.
  • errorText — Translated description of the failure.
  • frubDesc — Structure containing the source data for the message pointed to by errorText. typedef struct _log_descText { char catName[NAME_SIZE]; short set; short msg; } dl_descText; catName The message catalog file name. set The set id of the message. msg The message id of the message.
  • frus — Pointer to the SRC's FRU list. See the description of dl_fru_src.
  • crid — Platform error log creator id.
  • plid — Platform Log Id.
  • action_flags — Reporting action for this failure. This is stored as a hex value. The following macros are defined in diag_log.h to decode action_flags: IS_REPORT_EXTERNALLY(action_flags) Returns 1 if the failure should be reported to to external programs, like the Service Focal Point. IS_CALL_HOME_REQD(action_flags) Returns 1 if the failure should be reported automatically to IBM Service.
  • subsysid — Platform subsystem identifier value. The values are: 0x10-0x1F Processor subsystem 0x20-0x2F Memory subsystem 0x30-0x3F I/O subsystem 0x40-0x4F I/O adapter, device and peripheral 0x50-0x5F CEC Hardware 0x60-0x6F Power/Cooling subsystem 0x70-0x79 Other subsystem 0x7A-0x7F Surveillance Error 0x80-0x8F Platform Error 0x90-0x9F Software 0xA0-0xAF External environment 0xB0-0xFF Reserved
  • event_sev — Platform event severity value. 0x10 Recovered error 0x20 Predictive error, general 0x21 Predictive error, degraded performance 0x22 Predictive error, fault may be corrected after platform re-IPL 0x23 Predictive error, fault may be corrected after IPL, degraded performance 0x24 Predictive error, loss of redundancy 0x40 Unrecovered error, general 0x41 Unrecovered error, bypassed with degraded performance 0x44 Unrecovered error, bypassed with loss of redundancy 0x45 Unrecovered error, bypassed with loss of redundancy and performance 0x48 Unrecovered error, bypassed with loss of function 0x60 Error on diagnostic test, general 0x61 Error on diagnostic test, resource may produce incorrect results
  • refc2 - refc9 — Extended reference code values.

query_fru 구조체

query_fru 구조체는 dl_srn 구조체 안에 들어 있으며 diag_log.h에 정의되어 있습니다.

query_fru 구조체의 정의는 다음과 같습니다.

text
typedef struct _log_query_fru {
   char *name;
   int locSize;
   char *locCode;
   char *partNumber;
   char *fruDesc;
   struct _log_query_fru *nextfru;
}query_fru;
필드 설명
name 현장 교체 단위(FRU)의 이름
locSize 위치 코드 문자열의 크기
locCode FRU의 위치 코드(논리 또는 물리)
partNumber FRU의 부품 번호
fruDesc FRU의 번역된 설명 텍스트
nextfru 목록의 다음 FRU 포인터. 마지막 FRU면 NULL입니다.
영어 원문

query_fru structure

The query_fru structure is contained within the dl_srn structure. The query_fru structure is defined in diag_log.h.

The query_fru structure is defined as:

text
typedef struct _log_query_fru {
   char *name;
   int locSize;
   char *locCode;
   char *partNumber;
   char *fruDesc;
   struct _log_query_fru *nextfru;
}query_fru;
  • name — The name of the Field Replacable Unit.
  • locSize — The size of the location code string.
  • locCode — The location code of the FRU (logical or physical).
  • partNumber — The FRU's part number.
  • fruDesc — The FRU's translated description text.
  • nextfru — A pointer to the next FRU in the list. If this is the last FRU, then the pointer is NULL.

query_log 구조체

query_log 구조체는 dlog_query와 dlog_numMatches에 넘겨, 입력 조건에 맞는 항목을 진단 이벤트 로그에서 찾는 데 씁니다. query_log 구조체의 메모리 할당과 올바른 검색 조건 입력은 호출 응용 프로그램의 책임입니다. 이 구조체는 diag_log.h에 정의되어 있습니다.

query_log 구조체의 정의는 다음과 같습니다.

text
typedef struct _log_query_crit {
    char *pathname;             /*Path of diagnostic event log file to search*/
    char type;                  /*Request entries matching a log template*/
    char identifier[5];         /*Request entries matching identifier*/
    char *name;                 /*Request entries matching Resource Name*/
    unsigned int session;       /*Request entries matching Diag Session’s PID*/
    char *location;             /*Pointer to logical or physical location code*/
    unsigned int firstSeqNum;   /*Request entries with this sequence number or
                                  higher*/
    unsigned int lastSeqNum;    /*Request entries with this sequence number or
                                  lower*/
    unsigned int el_identifier; /*Request entries matching this error log
                                  identifier*/
    unsigned int elSeqFirst;    /*Request entires with this error log sequence
                                  number or higher*/
    unsigned int elSeqLast;     /*Request entries with this error log
                                  sequence number or lower*/
    unsigned int numDays;       /*Request entries x number of days backward or
                                  forward*/
    struct tm *startDate;       /*Request entries after this date*/
    struct tm *endDate;         /*Request entries before this date*/
    char *srn;                  /*Request entries matching this SRN*/
    char *mgoal;                /*Request entries matching this menugoal*/
    unsigned int maxEntries;    /*Maximum number of entries to return*/
    char *src;                  /*Request entries matching this SRC*/
    unsigned int openEvents;    /*Request only entries newer than the last
                                  repair action for a given resource. */
    char reserved[100-(sizeof(char*))-(sizeof(unsigned int))];
                                /*Reserved for future use*/
} query_log;
필드 설명
pathname 검색할 진단 이벤트 로그의 경로. 경로를 주지 않으면 기본 경로를 검색합니다.
type 특정 로그 템플릿 유형에 맞는 항목. 올바른 값은 I, S, N, E, X입니다.
identifier 진단 이벤트 로그 식별자에 맞는 항목
name 자원 이름에 맞는 항목. 이름 전체나 일부를 지정할 수 있습니다. 예를 들어 ent*로 하면 ent로 시작하는 장치에 대해 기록된 항목을 돌려줍니다.
session 진단 세션의 프로세스 ID가 든 항목
location 위치 코드가 든 항목
firstSeqNum 이 진단 이벤트 로그 순번 이상인 항목
lastSeqNum 이 진단 이벤트 로그 순번 이하인 항목. 순번 하나로 찾을 때는 firstSeqNum만 씁니다.
el_identifier 이 AIX 오류 로그 식별자인 항목
elSeqFirst 이 AIX 오류 로그 순번 이상인 항목
elSeqLast 이 AIX 오류 로그 순번 이하인 항목. 오류 로그 순번 하나로 찾을 때는 elSeqFirst만 씁니다.
numDays endDate부터 이 일수 이전, startDate부터 이 일수 이후, 또는 현재 날짜·시각부터 이 일수 이전에 기록된 항목을 찾습니다. startDate나 endDate 가운데 하나와 함께 쓸 수 있습니다.
startDate 이 날짜·시각 이후에 기록된 항목을 찾습니다. numDays나 endDate와 함께 쓸 수 있습니다.
srn 이 서비스 요청 번호에 맞는 항목을 찾습니다. 전체나 일부를 지정할 수 있습니다. 예를 들어 651*로 하면 651로 시작하는 SRN이 든 항목을 돌려줍니다.
mgoal 이 메뉴 목표에 맞는 항목을 찾습니다. 전체나 일부를 지정할 수 있습니다. 예를 들어 651*로 하면 메뉴 번호가 651로 시작하는 메뉴 목표가 든 항목을 돌려줍니다.
endDate 이 날짜·시각 이전에 기록된 항목을 찾습니다. numDays나 startDate와 함께 쓸 수 있습니다.
maxEntries 돌려줄 최대 항목 수. 진단 이벤트 로그 순번이 큰 항목을 먼저 돌려줍니다. 0이면 맞는 항목을 모두 돌려줍니다.
src 이 시스템 참조 코드(SRC)에 맞는 항목을 찾습니다. 전체나 일부를 지정할 수 있습니다. 예를 들어 BF0*로 하면 BF0으로 시작하는 SRC가 든 항목을 돌려줍니다.
openEvents 맞는 항목 가운데 해당 자원의 마지막 수리 작업보다 새로운 항목만 찾습니다. 조회에 와일드카드 없는 name 필드도 지정해야 합니다.
reserved 앞으로 쓰려고 예약
영어 원문

query_log structure

The query_log structure is passed into dlog_query and dlog_numMatches to search the diagnostic event log for entries matching an input criteria. The calling application is responsible for allocating memory for the query_log structure and for inputting valid search criteria into the structure. This structure is defined in diag_log.h.

The query_log structure is defined as:

(30줄짜리 예는 위 한글 본문에 그대로 실었습니다.)

  • pathname — Path of the diagnostic event log to search. The default path is searched if no path is provided.
  • type — Specifies entries matching a type of log template. I, S, N, E, and X are the valid values for type.
  • identifier — Specifies entries matching a diagnostic event log identifier.
  • name — Specifies entries matching a resource name. This field can be fully or partially qualified. For example, when name is ent*, entries logged against devices beginning with ent will be returned.
  • session — Specifies entries containing a process ID of a diagnostic session.
  • location — Specifies entries containing a location code.
  • firstSeqNum — Specifies entries with this diagnostic event log sequence number or higher.
  • lastSeqNum — Specifies entries with this diagnostic event log sequence number or lower. When searching on a single sequence number use only firstSeqNum.
  • el_identifier — Specifies entries with this AIX error log identifier.
  • elSeqFirst — Specifies entries with this AIX error log sequence number or higher.
  • elSeqLast — Specifies entries with this AIX error log sequence number or lower. When searching on a single error log sequence number use elSeqFirst only.
  • numDays — Searches the diagnostic event log for entries logged this number of days before endDate, or this number of days after startDate, or this number of days before the current date and time. Valid with either startDate or endDate.
  • startDate — Searches the diagnostic event log for entries logged after this date and time. Valid with either numDays or endDate.
  • srn — Searches the diagnostic event log for entries matching this Service Request Number. This field can be fully or partially qualified. For example, when srn is 651*, entries containing Service Request Number starting with 651 will be returned.
  • mgoal — Searches the diagnostic event log for entries matching this menugoal. This field can be fully or partially qualified. For example, when mgoal is 651*, entries containing menugoals with a menu number starting with 651 will be returned.
  • endDate — Searches the diagnostic event log for entries logged before this date and time. Valid with either numDays or startDate.
  • maxEntries — Specifies a maximum number of entries to return. Entries with higher diagnostic event log sequence numbers have a higher priority to be returned. If maxEntries is 0, then all matching entries are returned.
  • src — The diagnostic event log is searched for entries matching this system reference code (SRC). This field can be fully or partially qualified. For example, when src is BF0*, entries with SRCs beginning with BF0 will be returned.
  • openEvents — The diagnostic event log is searched for matching entries and that are newer than the last repair action for a given resource. The name field, without wild cards, must also be specified in the query.
  • reserved — Reserved for future use.

query_output 구조체

query_output 구조체는 query_log 구조체로 지정한 조건에 맞는 진단 이벤트 로그 항목 하나하나의 정보를 담습니다. 이 구조체들은 dlog_query가 돌려주는 query_results 구조체 안에 들어 있습니다. 항목에 따라 query_output의 일부 필드 정보가 없을 수 있습니다. query_output 구조체는 diag_log.h에 정의되어 있습니다.

query_output 구조체는 다음과 같습니다.

text
typedef struct _log_query_output {
    char type;
    char identifier[5];
    unsigned int el_identifier;
    char *timestamp;
    unsigned int seqNum;
    unsigned int el_seqNum;
    unsigned int session;
    unsigned int testMode;
    char *name;
    char *location;
    dl_srn *srn;
    dl_menugoal *mgoal;
    dl_partition *partition;
    dl_srn_src *srn_src;
    char reserved[100-(sizeof (dl_srn_src *))];
} query_output;
필드 설명
type 항목을 만드는 데 쓴 로그 템플릿 유형. 올바른 값은 I, S, N, E, X입니다.
identifier 진단 이벤트 로그 항목의 식별자
timestamp 진단 이벤트 로그 항목이 기록된 시각의 서식화된 문자열
seqNum 진단 이벤트 로그 항목의 순번
el_seqNum AIX 오류 로그 순번. 진단 이벤트 로그 항목이 AIX 오류 로그 항목과 묶여 있지 않을 수도 있습니다.
session 항목을 만든 진단 세션의 프로세스 ID
testMode 진단 시험 모드. 16진 값으로 저장하며, 해석용 매크로는 아래 표와 같습니다.
name 항목이 기록된 대상 자원의 이름
location 항목이 기록된 대상 자원의 위치 코드
srn SRN 정보의 포인터. SRN이 없으면 NULL입니다.
mgoal 메뉴 목표 정보의 포인터. 메뉴 목표가 없으면 NULL입니다.
partition 파티션 정보의 포인터. 파티션 정보가 없으면 NULL입니다.
reserved 앞으로 쓰려고 예약

testMode를 해석하는 diag_log.h의 매크로:

매크로 1을 돌려주는 경우
IS_CONSOLE_MODE(testMode) 콘솔 모드였으면 1(아니면 콘솔 없음 모드)
IS_ADVANCE_MODE(testMode) 고급 진단 중에 일어난 이벤트면 1(아니면 고객 진단)
IS_NORMAL_BOOT(testMode) 진단이 정상 부팅으로 시작했으면 1(아니면 서비스 부팅)
IS_NETWORK_BOOT(testMode) 진단이 네트워크에서 부팅했으면 1
IS_ELA_MODE(testMode) 오류 로그 분석만 했으면 1
IS_PD_MODE(testMode) 문제 판별(Problem Determination)을 했으면 1(아니면 시스템 검증)
IS_SYSTEM_CHECK(testMode) 시스템 점검(System Checkout)을 했으면 1(아니면 옵션 점검)
IS_LOOP_MODE(testMode) 루프 모드였으면 1
IS_PRETEST_MODE(testMode) 사전 시험(pretest)을 했으면 1
IS_MISSING_MODE(testMode) 빠진 옵션 해결(Missing Options Resolution) 때문에 일어난 이벤트면 1
IS_NEW_MODE(testMode) 새 장치를 시험하다 일어난 이벤트면 1
영어 원문

query_output structure

The query_output structure contains information about individual diagnostic event log entries matching the criteria specified by the query_log structure. These structures are contained within the query_results structure returned by dlog_query. Some entries may not contain information for some of the fields within query_output. The query_output structure is defined in diag_log.h.

The query_output structure is:

(17줄짜리 예는 위 한글 본문에 그대로 실었습니다.)

  • type — Type of log template used to create the entry. I, S, N, E, and X are the valid values for type.
  • identifier — Identifier of the diagnostic event log entry.
  • timestamp — Formatted string of the time at which the diagnostic event log entry was logged.
  • seqNum — Sequence number for the diagnostic event log entry.
  • el_seqNum — AIX error log sequence number. The diagnostic event log entry may not be tied to an AIX error log entry.
  • session — Process id of the diagnostic session that created the entry.
  • testMode — Diagnostics test mode. This is stored as a hex value. The following macros are defined in diag_log.h to decode testMode: IS_CONSOLE_MODE(testMode) Returns 1 when the diagnostic event was in console mode (No-console mode otherwise) IS_ADVANCE_MODE(testMode) Returns 1 when the diagnostic event was caused while running advanced diagnostics (Customer diagnostics otherwise) IS_NORMAL_BOOT(testMode) Returns 1 when the diagnostics booted normally (Service Boot otherwise) IS_NETWORK_BOOT(testMode) Returns 1 when the diagnostics booted from the network IS_ELA_MODE(testMode) Returns 1 when the diagnostic event performed error log analysis only IS_PD_MODE(testMode) Returns 1 when the diagnostic event performed Problem Determination (System Verification otherwise) IS_SYSTEM_CHECK(testMode) Returns 1 when the diagnostic event performed System Checkout (Option Checkout otherwise) IS_LOOP_MODE(testMode) Returns 1 when the diagnostic event was in loop mode IS_PRETEST_MODE(testMode) Returns 1 when the diagnostic event performed a pretest IS_MISSING_MODE(testMode) Returns 1 when the diagnostic event was caused by Missing Options Resolution IS_NEW_MODE(testMode) Returns 1 when the diagnostic event was caused while testing new devices
  • name — Name of the resource the entry was logged against.
  • location — Location code for the resource the entry was logged against.
  • srn — Pointer to SRN information. The pointer will be NULL when there is not an SRN.
  • mgoal — Pointer to menugoal information. The pointer will be NULL when there is not a menugoal.
  • partition — Pointer to partition information. The pointer will be NULL when there is no partition information.
  • reserved — Reserved for future use.

query_results 구조체

query_results 구조체는 dlog_query가 돌려줍니다. 검색 조건에 맞는 항목의 수와 그 항목들의 포인터를 담습니다. query_results 구조체의 메모리 할당은 호출 응용 프로그램의 책임입니다. 이 구조체는 diag_log.h에 정의되어 있습니다.

query_results 구조체의 정의는 다음과 같습니다.

text
typedef struct _log_query_results {
   unsigned int numEntries;
   query_output **entryArray;
}query_results;
필드 설명
numEntries 검색 조건에 맞는 항목의 수
entryArray 검색 조건에 맞는 항목들의 포인터
영어 원문

query_results structure

The query_results structure is returned by dlog_query. This structure contains the number of entries matching the search criteria and a pointer to the entries matching the search criteria. The calling application is responsible for allocating memory for the query_results structure. This structure is defined in diag_log.h.

The query_results structure is defined as:

text
typedef struct _log_query_results {
   unsigned int numEntries;
   query_output **entryArray;
}query_results;
  • numEntries — Number of entries matching the search criteria.
  • entryArray — Pointer to the entries matching the search criteria.