Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/init/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ static int primary_core_init(int argc, char *argv[], struct sof *sof)
interrupt_init(sof);
#endif /* __ZEPHYR__ */

#if CONFIG_TRACE
trace_point(TRACE_BOOT_SYS_TRACES);
trace_init(sof);
#endif

trace_point(TRACE_BOOT_SYS_NOTIFIER);
init_system_notify(sof);
Expand All @@ -151,6 +149,9 @@ static int primary_core_init(int argc, char *argv[], struct sof *sof)

trace_point(TRACE_BOOT_PLATFORM);

/* now start the trace */
trace_on();

#if CONFIG_NO_SECONDARY_CORE_ROM
lp_sram_unpack();
#endif
Expand Down
1 change: 0 additions & 1 deletion src/trace/dma-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ int dma_trace_init_complete(struct dma_trace_data *d)
SOF_TASK_PRI_MED, trace_work, d, 0, 0);

out:

return ret;
Copy link
Collaborator

@dbaluta dbaluta Aug 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, calling dma_trace_init_complete will turn the tracing on BUT calling trace_init will not turn the tracing ON.

I feel that the normal sequence of enabling tracing should be:

dma_trace_init_complete()
trace_on()

I think is called DMA trace.

And for the other trace we shold do:

trace_init()
trace_on()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, moving and unifying the trace_on() invoking to the end of primary_core_init() looks better to me.

}

Expand Down
4 changes: 1 addition & 3 deletions src/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,8 @@ void trace_log_filtered(bool send_atomic, const void *log_entry, const struct tr
uint64_t current_ts;
#endif /* CONFIG_TRACE_FILTERING_ADAPTIVE */

if (!trace->enable) {
if (!trace || !trace->enable)
return;
}

#if CONFIG_TRACE_FILTERING_VERBOSITY
if (!trace_filter_verbosity(lvl, ctx))
Expand Down Expand Up @@ -512,7 +511,6 @@ void trace_off(void)
void trace_init(struct sof *sof)
{
sof->trace = rzalloc(SOF_MEM_ZONE_SYS_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*sof->trace));
sof->trace->enable = 1;
sof->trace->pos = 0;
#if CONFIG_TRACE_FILTERING_ADAPTIVE
sof->trace->user_filter_override = false;
Expand Down