itrace
Instrumented Trace
Logger APIs

Functions

itrace_return_t itrace_open_logger (int domain, itrace_logger_handle_t *logger_handle_ptr)
 Open logger instance. More...
 
itrace_return_t itrace_close_logger (itrace_logger_handle_t logger_handle)
 Close logger instance. More...
 
itrace_return_t itrace_set_root_filename (itrace_logger_handle_t logger_handle, const char *root_filename)
 Specify the root name of the files created by the logger. More...
 
itrace_return_t itrace_get_root_filename (itrace_logger_handle_t logger_handle, char *root_filename)
 Return the current root name being used by the logger. More...
 
itrace_return_t itrace_flush_logs (itrace_logger_handle_t logger_handle)
 Flush the logs of all opened profilers. More...
 
itrace_return_t itrace_close_files (itrace_logger_handle_t logger_handle)
 Close the logger output files. More...
 
itrace_return_t itrace_set_target_files (itrace_logger_handle_t logger_handle, uint32_t file_types)
 Specify the types of files generated by the logger. More...
 

Detailed Description

The logger is responsible for the following tasks:

Function Documentation

◆ itrace_close_files()

itrace_return_t itrace_close_files ( itrace_logger_handle_t  logger_handle)

Close the logger output files.

Note: This function is called automatically by itrace_set_root_filename and itrace_close_logger.

Parameters
[in]logger_handleHandle of the logger instance.
Returns
Status: ITRACE_RET_SUCCESS on success. ITRACE_RET_UNSUPPORTED if not supported on selected domain.

◆ itrace_close_logger()

itrace_return_t itrace_close_logger ( itrace_logger_handle_t  logger_handle)

Close logger instance.

Parameters
[in]logger_handleHandle of the logger instance to be closed.
Returns
Status: ITRACE_RET_SUCCESS on success. ITRACE_RET_UNSUPPORTED if not supported on selected domain.

◆ itrace_flush_logs()

itrace_return_t itrace_flush_logs ( itrace_logger_handle_t  logger_handle)

Flush the logs of all opened profilers.

Retrieve the logs of all opened profilers, parse their contents and write them to files.

Note: This function is called automatically by itrace_close_files.

Parameters
[in]logger_handleHandle of the logger instance.
Returns
Status: ITRACE_RET_SUCCESS on success. ITRACE_RET_UNSUPPORTED if not supported on selected domain.

◆ itrace_get_root_filename()

itrace_return_t itrace_get_root_filename ( itrace_logger_handle_t  logger_handle,
char *  root_filename 
)

Return the current root name being used by the logger.

Buffer root filename length must be at most ITRACE_MAX_LENGTH_FILENAME bytes

Parameters
[in]logger_handleHandle of the logger instance.
[out]root_filenameRoot name of the files created by the logger.
Returns
Status: ITRACE_RET_SUCCESS on success. ITRACE_RET_UNSUPPORTED if not supported on selected domain.

◆ itrace_open_logger()

itrace_return_t itrace_open_logger ( int  domain,
itrace_logger_handle_t logger_handle_ptr 
)

Open logger instance.

Each logger is associated to a domain on which to run. A domain is a local or remote environment, such as the application processor or one of the DSPs (CDSP, ADSP, etc.). DSP valid domains values are specified in remote.h and itrace defines additional domains in the Domain extensions.

Limitation: The domain parameter can only be CPU_DOMAIN_ID currently and only one instance may be running at a given time.

Parameters
[in]domainDomain on which the logger instance will reside.
[out]logger_handle_ptrHandle of the logger instance created.
Returns
Status: ITRACE_RET_SUCCESS on success. ITRACE_RET_UNSUPPORTED if not supported on selected domain.

◆ itrace_set_root_filename()

itrace_return_t itrace_set_root_filename ( itrace_logger_handle_t  logger_handle,
const char *  root_filename 
)

Specify the root name of the files created by the logger.

Example: If root_filename is set to "mytest", the logger will produce ./mytest.json and ./mytest.csv if these file types are enabled.

Note: The logger will call itrace_close_files first to ensure that all existing logs are written to the file(s) already opened with a different root name if such files exist already.

Maximum file name size: ITRACE_MAX_LENGTH_FILENAME.

Parameters
[in]logger_handleHandle of the logger instance.
[in]root_filenameRoot name of the files created by the logger.
Returns
Status: ITRACE_RET_SUCCESS on success. ITRACE_RET_UNSUPPORTED if not supported on selected domain.

◆ itrace_set_target_files()

itrace_return_t itrace_set_target_files ( itrace_logger_handle_t  logger_handle,
uint32_t  file_types 
)

Specify the types of files generated by the logger.

By default, the logger will produce json and csv output files.

Parameters
[in]logger_handleHandle of the logger instance.
[in]file_typesOne or more of the supported Output file types.
Returns
Status: ITRACE_RET_SUCCESS on success. ITRACE_RET_UNSUPPORTED if not supported on selected domain.