Starting system memory dump operation by using the ras_ufc_cntrl API call

The ras_ufc_cntrl application programming interface (API) starts the system memory dump operation and starts or stops the input/output control (ioctl) trace operation on a specified symptom string.

Syntax

kerrno_t ras_ufc_cntrl(int command, ras_ufc_params_t *params)

Parameters

command
The command parameter can have the following values:
RAS_UFC_SYSDUMP
Starts the system memory dump operation.
RAS_UFC_TRCON
Starts the ioctl trace operation.
RAS_UFC_TRCOFF
Stops the ioctl trace operation.
ras_ufc_params_t structure
The ras_ufc_params_t parameter is a structure that is defined as follows:
typedef struct ras_ufc_params {
	char symptom_string[RAS_UFC_SYM_LEN]; /* symptom string, which gets logged into errlog */
	int symptom_size;	              /* length of symptom string */
	int reserved[7];
} ras_ufc_params_t;

The symptom_string parameter must be a string of the following format:

<PRODUCT_NAME>:<EVENT_DESCRIPTION>:<DETAIL_DATA>

The system_size parameter specifies the size of the symptom string.

The following example shows how to start a system memory dump operation by using the ras_ufc_cntrl API:

int rc = 0;
ras_ufc_params_t params;
int size = snprintf(params.symptom_string,RAS_UFC_MAX_SYMPTOM, “ABC:I/O timeout:pid=%d file = %s offset = %d size = %d”,pid, fn, fd, os, s);
params.symptom_size = MIN(size, RAS_UFC_MAX_SYMPTOM);
rc =  ras_ufc_cntrl(RAS_UFC_SYSDUMP,&params);
if(rc == -1) {
/* handle error */
}

To start or stop the ioctl trace operation by using the ras_ufc_cntrl API, you must configure the trace session by using the trace command to start the collection of system events as shown in the following example command:

trace -a -j 234,132…

The -a parameter runs the trace session asynchronously as a background task. The -j parameter specifies the user-defined events to collect trace data.

The following example shows how to start the ioctl trace operation by using the ras_ufc_cntrl API:

int rc = 0;
ras_ufc_params_t params;
int size = snprintf(params.symptom_string,RAS_UFC_MAX_SYMPTOM, “ABC:Heart Beat Daemon Started:pid=%d ”,pid);
params.symptom_size = MIN(size, RAS_UFC_MAX_SYMPTOM);
rc =  ras_ufc_cntrl(RAS_UFC_TRCON,&params);
if(rc == -1) {
/* handle error */
}

The following example shows how to stop the ioctl trace operation by using the ras_ufc_cntrl API:

int rc = 0;
ras_ufc_params_t params;
int size = snprintf(symp_string,RAS_UFC_MAX_SYMPTOM, “ABC:Heart Beat Daemon Failure:pid=%d ”,pid);
params.symptom_size = MIN(size, RAS_UFC_MAX_SYMPTOM);
rc =  ras_ufc_cntrl(RAS_UFC_TRCOFF, &params);
if(rc == -1) {
/* handle error */
}