acldumpRegCallback

Description

Registers the dump data callback function.

aclmdlInitDump, acldumpRegCallback, acldumpUnregCallback, and aclmdlFinalizeDump work together to obtain dump data through a callback function. The callback function registered through acldumpRegCallback needs to be implemented by users, and the implementation logic of the callback function must include the acquisition of the dump data and data length. The specific scenarios are exemplified as follows:

Prototype

aclError acldumpRegCallback(int32_t (* const messageCallback)(const acldumpChunk *, int32_t len), int32_t flag)

Parameters

Parameter

Input/Output

Description

messageCallback

Input

Pointer to the callback function, which is used to receive callback data.

  • The acldumpChunk struct is defined as follows. When implementing the messageCallback function, you can obtain values of parameters such as dataBuf and bufLen in the acldumpChunk struct to obtain the dump data and its length.
    typedef struct acldumpChunk  {
        char       fileName[ACL_DUMP_MAX_FILE_PATH_LENGTH];   // Name of the dump file to be written to a drive. ACL_DUMP_MAX_FILE_PATH_LENGTH indicates the maximum length of the file name, which is 4096 currently.
        uint32_t   bufLen;                           // dataBuf data length, in bytes.
        uint32_t   isLastChunk;                      // Whether the dump data is the last chunk. The value 0 indicates that the dump data is not the last chunk, and the value 1 indicates that the dump data is the last chunk.
        int64_t    offset;                           // Offset of the content in the dump file. The value -1 indicates the added content of the file.
        int32_t    flag;                             // Reserved dump data flag. The current data has no flag.
        uint8_t    dataBuf[0];                       // Memory address of the dump data.
    } acldumpChunk;
  • len: length of acldumpChunk struct, in bytes.

flag

Input

Whether to write dump data to a drive after the callback API is called.

  • 0: no. Currently, only the value 0 is supported.

Returns

The value 0 indicates success, and other values indicate failure. For details, see aclError.