[AIX 진단 서브시스템 14] 진단 라이브러리 (5) 기타 함수

핵심 정리

  • 프로그램 실행: diag_asl_execute는 ASL 화면 상태를 지키며 fork·exec하고, diag_execute는 ASL 초기화와 무관하게 실행합니다.
  • 확장 오류 데이터(EED): diag_checkstop_eed는 snap -C 결과를 dir/snapC.pax.Z로, diag_general_eed는 snap -H와 diagrpt -a, lsdev -C 결과를 dir/snapH.pax.Z로 모읍니다. diag_checkstop_event는 진단 이벤트가 checkstop 때문인지 판별합니다.
  • 추적: /tmp/.DIAG_TRACE 파일이 있으면 dt()가 /tmp/.dt.<dt_id>에 추적을 씁니다(DIAG_TRACE=APPEND면 덧붙임).
  • error_log_get은 DA가 errpt 조건으로 오류 로그를 INIT → SUBSEQ … → TERMI 순서로 읽게 합니다. _NEW_ONLY 옵션은 진단이 아직 분석하지 않은 항목만 돌려줍니다.
  • DA 입력·변수: getdainput/clrdainput(TMInput), getdavar/putdavar(DAVars 영구 변수), get_DApp(PDiagAtt), getELAdates(ELA용 -s … -e … 문자열), menugoal(고객용 수리 메뉴), schedule_ela(24시간 안에 한 번 ELA 예약).
항목 내용
버전 AIX 5.3, AIX 6.1 (내용이 같음)
원문 Understanding the Diagnostic Subsystem for AIX — 5.3판 3장(162177쪽), 6.1판 153168쪽
라이브러리 /usr/lib/libdiag.a
헤더 diag/diago.h, diag/diag.h, diag/diag_log.h, diag/diag_trace.h, diag/tm_input.h

diag_asl_beep

목적

벨을 울립니다.

구문

text
#include     <diag/diago.h>
long  diag_asl_beep (  )

설명

diag_asl_beep 서브루틴은 벨을 울립니다. 입력이 올바르지 않음을 알리는 데 쓸 수 있습니다.

매개변수

매개변수가 없습니다.

반환값

성공하면 0을 돌려줍니다.

영어 원문

diag_asl_beep

Purpose

Rings the bell.

Syntax

text
#include     <diag/diago.h>
long  diag_asl_beep (  )

Description

The diag_asl_beep subroutine is used to ring the bell. Can be used to indicate that input is not valid.

Parameters

Takes no parameters.

Return Value

Upon successful completion, a value of 0 is returned.

diag_asl_execute

목적

응용 프로그램을 실행합니다.

구문

text
#include          <diag/diago.h>
long  diag_asl_execute ( command, options, exit_status )
char * command ;
char * options ;
int  * exit_status ;

설명

diag_asl_execute 서브루틴은 ASL 인터페이스의 상태를 지키면서 응용 프로그램을 fork하고 실행합니다.

매개변수

매개변수 설명
command 실행할 명령이나 응용 프로그램
options 명령으로 시작하고, 명령 인수가 뒤따르며, NULL로 끝나는 문자 배열
exit_status 명령이 돌려준 종료 상태

반환값

값 뜻
0 성공
DIAG_ASL_FAIL 오류가 남
영어 원문

diag_asl_execute

Purpose

Executes an application.

Syntax

text
#include          <diag/diago.h>
long  diag_asl_execute ( command, options, exit_status )
char * command ;
char * options ;
int  * exit_status ;

Description

The diag_asl_execute subroutine forks and executes an application while preserving the state of the ASL interface.

Parameters

  • command — Command or application to run.
  • options — Character array, starting with the command, followed by any command arguments, ending with a NULL.
  • exit_status — Exit status returned from the command.

Return Value

The following values are returned:

  • 0 — Successful return.
  • DIAG_ASL_FAIL — Error occurred.

diag_checkstop_eed

목적

checkstop 확장 오류 데이터(EED)를 파일로 모읍니다.

구문

c
char *diag_checkstop_eed(char *dir)

설명

diag_checkstop_eed 서브루틴은 입력으로 받은 디렉터리에 확장 오류 데이터(Extended Error Data)를 파일로 모읍니다. 확장 오류 데이터 파일은 snap -C 명령의 출력입니다.

매개변수

매개변수 설명
dir EED 파일을 만들 디렉터리의 절대 경로(최대 200자)

반환값

EED 파일을 만들다 오류가 나면 NULL을 돌려줍니다. 아니면 EED 파일의 절대 이름을 가리키는 포인터를 돌려주며, 이름은 dir/snapC.pax.Z(dir은 입력으로 넘긴 디렉터리) 형식입니다.

영어 원문

diag_checkstop_eed

Purpose

Collect the checkstop Extended Error Data into a file.

Syntax

char *diag_checkstop_eed (char *dir)

Description

The diag_checkstop_eed subroutine collects Extended Error Data into a file in the directory given as input. The Extended Error Data file is the output of the snap -C command.

Parameters

  • dir — Absolute path of the directory to create the EED file, maximum 200 characters.

Return Value

The diag_checkstop_eed subroutine returns one of the following values:

  • NULL — If error creating the EED file, otherwise, pointer to the absolute EED file name that will be in the form of dir/snapC.pax.Z, where dir is the directory passed as input.

diag_checkstop_event

목적

진단 이벤트가 checkstop의 결과인지 판단합니다.

구문

text
#include <diag/diag_log.h>
int diag_checkstop_event (query_output *entry,
                          char *cs_file,
                          unsigned int *cs_file_ts)

설명

diag_checkstop_event 서브루틴은 입력으로 받은 진단 이벤트가 checkstop 때문에 생겼는지 판단합니다. checkstop 뒤에는 오류가 여럿 기록될 수 있으므로, checkstop 스캔 파일 이름과 시각을 호출 루틴에 돌려줘 checkstop 이벤트를 여러 번 보고하는 일을 관리하게 합니다.

매개변수

매개변수 설명
entry 진단 이벤트 로그에서 꺼낸 진단 이벤트
cs_file checkstop 스캔아웃 파일 이름
cs_file_ts checkstop 스캔아웃의 정수 시각

반환값

값 뜻
1 진단 이벤트가 checkstop에서 나옴
0 그 밖의 경우
영어 원문

diag_checkstop_event

Purpose

Determines if the diagnostic event was the result of a checkstop.

Syntax

text
#include <diag/diag_log.h>
int diag_checkstop_event (query_output *entry,
                          char *cs_file,
                          unsigned int *cs_file_ts)

Description

The diag_checkstop_event subroutine will determine if the diagnostic event passed as input was caused by a checkstop. Since multiple errors can be logged following a checkstop, the checkstop scan file name and timestamp are returned to the calling routine for managing multiple reporting of the checkstop event.

Parameters

  • entry — The diagnostic event extracted from the diagnostic event log.
  • cs_file — The checkstop scanout file name.
  • cs_file_ts — The checkstop scanout integer timestamp.

Return Value

The diag_checkstop_event subroutine returns one of the following values:

  • 1 — If the diagnostic event was from a checkstop.
  • 0 — Otherwise

diag_cluster_support ()

목적

현재 시스템이 클러스터 환경의 일부인지 판단합니다.

구문

text
int diag_cluster_support()

설명

diag_cluster_support() 루틴은 클러스터 지원 소프트웨어가 설치되었는지 확인해 이 시스템이 클러스터 환경의 일부인지 추정합니다.

매개변수

매개변수가 없습니다.

반환값

값 뜻
0 클러스터 지원이 설치되지 않음
1 클러스터 지원이 설치됨
영어 원문

diag_cluster_support ()

Purpose

Determines if the current system is part of a clustered environment.

Syntax

text
int diag_cluster_support()

Description

The diag_cluster_support () routine determines if the cluster support software is installed to infer whether this system is part of a clustered environment.

Parameters

None.

Return Value

  • 0 — Cluster support is not installed.
  • 1 — Cluster support is installed.

diag_cpu2proc (int n)

목적

논리 CPU 번호를 물리 프로세서 이름으로 바꿉니다.

구문

text
char *diag_cpu2proc (n)
int n;

설명

diag_cpu2proc 루틴은 논리 CPU 번호를 ODM CuDv 클래스의 물리 프로세서 이름으로 바꿉니다.

참고: 이 서브루틴을 부르기 전에 init_dgodm을 불러야 합니다.

매개변수

매개변수 설명
n 논리 CPU 번호인 정수

반환값

값 뜻
NULL ODM 오류나 올바르지 않은 논리 CPU 번호 같은 오류
procn 물리 프로세서의 CuDv 객체 이름
영어 원문

diag_cpu2proc (int n)

Purpose

Convert logical CPU number to physical processor name.

Syntax

text
char *diag_cpu2proc (n)
int n;

Description

The diag_cpu2proc routine is used to convert a logical CPU number to the physical processor name in ODM CuDv class.

Note: init_dgodm must be called before starting this subroutine.

Parameters

  • n — Integer that is the logical CPU number

Return Value

  • NULL — If error such as ODM error, or invalid logical CPU number.
  • procn — The name of the CuDv object for the physical processor

diag_exec_source

목적

진단이 어디에서 실행되고 있는지 알려 줍니다.

구문

text
int diag_exec_source ( mount_point )
char *mount_point ;

설명

diag_exec_source는 진단 프로그램이 어디에서 실행되는지 판단합니다. 하드 파일(디스크)에서 실행되는 것이 아니면 mount_point에 파일 시스템(CDRFS)이 있는 디렉터리가 들어갑니다.

매개변수

매개변수 설명
mount_point 파일 시스템이 있는 디렉터리 이름을 가리키는 문자 포인터

반환값

값 뜻
0 하드 파일에서 실행 중
1 CD-ROM에서 실행 중
영어 원문

diag_exec_source

Purpose

Returns an indication of where diagnostics is being run from.

Syntax

text
int diag_exec_source ( mount_point )
char *mount_point ;

Description

The diag_exec_source determines where the diagnostics program is run from. If not from hard file, then mount_point contains the directory where the file system resides (CDRFS).

Parameters

  • mount_point — Character pointer to directory name where the file system resides.

Return Value

The diag_exec_source subroutine returns one of the following values:

  • 0 — Running from hardfile.
  • 1 — Running from CD-ROM.

diag_execute

목적

응용 프로그램을 실행합니다. ASL 초기화에 의존하지 않습니다.

구문

text
#include    <diag/diago.h>
long  diag_execute ( command, options, exit_status )
char * command ;
char * options ;>
int  * exit_status ;

설명

diag_execute 서브루틴은 응용 프로그램을 fork하고 실행합니다. ASL 초기화에 의존하지 않으며 ASL 상태를 지키지도 않습니다.

매개변수

매개변수 설명
command 실행할 명령이나 응용 프로그램
options 명령으로 시작하고, 명령 인수가 뒤따르며, NULL로 끝나는 문자 배열
exit_status 명령이 돌려준 종료 상태

반환값

값 뜻
0 성공
-1 오류가 남
영어 원문

diag_execute

Purpose

Executes an application. Does not depend on ASL initialization.

Syntax

text
#include    <diag/diago.h>
long  diag_execute ( command, options, exit_status )
char * command ;
char * options ;>
int  * exit_status ;

Description

The diag_asl_execute subroutine forks and executes an application. This subroutine does not depend on ASL initialization, and it does not preserve the state of ASL.

Parameters

  • command — Command or application to run.
  • options — Character array, starting with the command, followed by any command arguments, ending with a NULL.
  • exit_status — Exit status returned from the command.

Return Value

The following values are returned:

  • 0 — Successful return.
  • -1 — Error occurred.

diag_general_eed

목적

일반 확장 오류 데이터(EED)를 파일로 모읍니다.

구문

c
char *diag_general_eed(char *dir)

설명

diag_general_eed 서브루틴은 입력으로 받은 디렉터리에 확장 오류 데이터를 파일로 모읍니다. 확장 오류 데이터 파일은 snap -H 명령의 출력에 diagrpt -a와 lsdev -C 명령의 출력을 더한 것입니다.

PDiagAtt ODM 객체 클래스 속성 extend_gen_eed로 수집 응용 프로그램을 등록하면 EED에 데이터를 더 모을 수 있습니다. 자세한 내용은 PDiagAtt를 봅니다.

매개변수

매개변수 설명
dir EED 파일을 만들 디렉터리의 절대 경로(최대 200자)

반환값

EED 파일을 만들다 오류가 나면 NULL을 돌려줍니다. 아니면 EED 파일의 절대 이름을 가리키는 포인터를 돌려주며, 이름은 dir/snapH.pax.Z(dir은 입력으로 넘긴 디렉터리) 형식입니다.

영어 원문

diag_general_eed

Purpose

Collects the general Extended Error Data into a file.

Syntax

char *diag_general_eed (char *dir)

Description

The diag_general_eed subroutine collects Extended Error Data into a file in the directory given as input. The Extended Error Data file is the output of the snap -H command, with the addition of the output from the diagrpt -a and the lsdev -C commands.

Additional data can be collected and gathered in the EED by registering a collection application using a PDiagAtt ODM object class attribute extend_gen_eed. For more information, refer to PDiagAtt.

Parameters

  • dir — Absolute path of the directory to create the EED file, maximum 200 characters.

Return Value

The diag_general_eed subroutine returns one of the following values:

  • NULL — If error creating the EED file, otherwise, pointer to the absolute EED file name that will be in the form of dir/snapH.pax.Z, where dir is the directory passed as input.

diag_get_cluster_ms ()

목적

클러스터의 기계 일련 번호를 가져옵니다.

구문

text
char *diag_get_cluster_ms()

설명

diag_get_cluster_ms() 루틴은 클러스터 소프트웨어 명령 lscmtms를 실행해 클러스터의 기계 일련 번호를 가져옵니다. 결과를 해석해 기계 일련 번호를 돌려줍니다.

매개변수

매개변수가 없습니다(원문에는 매개변수 머리가 없습니다).

반환값

값 뜻
NULL 기계 일련 번호를 얻을 수 없음
문자열 기계 일련 번호 값
영어 원문

diag_get_cluster_ms ()

Purpose

Retrieve the machine serial number of the cluster.

Syntax

text
char *diag_get_cluster_ms()

Description

The diag_get_cluster_ms () routine retrieves the machine serial number of the cluster by executing the lscmtms cluster software command. The results are parsed and the machine serial number is returned.

Return Value

  • NULL — The machine serial number is not available.
  • string — Value of the machine serial number..

diag_get_cluster_mt ()

목적

클러스터의 기계 유형·모델을 가져옵니다.

구문

text
char *diag_get_cluster_mt ()

설명

diag_get_cluster_mt() 루틴은 클러스터 소프트웨어 명령 lscmtms를 실행해 클러스터의 기계 유형·모델을 가져옵니다. 결과를 해석해 기계 유형·모델을 돌려줍니다.

매개변수

매개변수가 없습니다.

반환값

값 뜻
NULL 기계 유형·모델을 얻을 수 없음
문자열 기계 유형·모델 값
영어 원문

diag_get_cluster_mt ()

Purpose

Retrieves the machine type/model of the cluster.

Syntax

text
char *diag_get_cluster_mt ()

Description

The diag_get_cluster_mt () routine retrieves the machine type/model of the cluster by executing the lscmtms cluster software command. The results are parsed and the machine type/model is returned.

Parameters

None.

Return Value

  • NULL — Machine type/model is not available.
  • string — Value of machine type/model..

diag_get_fru_serial

목적

주어진 FRU 위치 코드에서 FRU 일련 번호를 얻습니다.

구문

text
int diag_get_fru_serial (char *loc, char **fru_serial)

설명

diag_get_fru_serial 루틴은 주어진 물리 위치 코드의 FRU(현장 교체 단위) 일련 번호를 가져오려 합니다.

참고: 호출 루틴이 ODM(Object Database Manager)을 초기화하고 끝내야 합니다. 진단 라이브러리 루틴 init_dgodm()과 term_dgodm()을 쓸 수 있습니다.

매개변수

매개변수 설명
loc FRU 일련 번호를 얻을 FRU의 물리 위치
fru_serial 찾으면 FRU 일련 번호를 돌려주고, 아니면 NULL로 설정합니다.

반환값

값 뜻
-1 FRU 일련 번호를 가져오다 오류가 남
0 FRU 일련 번호를 찾지 못함
1 FRU 일련 번호를 찾았고 fru_serial이 그것을 가리킴
영어 원문

diag_get_fru_serial

Purpose

Gets the FRU serial number from the given FRU location code.

Syntax

text
int diag_get_fru_serial (char *loc, char **fru_serial)

Description

The diag_get_fru_serial routine attempts to retrieve the FRU (field replaceable unit) serial number for a given physical location code.

Note: The calling routine must initialize and stop the Object Database Manager (ODM). It can use the diagnostic library routines, init_dgodm() and term_dgodm(), respectively.

Parameters

  • loc — Physical location of the FRU to return it's FRU serial number.
  • fru_serial — Returns the FRU serial number if found, otherwise is set to NULL.

Return Value

The diag_get_fru_serial subroutine returns one of the following values:

  • -1 — If there was an error retrieving the FRU serial number.
  • 0 — If the FRU serial number is not found.
  • 1 — If the FRU serial number was found, and fru_serial now points to the FRU serial number.

dt

목적

진단 추적 정보를 파일에 씁니다.

구문

text
#include     <diag/diag_trace.h>
void dt ( dt_id, dt_type [,val, ...] )
char * dt_id ;
int  dt_type;

설명

dt 서브루틴은 추적 정보를 파일에 쓸 수 있게 합니다. /tmp/.DIAG_TRACE 파일이 있으면 dt_id 인수가 지정하는 파일에 추적 정보를 씁니다. 기본은 기존 추적 정보를 덮어쓰며, 추적 파일에 덧붙이려면 DIAG_TRACE=APPEND를 export합니다.

매개변수

매개변수 설명
dt_id 추적 파일을 고유하게 구별하는 데 씁니다. 추적 파일은 /tmp 디렉터리의 .dt.<dt_id>가 됩니다.
dt_type 수행할 추적 기능의 유형(아래 표)
val 가변 인수. 추적할 여러 변수의 개수, 추적 레이블, 추적할 정보가 들어갈 수 있습니다.

dt_type 값

값 뜻
DT_TMI 진단 응용 프로그램(DA)용 추적 초기화. TMInput 구조체의 정보를 추적 파일에 씁니다.
DT_BEGIN 서비스 보조(SA)용 추적 초기화
DT_DEC 정수 변수 하나를 10진으로
DT_MDEC 정수 변수 여럿을 10진으로
DT_HEX 정수 변수 하나를 16진으로
DT_MHEX 정수 변수 여럿을 16진으로
DT_LDEC long 정수 변수 하나를 10진으로
DT_MLDEC long 정수 변수 여럿을 10진으로
DT_LHEX long 정수 변수 하나를 16진으로
DT_MLHEX long 정수 변수 여럿을 16진으로
DT_MSTR 문자열 변수 여럿
DT_MSG "hello." 같은 간단한 메시지
DT_BUFF 데이터 버퍼
DT_SCSI_TUCB SCSI TUCB 구조체 정보
DT_SCSI_TUCB_SD SCSI TUCB 감지(Sense) 데이터 정보
DT_END 추적 파일에 "end of trace" 식별자를 씀

반환값

반환 코드가 없습니다.

영어 원문

dt

Purpose

Writes diagnostic trace information to a file.

Syntax

text
#include     <diag/diag_trace.h>
void dt ( dt_id, dt_type [,val, ...] )
char * dt_id ;
int  dt_type;

Description

The dt subroutine allows trace information to be written to a file. If the file /tmp/.DIAG_TRACE exists, trace information is written to a file specified by the dt_id argument. The default is to overwrite existing trace information. To append to the trace file, export DIAG_TRACE=APPEND.

Parameters

  • dt_id — Used to uniquely identify the trace file. The resulting trace file will be called .dt.'dt_id' in the /tmp directory.
  • dt_type — The type of trace function to perform. DT_TMI Trace initialization for Diagnostic Applications (DA). Information from the TMInput structure will be written to the trace file. DT_BEGIN Trace initialization for Service Aids (SA). DT_DEC Trace an integer variable in decimal. DT_MDEC Trace multiple integer variables in decimal. DT_HEX Trace an integer variable in hexadecimal. DT_MHEX Trace multiple integer variables in hexadecimal. DT_LDEC Trace a long integer variable in decimal. DT_MLDEC Trace multiple long integer variables in decimal. DT_LHEX Trace a long integer variable in hexadecimal. DT_MLHEX Trace multiple long integer variables in hexadecimal. DT_MSTR Trace multiple string variables. DT_MSG Trace a simple message such as "hello." DT_BUFF Trace a data buffer. DT_SCSI_TUCB Trace SCSI TUCB structure information. DT_SCSI_TUCB_SD Trace SCSI TUCB Sense Data information. DT_END Write "end of trace" identifier to the trace file.
  • val — Variable arguments which may include the number of multiple variables to trace, the trace labels, and the information to trace.

Return Value

There is no return code.

error_log_get

목적

오류 로그 항목을 돌려줍니다.

구문

text
#include     <diag/diag.h>
int  error_log_get ( option, criteria, err_data )
int option ;
char  * criteria ;
struct errdata * err_data ;

설명

error_log_get 서브루틴은 진단 응용 프로그램(DA)이 오류 로그 항목을 조회하게 합니다.

구현 특성

NVRAMEL 옵션은 POWER 프로세서 기반 플랫폼에서만 지원합니다.

매개변수

매개변수 설명
option 수행할 작업(아래 표)
criteria INIT 옵션과 함께 써서 어느 장치의 오류 로그 데이터를 얼마나 거슬러 찾을지 지정합니다. errpt 명령의 올바른 옵션은 무엇이든 쓸 수 있습니다. NVRAMEL 옵션과 함께 쓰면 자원 이름 목록(-N 스위치)이나 오류 ID(-j 스위치) 가운데 하나만 쓸 수 있고 둘 다는 안 됩니다.
err_data DA가 쓰도록 다음 데이터를 채워 주는 struct errdata 형(아래 정의)

option 값

값 뜻
INIT 오류 로그 가져오기를 초기화합니다.
SUBSEQ 다음 오류 로그 항목을 가져옵니다.
TERMI 오류 로그 가져오기를 끝냅니다.
NVRAMEL NVRAM 오류 로그를 가져오기의 원본으로 씁니다. 오류 로그를 NVRAM에서 얻을 때는 struct errdata 가운데 time_stamp, err_id, resource, detail_data_len, detail_data만 쓸 수 있습니다. POWER 프로세서 기반 플랫폼에서만 지원합니다.
INIT_IGNORE_LRA 오류 로그 가져오기를 초기화하되 REPLACED_FRU 항목을 만나도 멈추지 않습니다. REPLACED_FRU 항목도 err_data로 돌려받을 수 있습니다. INIT_IGNORE_LRA 뒤의 SUBSEQ 호출도 REPLACED_FRU 항목에서 멈추지 않습니다.
INIT_NEW_ONLY 오류 로그 가져오기를 초기화하고, 조건에 맞으면서 진단이 아직 분석하지 않은 첫 오류 로그 항목을 돌려줍니다.
SUBSEQ_NEW_ONLY 조건에 맞으면서 진단이 아직 분석하지 않은 다음 오류 로그 항목을 가져옵니다.

struct errdata 정의:

c
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 */

반환값

반환값은 수행한 옵션에 따라 다릅니다.

옵션 반환값
INIT 0 오류 없음, 1 오류 로그 항목 있음, -1 데이터를 얻다 오류가 남
SUBSEQ 0 항목이 더 없음, 1 오류 로그 항목 있음
TERMI 0 끝내기 성공
NVRAMEL 0 조건에 맞는 항목 없음, 1 오류 로그 항목 있음, -1 NVRAM 접근 오류, -2 조건이 올바르지 않음
INIT_IGNORE_LRA 0 오류 없음, 1 오류 로그 항목 있음, -1 데이터를 얻다 오류가 남
INIT_NEW_ONLY 0 오류 없음, 1 오류 로그 항목이 있고 이미 분석한 항목을 건너뛰지 않음, 2 오류 로그 항목이 있고 이미 분석한 항목을 적어도 하나 건너뜀
SUBSEQ_NEW_ONLY 0 항목이 더 없음, 1 오류 로그 항목이 있고 이미 분석한 항목을 건너뛰지 않음, 2 오류 로그 항목이 있고 이미 분석한 항목을 적어도 하나 건너뜀
영어 원문

error_log_get

Purpose

Returns error-log entries.

Syntax

text
#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

  • 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:

  • 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.

file_present

목적

파일 시스템에 파일이 있는지 나타내는 상태를 돌려줍니다.

구문

text
int  file_present ( filename )
char *filename ;

설명

file_present 서브루틴은 파일이 있는지 판단합니다.

매개변수

매개변수 설명
filename 파일의 전체 경로 이름을 가리키는 문자 포인터

반환값

값 뜻
0 파일이 없음
1 파일이 있음
영어 원문

file_present

Purpose

Returns status indicating whether the file is present on the file system.

Syntax

text
int  file_present ( filename )
char *filename ;

Description

The file_present subroutine determines the presence of a file.

Parameters

  • filename — Character pointer to full path name of file.

Return Value

The file_present subroutine returns one of the following values:

  • 0 — File is not present.
  • 1 — File is present.

get_DApp

목적

PDiagAtt 객체 클래스에 나타난, 장치에 연결된 DApp 값을 돌려줍니다.

구문

text
char *get_DApp ( devicename, attribute )
char *devicename ;
char *attribute ;

설명

get_DApp 서브루틴은 주어진 장치와 속성에 연결된 PDiagAtt 객체 클래스의 DApp 값을 돌려줍니다. 검색 조건의 순서는 다음과 같습니다.

  1. DClass, DSClass, DType, attribute
  2. DClass, DSClass, attribute
  3. DClass, attribute

돌려준 값에 할당한 저장 공간의 해제는 호출 응용 프로그램의 책임입니다.

매개변수

매개변수 설명
devicename 장치의 사용자 정의(customized) 이름을 가리키는 문자 포인터
attribute 장치에 연결된 속성을 가리키는 문자 포인터

반환값

값 뜻
char * NULL 장치와 속성을 찾지 못함
char *DApp DApp 값이 든 문자열의 포인터
영어 원문

get_DApp

Purpose

Returns the DApp value associated with device as represented in the PDiagAtt object class.

Syntax

text
char *get_DApp ( devicename, attribute )
char *devicename ;
char *attribute ;

Description

The get_DApp subroutine returns the DApp value from the PDiagAtt object class associated with the given device and attribute. Search criteria is in the following order:

  1. DClass and DSClass and DType and attribute

  2. DClass and DSClass and attribute

  3. DClass and attribute

The calling application is responsible for freeing the storage allocated for the returned value.

Parameters

  • devicename — Character pointer to customized name of device.
  • attribute — Character pointer to attribute associated with device.

Return Value

The get_DApp subroutine returns one of the following values:

  • char * NULL — Device and attribute is not found.
  • char *DApp — Pointer to char string containing DApp value.

getdainput, clrdainput

목적

진단 응용 프로그램(DA)의 입력을 가져오거나 지웁니다.

구문

text
#include    <diag/tm_input.h>
int getdainput ( tm_input )
struct tm_input * tm_input ;
int clrdainput ( )

설명

getdainput 서브루틴은 TMInput 객체 클래스에서 DA의 입력을 가져옵니다. clrdainput 서브루틴은 TMInput 객체 클래스를 지웁니다.

매개변수

매개변수 설명
tm_input 데이터를 써 넣을 구조체의 포인터

반환값

성공하면 0을, 아니면 -1을 돌려줍니다.

영어 원문

getdainput, clrdainput

Purpose

Gets and clears the input for the Diagnostic Application (DA).

text
#include    <diag/tm_input.h>
int getdainput ( tm_input )
struct tm_input * tm_input ;
int clrdainput ( )

Description

The getdainput subroutine gets the input for the DA from the TMInput object class. The clrdainput subroutine clears the TMInput object class.

Parameters

  • tm_input — Pointer to the structure where the data should be written.

Return Value

Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned.

getdavar, putdavar

목적

영구 변수를 가져오고 저장합니다.

구문

text
#include    <diag/diag.h>
int getdavar ( dname , vname , vtype , val )
char  * dname , * vname , * val ;
unsigned short vtype ;
int putdavar ( dname , vname , vtype , val )
char  * dname , * vname , * val ;
unsigned short vtype ;

설명

getdavar 서브루틴은 진단 응용 프로그램 변수(DAVars) 객체 클래스에서 영구 변수 vname을 가져옵니다. putdavar 서브루틴은 지정한 값을 저장합니다.

매개변수

매개변수 설명
dname 변수가 연결된 장치 이름
vname 변수 이름
vtype 변수 유형. DIAG_STRING 문자열로 다룸, DIAG_INT 정수로 다룸, DIAG_SHORT short로 다룸
val getdavar를 부를 때는 변수를 써 넣을 위치이고, 그 밖에는 저장할 값을 가리킵니다.

반환값

성공하면 0을, 아니면 -1을 돌려줍니다.

영어 원문

getdavar, putdavar

Purpose

Gets and puts persistent variables.

Syntax

text
#include    <diag/diag.h>
int getdavar ( dname , vname , vtype , val )
char  * dname , * vname , * val ;
unsigned short vtype ;
int putdavar ( dname , vname , vtype , val )
char  * dname , * vname , * val ;
unsigned short vtype ;

Description

The getdavar subroutine gets the persistent variable vname from the Diagnostic Application Variables object class. The putdavar subroutine is used to save the specified value.

Parameters

  • dname — Name of the device with which the variable is associated.
  • vname — Name of the variable.
  • vtype — Type of the variable. The following values are defined: DIAG_STRING The variable should be treated as a character string. DIAG_INT The variable should be treated as an integer. DIAG_SHORT The variable should be treated as a short.
  • val — Location where the variable should be written when the subroutine getdavar is called. Otherwise, val points to the value to be saved.

Return Value

Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned.

getELAdates

목적

오류 로그 항목을 가져올 시작·끝 시각을 돌려줍니다.

구문

text
char *getELAdates ( notRTOmode )
int notRTOmode ;

설명

getELAdates 서브루틴은 오류 로그 분석(ELA)에 쓸 시작·끝 시각이 든 문자열을 서식화해 돌려줍니다. 끝 시각은 현재 날짜와 시각입니다. 시작 시각은 실행 시간 옵션(run time options)의 사용자 정의 진단 속성(CDiagAtt) 값이나 매개변수로 넘긴 값으로 만듭니다. 돌려준 문자열은 TMInput 객체 클래스의 date 매개변수와 같은 구실을 합니다.

참고: 이 서브루틴을 부르기 전에 init_dgodm을 불러야 합니다.

매개변수

매개변수 설명
notRTOmode ELA 일수의 실행 시간 옵션 값을 어떻게 쓸지 정합니다. 0이면 실행 시간 옵션의 CDiagAtt에 지정된 ELA 일수로 시작 시각을 만들고, 0보다 크면 notRTOmode 값을 ELA 일수로 써서 시작 시각을 만듭니다.

반환값

다음 문자열을 돌려줍니다.

text
-s MMddhhmmyy -e MMddhhmmyy
자리 뜻
MM 두 자리 월(원문에 설명 없음)
dd 두 자리 일
hh 24시간 형식의 두 자리 시
mm 두 자리 분
yy 두 자리 연도
영어 원문

getELAdates

Purpose

Return the start and end timestamp for retrieving error log entries.

Syntax

text
char *getELAdates ( notRTOmode )
int notRTOmode ;

Description

The getELAdates subroutine formats and returns a string containing the start and end timestamp that should be used for error log analysis. The end timestamp is the current date and time. The start timestamp is created using either the value specified by the Customized Diagnostic Attribute for run time options, or the value passed as a parameter. The string returned serves the same purpose as the date parameter of the TMInput object class.

Note: init_dgodm must be called before starting this subroutine.

Parameters

notRTOmode

Determines how the run time option value for the number of ELA days is used. If notRTOmode is 0, then the number of ELA days specified by the Customized Diagnostic Attribute for run time options is used to create the start timestamp. If notRTOmode is greater than 0, then the notRTOmode value is used as the number of ELA days when creating the start timestamp.

Return Value

The following string is returned:

text
-s MMddhhmmyy -e MMddhhmmyy

where:

dd is the 2-digit value for day

hh is the 2-digit value for the hour in 24-hour format mm is the 2-digit value for minutes

yy is the 2-digit value for year

has_diag_authority

목적

사용자에게 진단을 실행할 알맞은 권한이 있는지 확인합니다.

구문

c
int has_diag_authority chk_shutdown;

설명

has_diag_authority 서브루틴은 사용자가 진단을 실행할 권한이 있는지 확인합니다.

매개변수

매개변수 설명
chk_shutdown TRUE면 사용자가 시스템을 종료할 권한이 있는지도 확인합니다.

반환값

값 뜻
0 사용자에게 진단 실행 권한이 없음
1 사용자에게 진단 실행 권한이 있음
영어 원문

has_diag_authority

Purpose

Checks if a user has the proper authority to run diagnostics.

Syntax

int has_diag_authority chk_shutdown;

Description

The has_diag_authority subroutine checks if the user is authorized to run diagnostics.

Parameters

  • chk_shutdown — If TRUE, the subroutine checks to see if the user is authorized to shut down the system.

Return Value

  • 0 — User is not authorized to run diagnostics.
  • 1 — User is authorized to run diagnostics.

ipl_mode

목적

진단 IPL 모드의 상태를 돌려줍니다.

구문

text
#include    <diag/diag.h>
int ipl_mode ( source )
int source ;

설명

ipl_mode 서브루틴은 진단 IPL 모드의 상태와 IPL 소스를 돌려줍니다.

매개변수

매개변수 설명
source IPL 소스에 따라 설정합니다. 환경 변수 DIAG_IPL_SOURCE 값이 NULL, IPL_SOURCE_DISK, IPL_SOURCE_LAN이면 DIAG_FALSE(0)로, IPL_SOURCE_CDROM이나 IPL_SOURCE_TAPE면 DIAG_TRUE(1)로 설정합니다.

반환값

값 뜻
1 EXENV_IPL IPL 중에 진단을 불렀음
2 EXENV_STD 독립형(Standalone) 진단, 온라인 서비스, 온라인 유지 보수
4 EXENV_CONC 온라인 동시(Concurrent) 진단
영어 원문

ipl_mode

Purpose

Returns the state of the diagnostic IPL mode.

Syntax

text
#include    <diag/diag.h>
int ipl_mode ( source )
int source ;

Description

The ipl_mode subroutine returns the state of the diagnostic IPL mode, and the IPL source.

Parameters

  • source — Set according to IPL source: If the value of the environment variable DIAG_IPL_SOURCE is NULL or IPL_SOURCE_DISK or IPL_SOURCE_LAN, then the value of source will be set to DIAG_FALSE (0). If the value of the environment variable DIAG_IPL_SOURCE is IPL_SOURCE_CDROM or IPL_SOURCE_TAPE, then the value of source will be set to DIAG_TRUE (1).

Return Value

The ipl_mode subroutine returns one of the following values:

  • 1 EXENV_IPL — Diagnostics invoked during IPL
  • 2 EXENV_STD — Standalone Diagnostics, Online Service, or Online Maintenance
  • 4 EXENV_CONC — Online Concurrent Diagnostics

목적

텍스트 목표(Text Goal)를 마무리합니다.

구문

text
int menugoal ( msg )
char * msg ;

설명

menugoal 서브루틴은 시험 중인 장치에 메뉴 목표를 연결합니다. 지금 시험 중인 장치는 TMInput 객체 클래스가 나타냅니다.

매개변수

매개변수 설명
msg 훈련받은 서비스 담당자가 아니라 고객을 위한 수리 작업을 나타내는 텍스트 문자열의 포인터. 버퍼 맨 앞에 여섯 자리 16진수(메뉴 번호)가 오고, 공백 하나 뒤에 제목 줄이 와야 합니다. 첫 줄 바꿈 뒤는 모두 메뉴 텍스트로 여깁니다.

반환값

성공하면 0을, menugoal 서브루틴이 실패하면 -1을 돌려줍니다.

영어 원문

menugoal

Purpose

Concludes a Text Goal.

Syntax

text
int menugoal ( msg )
char * msg ;

Description

The menugoal subroutine associates a menu goal with the device being tested. The TMInput object class identifies the device currently being tested.

Parameters

  • msg — Pointer to a text string that identifies a repair action intended for the customer, not a trained service representative. The msg parameter should contain a six-digit hex number (menu number) at the front of the buffer, followed by a space, and then the title line. Everything after the first carriage return is considered menu text.

Return Value

Upon successful completion, a value of 0 is returned. If the menugoal subroutine fails, then a value of -1 is returned.

schedule_ela

목적

장치의 ELA를 예약합니다.

구문

text
int schedule_ela ( device, minutes )
char *device;
int minutes;

설명

이 루틴은 주어진 장치의 오류 로그 분석(ELA)을 예약합니다. 보통 진단 응용 프로그램이 처리 중에 오류 로그 항목이 생길 것이고 진단 결론을 내는 데 그것이 필요하다고 판단할 때 ELA를 예약하는 데 씁니다.

예약 시각은 현재 시각에 입력으로 받은 분을 더한 것이며, 분은 24시간으로 제한됩니다. 예약한 ELA 이벤트는 diag -c -e -d 장치 명령을 쓰는 것과 비슷하며 한 번만 일어납니다.

매개변수

매개변수 설명
device ELA를 실행할 장치 이름. 예: sysplanar0
minutes ELA 실행을 예약하려고 현재 시각에 더할 분. 24시간을 넘는 값은 24시간보다 작은 값으로 잘립니다. 예: 24시간 35분(1475분)은 35분으로 잘립니다.

반환값

오류 반환이 없으며 늘 0을 돌려줍니다.

영어 원문

schedule_ela

Purpose

Schedule ELA for a device.

Syntax

text
int schedule_ela ( device, minutes )
char *device;
int minutes;

Description

This routine is used to schedule Error Log Analysis (ELA) for a given device. Typically, this would be used by a Diagnostic Application to schedule ELA when processing indicates that an error log entry is expected and necessary for completing the diagnostic conclusion.

The scheduled time is the current time plus the number of minutes given as input. The number of minutes is limited to 24 hours. The scheduled ELA event, similar to using the diag -c -e -d device command, occurs one time only.

Parameters

  • device — The device name for which ELA should be run. Example: sysplanar0
  • minutes — The number of minutes that is added to the current time to schedule ELA to run. Any value over 24 hours is truncated to a value less than 24 hours. Example: 24 hours and 35 minutes (1475 minutes) is truncated to 35 minutes.

Return Value

There is no error return. Always returns 0.