Skip to content

Commit ac05db0

Browse files
committed
Trace: remove trace context dependency
Remove it and change source file accordingly. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
1 parent aeffc83 commit ac05db0

File tree

105 files changed

+930
-994
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+930
-994
lines changed

posix/include/rtos/spinlock.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ typedef uint32_t k_spinlock_key_t;
7777
extern uint32_t lock_dbg_atomic;
7878
extern uint32_t lock_dbg_user[DBG_LOCK_USERS];
7979

80-
extern struct tr_ctx sl_tr;
81-
8280
/* panic on deadlock */
8381
#define spin_try_lock_dbg(lock, line) \
8482
do { \
@@ -115,14 +113,14 @@ extern struct tr_ctx sl_tr;
115113

116114
#define spin_lock_dbg(line) \
117115
do { \
118-
tr_info(&sl_tr, "LcE"); \
119-
tr_info(&sl_tr, "line: %d", line); \
116+
tr_info("LcE"); \
117+
tr_info("line: %d", line); \
120118
} while (0)
121119

122120
#define spin_unlock_dbg(line) \
123121
do { \
124-
tr_info(&sl_tr, "LcX"); \
125-
tr_info(&sl_tr, "line: %d", line); \
122+
tr_info("LcX"); \
123+
tr_info("line: %d", line); \
126124
} while (0)
127125

128126
#else /* CONFIG_DEBUG_LOCKS_VERBOSE */

posix/include/rtos/wait.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ static inline void wait_for_interrupt(int level)
2929
{
3030
LOG_MODULE_DECLARE(wait, CONFIG_SOF_LOG_LEVEL);
3131

32-
tr_dbg(&wait_tr, "WFE");
32+
tr_dbg("WFE");
3333
#if CONFIG_DEBUG_LOCKS
3434
if (lock_dbg_atomic)
3535
tr_err_atomic("atm");
3636
#endif
3737
platform_wait_for_interrupt(level);
38-
tr_dbg(&wait_tr, "WFX");
38+
tr_dbg("WFX");
3939
}
4040

4141
/**

posix/include/sof/lib/perf_cnt.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct perf_cnt_data {
3030
#if CONFIG_PERFORMANCE_COUNTERS
3131

3232
#define perf_cnt_trace(ctx, pcd) \
33-
tr_info(ctx, "perf plat last %u peak %u cpu last %u, peak %u", \
33+
tr_info("perf plat last %u peak %u cpu last %u, peak %u", \
3434
(uint32_t)((pcd)->plat_delta_last), \
3535
(uint32_t)((pcd)->plat_delta_peak), \
3636
(uint32_t)((pcd)->cpu_delta_last), \
@@ -78,7 +78,7 @@ struct perf_cnt_data {
7878
/* perf measurement windows size 2^x */
7979
#define PERF_CNT_CHECK_WINDOW_SIZE 10
8080
#define task_perf_avg_info(pcd, task_p, class) \
81-
tr_info(task_p, "perf_cycle task %p, %pU cpu avg %u peak %u",\
81+
tr_info("perf_cycle task %p, %pU cpu avg %u peak %u",\
8282
class, (class)->uid, \
8383
(uint32_t)((pcd)->cpu_delta_sum), \
8484
(uint32_t)((pcd)->cpu_delta_peak))

src/audio/base_fw.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,10 @@ static int fw_config_set_force_l1_exit(const struct sof_tlv *tlv)
425425
const uint32_t force = tlv->value[0];
426426

427427
if (force) {
428-
tr_info(&basefw_comp_tr, "FW config set force dmi l0 state");
428+
tr_info("FW config set force dmi l0 state");
429429
intel_adsp_force_dmi_l0_state();
430430
} else {
431-
tr_info(&basefw_comp_tr, "FW config set allow dmi l1 state");
431+
tr_info("FW config set allow dmi l1 state");
432432
intel_adsp_allow_dmi_l1_state();
433433
}
434434

@@ -451,7 +451,7 @@ static int basefw_set_fw_config(bool first_block,
451451
default:
452452
break;
453453
}
454-
tr_warn(&basefw_comp_tr, "returning success for Set FW_CONFIG without handling it");
454+
tr_warn("returning success for Set FW_CONFIG without handling it");
455455
return 0;
456456
}
457457

@@ -485,7 +485,7 @@ static int basefw_get_large_config(struct comp_dev *dev,
485485
case IPC4_EXTENDED_SYSTEM_TIME:
486486
ret = basefw_get_ext_system_time(data_offset, data);
487487
if (ret == IPC4_UNAVAILABLE) {
488-
tr_warn(&basefw_comp_tr, "returning success for get host EXTENDED_SYSTEM_TIME without handling it");
488+
tr_warn("returning success for get host EXTENDED_SYSTEM_TIME without handling it");
489489
return 0;
490490
} else {
491491
return ret;

src/audio/buffer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, u
3333
struct comp_buffer *buffer;
3434
void *stream_addr;
3535

36-
tr_dbg(&buffer_tr, "buffer_alloc()");
36+
tr_dbg("buffer_alloc()");
3737

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

5050
if (!buffer) {
51-
tr_err(&buffer_tr, "buffer_alloc(): could not alloc structure");
51+
tr_err("buffer_alloc(): could not alloc structure");
5252
return NULL;
5353
}
5454

@@ -58,7 +58,7 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, u
5858
stream_addr = rballoc_align(0, caps, size, align);
5959
if (!stream_addr) {
6060
rfree(buffer);
61-
tr_err(&buffer_tr, "buffer_alloc(): could not alloc size = %u bytes of type = %u",
61+
tr_err("buffer_alloc(): could not alloc size = %u bytes of type = %u",
6262
size, caps);
6363
return NULL;
6464
}

src/audio/chain_dma.c

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ static void handle_xrun(struct chain_dma_data *cd)
147147

148148
if (cd->link_connector_node_id.f.dma_type == ipc4_hda_link_output_class &&
149149
!cd->xrun_notification_sent) {
150-
tr_warn(&chain_dma_tr, "handle_xrun(): underrun detected");
150+
tr_warn("handle_xrun(): underrun detected");
151151
xrun_notif_msg_init(cd->msg_xrun, cd->link_connector_node_id.dw,
152152
SOF_IPC4_GATEWAY_UNDERRUN_DETECTED);
153153
ipc_msg_send(cd->msg_xrun, NULL, true);
154154
cd->xrun_notification_sent = true;
155155
} else if (cd->link_connector_node_id.f.dma_type == ipc4_hda_link_input_class &&
156156
!cd->xrun_notification_sent) {
157-
tr_warn(&chain_dma_tr, "handle_xrun(): overrun detected");
157+
tr_warn("handle_xrun(): overrun detected");
158158
xrun_notif_msg_init(cd->msg_xrun, cd->link_connector_node_id.dw,
159159
SOF_IPC4_GATEWAY_OVERRUN_DETECTED);
160160
ipc_msg_send(cd->msg_xrun, NULL, true);
@@ -185,14 +185,14 @@ static enum task_state chain_task_run(void *data)
185185
case 0:
186186
break;
187187
case -EPIPE:
188-
tr_warn(&chain_dma_tr, "chain_task_run(): dma_get_status() link xrun occurred,"
188+
tr_warn("chain_task_run(): dma_get_status() link xrun occurred,"
189189
" ret = %u", ret);
190190
#if CONFIG_XRUN_NOTIFICATIONS_ENABLE
191191
handle_xrun(cd);
192192
#endif
193193
break;
194194
default:
195-
tr_err(&chain_dma_tr, "chain_task_run(): dma_get_status() error, ret = %u", ret);
195+
tr_err("chain_task_run(): dma_get_status() error, ret = %u", ret);
196196
return SOF_TASK_STATE_COMPLETED;
197197
}
198198

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

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

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

229228
ret = dma_reload(cd->chan_link->dma->z_dev, cd->chan_link->index, 0, 0, increment);
230229
if (ret < 0) {
231-
tr_err(&chain_dma_tr,
232-
"chain_task_run(): dma_reload() link error, ret = %u", ret);
230+
tr_err("chain_task_run(): dma_reload() link error, ret = %u", ret);
233231
return SOF_TASK_STATE_COMPLETED;
234232
}
235233
} else {
@@ -246,9 +244,8 @@ static enum task_state chain_task_run(void *data)
246244
cd->chan_link->index, 0, 0,
247245
half_buff_size);
248246
if (ret < 0) {
249-
tr_err(&chain_dma_tr,
250-
"chain_task_run(): dma_reload() link error, ret = %u",
251-
ret);
247+
tr_err("chain_task_run(): dma_reload() link error, ret = %u",
248+
ret);
252249
return SOF_TASK_STATE_COMPLETED;
253250
}
254251
cd->first_data_received = true;
@@ -262,8 +259,7 @@ static enum task_state chain_task_run(void *data)
262259
ret = dma_reload(cd->chan_host->dma->z_dev, cd->chan_host->index,
263260
0, 0, transferred);
264261
if (ret < 0) {
265-
tr_err(&chain_dma_tr,
266-
"chain_task_run(): dma_reload() host error, ret = %u", ret);
262+
tr_err("chain_task_run(): dma_reload() host error, ret = %u", ret);
267263
return SOF_TASK_STATE_COMPLETED;
268264
}
269265

@@ -272,7 +268,7 @@ static enum task_state chain_task_run(void *data)
272268
ret = dma_reload(cd->chan_link->dma->z_dev, cd->chan_link->index,
273269
0, 0, half_buff_size);
274270
if (ret < 0) {
275-
tr_err(&chain_dma_tr, "chain_task_run(): dma_reload() "
271+
tr_err("chain_task_run(): dma_reload() "
276272
"link error, ret = %u", ret);
277273
return SOF_TASK_STATE_COMPLETED;
278274
}

src/audio/channel_map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct sof_ipc_channel_map *chmap_get(struct sof_ipc_stream_map *smap,
3030
uint32_t byte = 0;
3131

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

3636
return NULL;

src/audio/dp_queue.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,14 +288,14 @@ struct dp_queue *dp_queue_create(size_t min_available, size_t min_free_space, ui
288288
goto err;
289289

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

295295
/* return a pointer to allocated structure */
296296
return dp_queue;
297297
err:
298-
tr_err(&dp_queue_tr, "DpQueue creation failure");
298+
tr_err("DpQueue creation failure");
299299
rfree(dp_queue);
300300
return NULL;
301301
}

src/drivers/amd/common/acp_dma.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ static struct dma_chan_data *acp_dma_channel_get(struct dma *dma,
6060
key = k_spin_lock(&dma->lock);
6161
if (req_chan >= dma->plat_data.channels) {
6262
k_spin_unlock(&dma->lock, key);
63-
tr_err(&acpdma_tr, "DMA: Channel %d not in range", req_chan);
63+
tr_err("DMA: Channel %d not in range", req_chan);
6464
return NULL;
6565
}
6666
channel = &dma->chan[req_chan];
6767
if (channel->status != COMP_STATE_INIT) {
6868
k_spin_unlock(&dma->lock, key);
69-
tr_err(&acpdma_tr, "DMA: channel already in use %d", req_chan);
69+
tr_err("DMA: channel already in use %d", req_chan);
7070
return NULL;
7171
}
7272
atomic_add(&dma->num_channels_busy, 1);
@@ -199,14 +199,14 @@ static int acp_dma_start(struct dma_chan_data *channel)
199199
return 0;
200200
} while (platform_timer_get(timer) <= deadline);
201201

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

204204
return -ETIME;
205205
}
206206

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

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

287287
if (dma->chan) {
288-
tr_err(&acpdma_tr, "DMA: Already probe");
288+
tr_err("DMA: Already probe");
289289
return -EEXIST;
290290
}
291291
dma->chan = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM,
292292
dma->plat_data.channels *
293293
sizeof(struct dma_chan_data));
294294
if (!dma->chan) {
295-
tr_err(&acpdma_tr, "DMA: unable to allocate channel context");
295+
tr_err("DMA: unable to allocate channel context");
296296
return -ENOMEM;
297297
}
298298
for (channel = 0; channel < dma->plat_data.channels; channel++) {
@@ -304,7 +304,7 @@ static int acp_dma_probe(struct dma *dma)
304304
sizeof(struct acp_dma_chan_data));
305305
if (!acp_dma_chan) {
306306
rfree(dma->chan);
307-
tr_err(&acpdma_tr, "acp-dma: %d channel %d private data alloc failed",
307+
tr_err("acp-dma: %d channel %d private data alloc failed",
308308
dma->plat_data.id, channel);
309309
return -ENOMEM;
310310
}
@@ -318,7 +318,7 @@ static int acp_dma_remove(struct dma *dma)
318318
int channel;
319319

320320
if (!dma->chan) {
321-
tr_err(&acpdma_tr, "DMA: Invalid remove call");
321+
tr_err("DMA: Invalid remove call");
322322
return 0;
323323
}
324324
for (channel = 0; channel < dma->plat_data.channels; channel++)
@@ -379,7 +379,7 @@ static int acp_dma_get_data_size(struct dma_chan_data *channel,
379379
*free = ABS(data_size) / 2;
380380
break;
381381
default:
382-
tr_err(&acpdma_tr, "dma_get_data_size() Invalid direction %d",
382+
tr_err("dma_get_data_size() Invalid direction %d",
383383
channel->direction);
384384
return -EINVAL;
385385
}

0 commit comments

Comments
 (0)