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
8 changes: 6 additions & 2 deletions src/include/sof/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,11 @@ struct tr_ctx {
uint32_t level; /**< Default log level */
};

/* todo: put in a section to iterate over later while cfg log levels */
#if defined(UNIT_TEST)
#define TRACE_CONTEXT_SECTION
#else
#define TRACE_CONTEXT_SECTION __section(".trace_ctx")
#endif

/**
* Declares trace context.
Expand All @@ -306,7 +310,7 @@ struct tr_ctx {
* @param default_log_level Default log level.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Cc: @crazoes

@ktrzcinx looks good to me. Can you add a little bit more information in the commit message or here in comments on why do we want to iterate over the trace context entries.

And what does it mean 'the right one'? What are we looking for. Maybe describe a little bit how this works.

Copy link
Member Author

Choose a reason for hiding this comment

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

I extended commit description

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ktrzcinx thanks! Looks good to me.

*/
#define DECLARE_TR_CTX(ctx_name, uuid, default_log_level) \
struct tr_ctx ctx_name = { \
struct tr_ctx ctx_name TRACE_CONTEXT_SECTION = { \
.uuid_p = uuid, \
.level = default_log_level, \
}
Expand Down
3 changes: 3 additions & 0 deletions src/platform/apollolake/apollolake.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,9 @@ SECTIONS
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
KEEP(*(.jcr))
_trace_ctx_start = ABSOLUTE(.);
*(.trace_ctx)
_trace_ctx_end = ABSOLUTE(.);
_data_end = ABSOLUTE(.);
} >sof_fw :sof_fw_phdr

Expand Down
3 changes: 3 additions & 0 deletions src/platform/baytrail/baytrail.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ SECTIONS
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
KEEP(*(.jcr))
_trace_ctx_start = ABSOLUTE(.);
*(.trace_ctx)
_trace_ctx_end = ABSOLUTE(.);
_data_end = ABSOLUTE(.);
} >sof_data :sof_data_phdr

Expand Down
3 changes: 3 additions & 0 deletions src/platform/cannonlake/cannonlake.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ SECTIONS
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
KEEP(*(.jcr))
_trace_ctx_start = ABSOLUTE(.);
*(.trace_ctx)
_trace_ctx_end = ABSOLUTE(.);
_data_end = ABSOLUTE(.);
} >sof_fw :sof_fw_phdr

Expand Down
3 changes: 3 additions & 0 deletions src/platform/haswell/haswell.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ SECTIONS
*(.gnu.linkonce.s2.*)
KEEP(*(.jcr))
_data_end = ABSOLUTE(.);
_trace_ctx_start = ABSOLUTE(.);
*(.trace_ctx)
_trace_ctx_end = ABSOLUTE(.);
} >sof_data :sof_data_phdr

.lit4 : ALIGN(4)
Expand Down
3 changes: 3 additions & 0 deletions src/platform/icelake/icelake.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ SECTIONS
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
KEEP(*(.jcr))
_trace_ctx_start = ABSOLUTE(.);
*(.trace_ctx)
_trace_ctx_end = ABSOLUTE(.);
_data_end = ABSOLUTE(.);
} >sof_fw :sof_fw_phdr

Expand Down
3 changes: 3 additions & 0 deletions src/platform/imx8/imx8.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ SECTIONS
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
KEEP(*(.jcr))
_trace_ctx_start = ABSOLUTE(.);
*(.trace_ctx)
_trace_ctx_end = ABSOLUTE(.);
_data_end = ABSOLUTE(.);
} >sof_sdram0 :sof_sdram0_phdr

Expand Down
3 changes: 3 additions & 0 deletions src/platform/imx8m/imx8m.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ SECTIONS
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
KEEP(*(.jcr))
_trace_ctx_start = ABSOLUTE(.);
*(.trace_ctx)
_trace_ctx_end = ABSOLUTE(.);
_data_end = ABSOLUTE(.);
} >sof_sdram0 :sof_sdram0_phdr

Expand Down
3 changes: 3 additions & 0 deletions src/platform/suecreek/suecreek.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ SECTIONS
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
KEEP(*(.jcr))
_trace_ctx_start = ABSOLUTE(.);
*(.trace_ctx)
_trace_ctx_end = ABSOLUTE(.);
_data_end = ABSOLUTE(.);
} >sof_fw :sof_fw_phdr

Expand Down
3 changes: 3 additions & 0 deletions src/platform/tigerlake/tigerlake.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,9 @@ SECTIONS
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
KEEP(*(.jcr))
_trace_ctx_start = ABSOLUTE(.);
*(.trace_ctx)
_trace_ctx_end = ABSOLUTE(.);
_data_end = ABSOLUTE(.);
} >sof_fw :sof_fw_phdr

Expand Down