14#ifndef __SOF_TRACE_DMA_TRACE_H__
15#define __SOF_TRACE_DMA_TRACE_H__
static bool dma_trace_initialized(const struct dma_trace_data *d)
Check whether DMA trace subsystem has been initialized.
Definition dma-trace.h:146
void dma_trace_disable(struct dma_trace_data *d)
Disable DMA trace streaming and cancel pending periodic tasks.
static uint32_t dtrace_calc_buf_margin(struct dma_trace_buf *buffer)
Calculate contiguous bytes remaining until the end of the circular buffer.
Definition dma-trace.h:167
void dtrace_event(const char *e, uint32_t size)
Append a binary trace event to the circular buffer.
void dma_trace_flush(void *destination)
Flush residual trace data from local DSP buffer to destination memory or mailbox.
void dtrace_event_atomic(const char *e, uint32_t length)
Append a binary trace event to the buffer from atomic or interrupt context.
void dma_trace_on(void)
Globally unpause and resume trace event logging.
int dma_trace_init_early(struct sof *sof)
Early initialization of the DMA trace subsystem during bootstrap.
int dma_trace_enable(struct dma_trace_data *d)
Enable DMA trace streaming to the host.
int dma_trace_init_complete(struct dma_trace_data *d)
Complete initialization of DMA trace once host channel is negotiated.
static struct dma_trace_data * dma_trace_data_get(void)
Retrieve global DMA trace data context from system runtime.
Definition dma-trace.h:156
void dma_trace_off(void)
Globally pause trace event logging.
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.
Sound Open Firmware global runtime context.
struct sof * sof_get(void)
Get the global Sound Open Firmware runtime instance pointer.
RTOS spinlock primitives and initialization.
Host-DSP IPC trace DMA configuration, filtering, and panic descriptors.
SG elem array.
Definition dma.h:155
Internal ring buffer descriptor for DSP trace packets.
Definition dma-trace.h:31
void * end_addr
Upper boundary address of the trace buffer.
Definition dma-trace.h:35
void * w_ptr
Buffer write pointer where new trace packets are appended.
Definition dma-trace.h:32
uint32_t avail
Number of readable bytes currently available.
Definition dma-trace.h:37
void * addr
Base address of the circular trace buffer.
Definition dma-trace.h:34
uint32_t size
Total size of the buffer in bytes.
Definition dma-trace.h:36
void * r_ptr
Buffer read pointer tracking data transferred by DMA.
Definition dma-trace.h:33
Main DMA trace context and state machine descriptor.
Definition dma-trace.h:44
struct dma_copy dc
DMA copy engine instance.
Definition dma-trace.h:47
struct ipc_msg * msg
IPC message used to report buffer position.
Definition dma-trace.h:49
uint32_t stream_tag
Assigned host DMA stream tag.
Definition dma-trace.h:54
struct dma_trace_buf dmatb
Internal circular buffer tracking read/write pointers.
Definition dma-trace.h:46
struct dma_sg_config config
Scatter-gather configuration for host DMA.
Definition dma-trace.h:45
uint32_t dropped_entries
Cumulative counter of dropped entries due to buffer overflow.
Definition dma-trace.h:57
uint64_t time_delta
Offset between host wallclock and DSP hardware timer.
Definition dma-trace.h:59
struct task dmat_work
Periodic scheduling task driving DMA transfers.
Definition dma-trace.h:51
uint32_t dma_copy_align
Minimal byte alignment required for DMA transfer chunks.
Definition dma-trace.h:56
struct sof_ipc_dma_trace_posn posn
Position report payload sent to host.
Definition dma-trace.h:48
uint32_t active_stream_tag
Current active stream tag.
Definition dma-trace.h:55
uint32_t host_size
Total size of host-allocated trace buffer.
Definition dma-trace.h:50
uint32_t copy_in_progress
1 if a DMA copy operation is currently underway
Definition dma-trace.h:53
uint32_t enabled
1 if DMA trace streaming is active, 0 otherwise
Definition dma-trace.h:52
struct k_spinlock lock
Spinlock synchronizing buffer writes and DMA triggers.
Definition dma-trace.h:58
DMA trace circular buffer position report sent to host (SOF_IPC_TRACE_DMA_POSITION).
Definition trace.h:52
General firmware context.
Definition sof.h:50
struct dma_trace_data * dmat
Definition sof.h:64
Core task structure managed by SOF schedulers.
Definition task.h:81
Core task descriptor, task operations, and task execution state machine.