|
Sound Open Firmware
|
Circular host DMA trace buffers, dictionary-based logger (.ldc), runtime log level filtering, and panic crash dumps. More...

Files | |
| file | trace.h |
| Host-DSP IPC trace DMA configuration, filtering, and panic descriptors. | |
| file | trace.h |
| User-space ABI log levels and binary trace packet header definitions. | |
| file | dma-trace.h |
| Direct Memory Access (DMA) trace buffer management and host streaming. | |
| file | trace-boot.h |
| Early bootloader, architecture, and peripheral initialization trace checkpoint codes. | |
| file | trace-soflogger.h |
| Dictionary-based trace logging engine, log filtering, and mailbox trace fallback. | |
Data Structures | |
| struct | sof_ipc_dma_trace_params |
| Legacy host DMA trace parameters payload (SOF_IPC_TRACE_DMA_PARAMS). More... | |
| struct | sof_ipc_dma_trace_params_ext |
| Extended host DMA trace parameters payload (SOF_IPC_TRACE_DMA_PARAMS_EXT). More... | |
| struct | sof_ipc_dma_trace_posn |
| DMA trace circular buffer position report sent to host (SOF_IPC_TRACE_DMA_POSITION). More... | |
| struct | sof_ipc_panic_info |
| DSP panic crash dump descriptor reported to host. More... | |
| struct | log_entry_header |
| Binary log packet header preceding variable arguments in DMA trace stream. More... | |
| struct | dma_trace_buf |
| Internal ring buffer descriptor for DSP trace packets. More... | |
| struct | dma_trace_data |
| Main DMA trace context and state machine descriptor. More... | |
| struct | trace_filter |
| Runtime trace filter criteria for components and pipelines. More... | |
Typedefs | |
| typedef void(* | log_func_t) (bool send_atomic, const void *log_entry, const struct tr_ctx *ctx, uint32_t lvl, uint32_t id_1, uint32_t id_2, int arg_count, va_list args) |
| Function pointer type for formatted trace logger backends. | |
Functions | |
| int | dma_trace_init_early (struct sof *sof) |
| Early initialization of the DMA trace subsystem during bootstrap. | |
| int | dma_trace_init_complete (struct dma_trace_data *d) |
| Complete initialization of DMA trace once host channel is negotiated. | |
| int | dma_trace_host_buffer (struct dma_trace_data *d, struct dma_sg_elem_array *elem_array, uint32_t host_size) |
| Configure the host-side destination scatter-gather buffer for DMA trace. | |
| int | dma_trace_enable (struct dma_trace_data *d) |
| Enable DMA trace streaming to the host. | |
| void | dma_trace_disable (struct dma_trace_data *d) |
| Disable DMA trace streaming and cancel pending periodic tasks. | |
| void | dma_trace_flush (void *destination) |
| Flush residual trace data from local DSP buffer to destination memory or mailbox. | |
| void | dma_trace_on (void) |
| Globally unpause and resume trace event logging. | |
| void | dma_trace_off (void) |
| Globally pause trace event logging. | |
| void | dtrace_event (const char *e, uint32_t size) |
| Append a binary trace event to the circular buffer. | |
| void | dtrace_event_atomic (const char *e, uint32_t length) |
| Append a binary trace event to the buffer from atomic or interrupt context. | |
| static bool | dma_trace_initialized (const struct dma_trace_data *d) |
| Check whether DMA trace subsystem has been initialized. | |
| static struct dma_trace_data * | dma_trace_data_get (void) |
| Retrieve global DMA trace data context from system runtime. | |
| static uint32_t | dtrace_calc_buf_margin (struct dma_trace_buf *buffer) |
| Calculate contiguous bytes remaining until the end of the circular buffer. | |
| static struct trace * | trace_get (void) |
| Retrieve global trace subsystem context from SOF runtime. | |
| void | trace_flush_dma_to_mbox (void) |
| Flush buffered trace data from DMA buffer to Mailbox Window. | |
| void | trace_on (void) |
| Globally resume trace event logging. | |
| void | trace_off (void) |
| Globally pause trace event logging. | |
| void | trace_init (struct sof *sof) |
| Initialize the trace subsystem and allocate global trace buffers. | |
| void | trace_log_filtered (bool send_atomic, const void *log_entry, const struct tr_ctx *ctx, uint32_t lvl, uint32_t id_1, uint32_t id_2, int arg_count, va_list args) |
| Emit a filtered dictionary trace message. | |
| void | trace_log_unfiltered (bool send_atomic, const void *log_entry, const struct tr_ctx *ctx, uint32_t lvl, uint32_t id_1, uint32_t id_2, int arg_count, va_list args) |
| Emit an unfiltered dictionary trace message directly to buffers. | |
| struct sof_ipc_trace_filter_elem * | trace_filter_fill (struct sof_ipc_trace_filter_elem *elem, struct sof_ipc_trace_filter_elem *end, struct trace_filter *filter) |
| Populate an IPC trace filter element array. | |
| int | trace_filter_update (const struct trace_filter *elem) |
| Update runtime trace filtering configuration from IPC payload. | |
| void | mtrace_dict_entry (bool atomic_context, uint32_t log_entry_pointer, int n_args,...) |
| Appends one SOF dictionary entry and log statement to shared memory mtrace. | |
| void | mtrace_event (const char *complete_packet, uint32_t length) |
| Posts a fully prepared log header and log entry packet to mtrace buffer. | |
| void | _log_sofdict (log_func_t sofdict_logf, bool atomic, const void *log_entry, const struct tr_ctx *ctx, const uint32_t lvl, uint32_t id_1, uint32_t id_2, int arg_count,...) |
| Internal dictionary logger formatting and dispatch helper. | |
Circular host DMA trace buffers, dictionary-based logger (.ldc), runtime log level filtering, and panic crash dumps.
| typedef void(* log_func_t) (bool send_atomic, const void *log_entry, const struct tr_ctx *ctx, uint32_t lvl, uint32_t id_1, uint32_t id_2, int arg_count, va_list args) |
Function pointer type for formatted trace logger backends.
| [in] | send_atomic | True if logging from atomic or interrupt context. |
| [in] | log_entry | Pointer to static log entry descriptor. |
| [in] | ctx | Pointer to caller trace context. |
| [in] | lvl | Severity log level (LOG_LEVEL_*). |
| [in] | id_1 | Primary component/pipe identifier. |
| [in] | id_2 | Secondary component/subid identifier. |
| [in] | arg_count | Number of variable arguments. |
| [in] | args | Variable arguments list. |
| void _log_sofdict | ( | log_func_t | sofdict_logf, |
| bool | atomic, | ||
| const void * | log_entry, | ||
| const struct tr_ctx * | ctx, | ||
| const uint32_t | lvl, | ||
| uint32_t | id_1, | ||
| uint32_t | id_2, | ||
| int | arg_count, | ||
| ... | |||
| ) |
Internal dictionary logger formatting and dispatch helper.
| sofdict_logf | Backend log emission callback function. |
| atomic | True if executed in atomic context. |
| log_entry | Pointer to static log entry. |
| ctx | Trace context. |
| lvl | Log severity level. |
| id_1 | Primary identifier. |
| id_2 | Secondary identifier. |
| arg_count | Number of format arguments. |
|
inlinestatic |
Retrieve global DMA trace data context from system runtime.
| void dma_trace_disable | ( | struct dma_trace_data * | d | ) |
Disable DMA trace streaming and cancel pending periodic tasks.
| [in,out] | d | DMA trace data context. |
| int dma_trace_enable | ( | struct dma_trace_data * | d | ) |
Enable DMA trace streaming to the host.
| [in,out] | d | DMA trace data context. |
| void dma_trace_flush | ( | void * | destination | ) |
Flush residual trace data from local DSP buffer to destination memory or mailbox.
| [out] | destination | Pointer to destination memory buffer, or NULL for default mailbox. |
| int dma_trace_host_buffer | ( | struct dma_trace_data * | d, |
| struct dma_sg_elem_array * | elem_array, | ||
| uint32_t | host_size | ||
| ) |
Configure the host-side destination scatter-gather buffer for DMA trace.
| [in,out] | d | DMA trace data context. |
| [in] | elem_array | Array of scatter-gather buffer page elements. |
| [in] | host_size | Total size in bytes of the host buffer. |
| int dma_trace_init_complete | ( | struct dma_trace_data * | d | ) |
Complete initialization of DMA trace once host channel is negotiated.
| [in,out] | d | DMA trace data context. |
| int dma_trace_init_early | ( | struct sof * | sof | ) |
Early initialization of the DMA trace subsystem during bootstrap.
| [in,out] | sof | Global SOF system context. |
|
inlinestatic |
Check whether DMA trace subsystem has been initialized.
| [in] | d | DMA trace context. |
| void dma_trace_off | ( | void | ) |
Globally pause trace event logging.
| void dma_trace_on | ( | void | ) |
Globally unpause and resume trace event logging.
|
inlinestatic |
Calculate contiguous bytes remaining until the end of the circular buffer.
| [in] | buffer | Pointer to circular trace buffer descriptor. |
| void dtrace_event | ( | const char * | e, |
| uint32_t | size | ||
| ) |
Append a binary trace event to the circular buffer.
| [in] | e | Pointer to binary event packet. |
| [in] | size | Packet size in bytes. |
| void dtrace_event_atomic | ( | const char * | e, |
| uint32_t | length | ||
| ) |
Append a binary trace event to the buffer from atomic or interrupt context.
| [in] | e | Pointer to binary event packet. |
| [in] | length | Size of packet in bytes. |
| void mtrace_dict_entry | ( | bool | atomic_context, |
| uint32_t | log_entry_pointer, | ||
| int | n_args, | ||
| ... | |||
| ) |
Appends one SOF dictionary entry and log statement to shared memory mtrace.
| atomic_context | Take the trace->lock if false. |
| log_entry_pointer | Dictionary index produced by _DECLARE_LOG_ENTRY macro. |
| n_args | Number of variable arguments. |
| void mtrace_event | ( | const char * | complete_packet, |
| uint32_t | length | ||
| ) |
Posts a fully prepared log header and log entry packet to mtrace buffer.
| complete_packet | Pointer to prepared log packet buffer. |
| length | Packet size in bytes. |
| struct sof_ipc_trace_filter_elem * trace_filter_fill | ( | struct sof_ipc_trace_filter_elem * | elem, |
| struct sof_ipc_trace_filter_elem * | end, | ||
| struct trace_filter * | filter | ||
| ) |
Populate an IPC trace filter element array.
| [in,out] | elem | Pointer to current output filter element. |
| [in] | end | Boundary pointer of element array. |
| [in] | filter | Source trace filter configuration. |
| int trace_filter_update | ( | const struct trace_filter * | elem | ) |
Update runtime trace filtering configuration from IPC payload.
| [in] | elem | Trace filter descriptor to apply. |
| void trace_flush_dma_to_mbox | ( | void | ) |
Flush buffered trace data from DMA buffer to Mailbox Window.
|
inlinestatic |
Retrieve global trace subsystem context from SOF runtime.
| void trace_init | ( | struct sof * | sof | ) |
Initialize the trace subsystem and allocate global trace buffers.
| [in,out] | sof | Global SOF runtime context. |
| void trace_log_filtered | ( | bool | send_atomic, |
| const void * | log_entry, | ||
| const struct tr_ctx * | ctx, | ||
| uint32_t | lvl, | ||
| uint32_t | id_1, | ||
| uint32_t | id_2, | ||
| int | arg_count, | ||
| va_list | args | ||
| ) |
Emit a filtered dictionary trace message.
| [in] | send_atomic | True if logging from atomic context. |
| [in] | log_entry | Pointer to static log entry. |
| [in] | ctx | Trace context. |
| [in] | lvl | Log level. |
| [in] | id_1 | Primary identifier. |
| [in] | id_2 | Secondary identifier. |
| [in] | arg_count | Argument count. |
| [in] | args | Argument list. |
| void trace_log_unfiltered | ( | bool | send_atomic, |
| const void * | log_entry, | ||
| const struct tr_ctx * | ctx, | ||
| uint32_t | lvl, | ||
| uint32_t | id_1, | ||
| uint32_t | id_2, | ||
| int | arg_count, | ||
| va_list | args | ||
| ) |
Emit an unfiltered dictionary trace message directly to buffers.
| [in] | send_atomic | True if logging from atomic context. |
| [in] | log_entry | Pointer to static log entry. |
| [in] | ctx | Trace context. |
| [in] | lvl | Log level. |
| [in] | id_1 | Primary identifier. |
| [in] | id_2 | Secondary identifier. |
| [in] | arg_count | Argument count. |
| [in] | args | Argument list. |
| void trace_off | ( | void | ) |
Globally pause trace event logging.
| void trace_on | ( | void | ) |
Globally resume trace event logging.