Skip to content

Commit

Permalink
Trace: remove trace context dependency
Browse files Browse the repository at this point in the history
Remove it and change source file accordingly.

Signed-off-by: Baofeng Tian <[email protected]>
  • Loading branch information
btian1 committed Feb 2, 2024
1 parent aeffc83 commit c8bf2a4
Show file tree
Hide file tree
Showing 101 changed files with 914 additions and 970 deletions.
4 changes: 2 additions & 2 deletions posix/include/rtos/wait.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ static inline void wait_for_interrupt(int level)
{
LOG_MODULE_DECLARE(wait, CONFIG_SOF_LOG_LEVEL);

tr_dbg(&wait_tr, "WFE");
tr_dbg("WFE");
#if CONFIG_DEBUG_LOCKS
if (lock_dbg_atomic)
tr_err_atomic("atm");
#endif
platform_wait_for_interrupt(level);
tr_dbg(&wait_tr, "WFX");
tr_dbg("WFX");
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/audio/base_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,10 @@ static int fw_config_set_force_l1_exit(const struct sof_tlv *tlv)
const uint32_t force = tlv->value[0];

if (force) {
tr_info(&basefw_comp_tr, "FW config set force dmi l0 state");
tr_info("FW config set force dmi l0 state");
intel_adsp_force_dmi_l0_state();
} else {
tr_info(&basefw_comp_tr, "FW config set allow dmi l1 state");
tr_info("FW config set allow dmi l1 state");
intel_adsp_allow_dmi_l1_state();
}

Expand All @@ -451,7 +451,7 @@ static int basefw_set_fw_config(bool first_block,
default:
break;
}
tr_warn(&basefw_comp_tr, "returning success for Set FW_CONFIG without handling it");
tr_warn("returning success for Set FW_CONFIG without handling it");
return 0;
}

Expand Down Expand Up @@ -485,7 +485,7 @@ static int basefw_get_large_config(struct comp_dev *dev,
case IPC4_EXTENDED_SYSTEM_TIME:
ret = basefw_get_ext_system_time(data_offset, data);
if (ret == IPC4_UNAVAILABLE) {
tr_warn(&basefw_comp_tr, "returning success for get host EXTENDED_SYSTEM_TIME without handling it");
tr_warn("returning success for get host EXTENDED_SYSTEM_TIME without handling it");
return 0;
} else {
return ret;
Expand Down
8 changes: 4 additions & 4 deletions src/audio/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, u
struct comp_buffer *buffer;
void *stream_addr;

tr_dbg(&buffer_tr, "buffer_alloc()");
tr_dbg("buffer_alloc()");

/* validate request */
if (size == 0) {
tr_err(&buffer_tr, "buffer_alloc(): new size = %u is invalid",
tr_err("buffer_alloc(): new size = %u is invalid",
size);
return NULL;
}
Expand All @@ -48,7 +48,7 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, u
buffer = rzalloc(zone, 0, SOF_MEM_CAPS_RAM, sizeof(*buffer));

if (!buffer) {
tr_err(&buffer_tr, "buffer_alloc(): could not alloc structure");
tr_err("buffer_alloc(): could not alloc structure");
return NULL;
}

Expand All @@ -58,7 +58,7 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, u
stream_addr = rballoc_align(0, caps, size, align);
if (!stream_addr) {
rfree(buffer);
tr_err(&buffer_tr, "buffer_alloc(): could not alloc size = %u bytes of type = %u",
tr_err("buffer_alloc(): could not alloc size = %u bytes of type = %u",
size, caps);
return NULL;
}
Expand Down
26 changes: 11 additions & 15 deletions src/audio/chain_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ static void handle_xrun(struct chain_dma_data *cd)

if (cd->link_connector_node_id.f.dma_type == ipc4_hda_link_output_class &&
!cd->xrun_notification_sent) {
tr_warn(&chain_dma_tr, "handle_xrun(): underrun detected");
tr_warn("handle_xrun(): underrun detected");
xrun_notif_msg_init(cd->msg_xrun, cd->link_connector_node_id.dw,
SOF_IPC4_GATEWAY_UNDERRUN_DETECTED);
ipc_msg_send(cd->msg_xrun, NULL, true);
cd->xrun_notification_sent = true;
} else if (cd->link_connector_node_id.f.dma_type == ipc4_hda_link_input_class &&
!cd->xrun_notification_sent) {
tr_warn(&chain_dma_tr, "handle_xrun(): overrun detected");
tr_warn("handle_xrun(): overrun detected");
xrun_notif_msg_init(cd->msg_xrun, cd->link_connector_node_id.dw,
SOF_IPC4_GATEWAY_OVERRUN_DETECTED);
ipc_msg_send(cd->msg_xrun, NULL, true);
Expand Down Expand Up @@ -185,14 +185,14 @@ static enum task_state chain_task_run(void *data)
case 0:
break;
case -EPIPE:
tr_warn(&chain_dma_tr, "chain_task_run(): dma_get_status() link xrun occurred,"
tr_warn("chain_task_run(): dma_get_status() link xrun occurred,"
" ret = %u", ret);
#if CONFIG_XRUN_NOTIFICATIONS_ENABLE
handle_xrun(cd);
#endif
break;
default:
tr_err(&chain_dma_tr, "chain_task_run(): dma_get_status() error, ret = %u", ret);
tr_err("chain_task_run(): dma_get_status() error, ret = %u", ret);
return SOF_TASK_STATE_COMPLETED;
}

Expand All @@ -203,7 +203,7 @@ static enum task_state chain_task_run(void *data)
/* Host DMA does not report xruns. All error values will be treated as critical. */
ret = dma_get_status(cd->chan_host->dma->z_dev, cd->chan_host->index, &stat);
if (ret < 0) {
tr_err(&chain_dma_tr, "chain_task_run(): dma_get_status() error, ret = %u", ret);
tr_err("chain_task_run(): dma_get_status() error, ret = %u", ret);
return SOF_TASK_STATE_COMPLETED;
}

Expand All @@ -221,15 +221,13 @@ static enum task_state chain_task_run(void *data)

ret = dma_reload(cd->chan_host->dma->z_dev, cd->chan_host->index, 0, 0, increment);
if (ret < 0) {
tr_err(&chain_dma_tr,
"chain_task_run(): dma_reload() host error, ret = %u", ret);
tr_err("chain_task_run(): dma_reload() host error, ret = %u", ret);
return SOF_TASK_STATE_COMPLETED;
}

ret = dma_reload(cd->chan_link->dma->z_dev, cd->chan_link->index, 0, 0, increment);
if (ret < 0) {
tr_err(&chain_dma_tr,
"chain_task_run(): dma_reload() link error, ret = %u", ret);
tr_err("chain_task_run(): dma_reload() link error, ret = %u", ret);
return SOF_TASK_STATE_COMPLETED;
}
} else {
Expand All @@ -246,9 +244,8 @@ static enum task_state chain_task_run(void *data)
cd->chan_link->index, 0, 0,
half_buff_size);
if (ret < 0) {
tr_err(&chain_dma_tr,
"chain_task_run(): dma_reload() link error, ret = %u",
ret);
tr_err("chain_task_run(): dma_reload() link error, ret = %u",
ret);
return SOF_TASK_STATE_COMPLETED;
}
cd->first_data_received = true;
Expand All @@ -262,8 +259,7 @@ static enum task_state chain_task_run(void *data)
ret = dma_reload(cd->chan_host->dma->z_dev, cd->chan_host->index,
0, 0, transferred);
if (ret < 0) {
tr_err(&chain_dma_tr,
"chain_task_run(): dma_reload() host error, ret = %u", ret);
tr_err("chain_task_run(): dma_reload() host error, ret = %u", ret);
return SOF_TASK_STATE_COMPLETED;
}

Expand All @@ -272,7 +268,7 @@ static enum task_state chain_task_run(void *data)
ret = dma_reload(cd->chan_link->dma->z_dev, cd->chan_link->index,
0, 0, half_buff_size);
if (ret < 0) {
tr_err(&chain_dma_tr, "chain_task_run(): dma_reload() "
tr_err("chain_task_run(): dma_reload() "
"link error, ret = %u", ret);
return SOF_TASK_STATE_COMPLETED;
}
Expand Down
2 changes: 1 addition & 1 deletion src/audio/channel_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct sof_ipc_channel_map *chmap_get(struct sof_ipc_stream_map *smap,
uint32_t byte = 0;

if (index >= smap->num_ch_map) {
tr_err(&chmap_tr, "chmap_get(): index %d out of bounds %d",
tr_err("chmap_get(): index %d out of bounds %d",
index, smap->num_ch_map);

return NULL;
Expand Down
4 changes: 2 additions & 2 deletions src/audio/dp_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,14 @@ struct dp_queue *dp_queue_create(size_t min_available, size_t min_free_space, ui
goto err;

dp_queue->audio_stream_params.id = id;
tr_info(&dp_queue_tr, "DpQueue created, id: %u shared: %u min_available: %u min_free_space %u, size %u",
tr_info("DpQueue created, id: %u shared: %u min_available: %u min_free_space %u, size %u",
id, dp_queue_is_shared(dp_queue), min_available, min_free_space,
dp_queue->data_buffer_size);

/* return a pointer to allocated structure */
return dp_queue;
err:
tr_err(&dp_queue_tr, "DpQueue creation failure");
tr_err("DpQueue creation failure");
rfree(dp_queue);
return NULL;
}
20 changes: 10 additions & 10 deletions src/drivers/amd/common/acp_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ static struct dma_chan_data *acp_dma_channel_get(struct dma *dma,
key = k_spin_lock(&dma->lock);
if (req_chan >= dma->plat_data.channels) {
k_spin_unlock(&dma->lock, key);
tr_err(&acpdma_tr, "DMA: Channel %d not in range", req_chan);
tr_err("DMA: Channel %d not in range", req_chan);
return NULL;
}
channel = &dma->chan[req_chan];
if (channel->status != COMP_STATE_INIT) {
k_spin_unlock(&dma->lock, key);
tr_err(&acpdma_tr, "DMA: channel already in use %d", req_chan);
tr_err("DMA: channel already in use %d", req_chan);
return NULL;
}
atomic_add(&dma->num_channels_busy, 1);
Expand Down Expand Up @@ -199,14 +199,14 @@ static int acp_dma_start(struct dma_chan_data *channel)
return 0;
} while (platform_timer_get(timer) <= deadline);

tr_err(&acpdma_tr, "acp-dma: timed out for dma start");
tr_err("acp-dma: timed out for dma start");

return -ETIME;
}

static int acp_dma_release(struct dma_chan_data *channel)
{
tr_info(&acpdma_tr, "DMA: release(%d)", channel->index);
tr_info("DMA: release(%d)", channel->index);
if (channel->status != COMP_STATE_PAUSED)
return -EINVAL;
channel->status = COMP_STATE_ACTIVE;
Expand All @@ -215,7 +215,7 @@ static int acp_dma_release(struct dma_chan_data *channel)

static int acp_dma_pause(struct dma_chan_data *channel)
{
tr_info(&acpdma_tr, "h/w pause is not supported, changing the status of(%d) channel",
tr_info("h/w pause is not supported, changing the status of(%d) channel",
channel->index);
if (channel->status != COMP_STATE_ACTIVE)
return -EINVAL;
Expand Down Expand Up @@ -285,14 +285,14 @@ static int acp_dma_probe(struct dma *dma)
int channel;

if (dma->chan) {
tr_err(&acpdma_tr, "DMA: Already probe");
tr_err("DMA: Already probe");
return -EEXIST;
}
dma->chan = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM,
dma->plat_data.channels *
sizeof(struct dma_chan_data));
if (!dma->chan) {
tr_err(&acpdma_tr, "DMA: unable to allocate channel context");
tr_err("DMA: unable to allocate channel context");
return -ENOMEM;
}
for (channel = 0; channel < dma->plat_data.channels; channel++) {
Expand All @@ -304,7 +304,7 @@ static int acp_dma_probe(struct dma *dma)
sizeof(struct acp_dma_chan_data));
if (!acp_dma_chan) {
rfree(dma->chan);
tr_err(&acpdma_tr, "acp-dma: %d channel %d private data alloc failed",
tr_err("acp-dma: %d channel %d private data alloc failed",
dma->plat_data.id, channel);
return -ENOMEM;
}
Expand All @@ -318,7 +318,7 @@ static int acp_dma_remove(struct dma *dma)
int channel;

if (!dma->chan) {
tr_err(&acpdma_tr, "DMA: Invalid remove call");
tr_err("DMA: Invalid remove call");
return 0;
}
for (channel = 0; channel < dma->plat_data.channels; channel++)
Expand Down Expand Up @@ -379,7 +379,7 @@ static int acp_dma_get_data_size(struct dma_chan_data *channel,
*free = ABS(data_size) / 2;
break;
default:
tr_err(&acpdma_tr, "dma_get_data_size() Invalid direction %d",
tr_err("dma_get_data_size() Invalid direction %d",
channel->direction);
return -EINVAL;
}
Expand Down
18 changes: 9 additions & 9 deletions src/drivers/amd/common/acp_dmic_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ static struct dma_chan_data *acp_dmic_dma_channel_get(struct dma *dma,
key = k_spin_lock(&dma->lock);
if (req_chan >= dma->plat_data.channels) {
k_spin_unlock(&dma->lock, key);
tr_err(&acp_dmic_dma_tr, "Channel %d out of range",
tr_err("Channel %d out of range",
req_chan);
return NULL;
}
channel = &dma->chan[req_chan];
if (channel->status != COMP_STATE_INIT) {
k_spin_unlock(&dma->lock, key);
tr_err(&acp_dmic_dma_tr, "Cannot reuse channel %d",
tr_err("Cannot reuse channel %d",
req_chan);
return NULL;
}
Expand All @@ -82,14 +82,14 @@ static void acp_dmic_dma_channel_put(struct dma_chan_data *channel)
static int acp_dmic_dma_release(struct dma_chan_data *channel)
{
/* nothing to do on rembrandt */
tr_dbg(&acp_dmic_dma_tr, "dmic dma release()");
tr_dbg("dmic dma release()");
return 0;
}

static int acp_dmic_dma_pause(struct dma_chan_data *channel)
{
/* nothing to do on rembrandt */
tr_dbg(&acp_dmic_dma_tr, "dmic dma pause()");
tr_dbg("dmic dma pause()");
return 0;
}

Expand Down Expand Up @@ -151,14 +151,14 @@ static int acp_dmic_dma_probe(struct dma *dma)
int channel;

if (dma->chan) {
tr_err(&acp_dmic_dma_tr, "Repeated probe");
tr_err("Repeated probe");
return -EEXIST;
}
dma->chan = rzalloc(SOF_MEM_ZONE_SYS_RUNTIME, 0,
SOF_MEM_CAPS_RAM, dma->plat_data.channels *
sizeof(struct dma_chan_data));
if (!dma->chan) {
tr_err(&acp_dmic_dma_tr, "unable to allocate channel descriptors");
tr_err("unable to allocate channel descriptors");
return -ENOMEM;
}
for (channel = 0; channel < dma->plat_data.channels; channel++) {
Expand All @@ -173,7 +173,7 @@ static int acp_dmic_dma_probe(struct dma *dma)
static int acp_dmic_dma_remove(struct dma *dma)
{
if (!dma->chan) {
tr_err(&acp_dmic_dma_tr, "remove called without probe");
tr_err("remove called without probe");
return 0;
}
rfree(dma->chan);
Expand All @@ -188,11 +188,11 @@ static int acp_dmic_dma_get_data_size(struct dma_chan_data *channel,
*avail = dmic_rngbuff_size >> 1;
*free = dmic_rngbuff_size >> 1;
} else {
tr_err(&acp_dmic_dma_tr, "Channel direction Not defined %d",
tr_err("Channel direction Not defined %d",
channel->direction);
}

tr_info(&acp_dmic_dma_tr, "avail %d and free %d",
tr_info("avail %d and free %d",
avail[0], free[0]);
return 0;
}
Expand Down
10 changes: 5 additions & 5 deletions src/drivers/amd/common/acp_sp_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ static struct dma_chan_data *acp_dai_sp_dma_channel_get(struct dma *dma,
key = k_spin_lock(&dma->lock);
if (req_chan >= dma->plat_data.channels) {
k_spin_unlock(&dma->lock, key);
tr_err(&acp_sp_tr, "Channel %d not in range", req_chan);
tr_err("Channel %d not in range", req_chan);
return NULL;
}
channel = &dma->chan[req_chan];
if (channel->status != COMP_STATE_INIT) {
k_spin_unlock(&dma->lock, key);
tr_err(&acp_sp_tr, "channel already in use %d", req_chan);
tr_err("channel already in use %d", req_chan);
return NULL;
}
atomic_add(&dma->num_channels_busy, 1);
Expand Down Expand Up @@ -112,14 +112,14 @@ static int acp_dai_sp_dma_probe(struct dma *dma)
int channel;

if (dma->chan) {
tr_err(&acp_sp_tr, "Repeated probe");
tr_err("Repeated probe");
return -EEXIST;
}
dma->chan = rzalloc(SOF_MEM_ZONE_SYS_RUNTIME, 0,
SOF_MEM_CAPS_RAM, dma->plat_data.channels *
sizeof(struct dma_chan_data));
if (!dma->chan) {
tr_err(&acp_sp_tr, "Probe failure,unable to allocate channel descriptors");
tr_err("Probe failure,unable to allocate channel descriptors");
return -ENOMEM;
}
for (channel = 0; channel < dma->plat_data.channels; channel++) {
Expand All @@ -134,7 +134,7 @@ static int acp_dai_sp_dma_probe(struct dma *dma)
static int acp_dai_sp_dma_remove(struct dma *dma)
{
if (!dma->chan) {
tr_err(&acp_sp_tr, "remove called without probe,it's a no-op");
tr_err("remove called without probe,it's a no-op");
return 0;
}

Expand Down
Loading

0 comments on commit c8bf2a4

Please sign in to comment.