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

#if defined(UNIT_TEST)
#if defined(UNIT_TEST) || !defined(CONFIG_TRACE)
#define TRACE_CONTEXT_SECTION
#else
#define TRACE_CONTEXT_SECTION __section(".trace_ctx")
Expand Down
21 changes: 0 additions & 21 deletions zephyr/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,29 +167,8 @@ unsigned int _xtos_ints_off(unsigned int mask)
return 0;
}

/* Zephyr redefines log_message() and mtrace_printf() which leaves
* totally empty the .static_log_entries ELF sections for the
* sof-logger. This makes smex fail. Define at least one such section to
* fix the build when sof-logger is not used.
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

should sof-logger -l support also be removed?

Copy link
Contributor Author

@LaurentiuM1234 LaurentiuM1234 Sep 20, 2024

Choose a reason for hiding this comment

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

not sure that's a good idea. As far as I can tell there's still some AMD (?) platforms and imx8m using XTOS. I don't have the toolchain right now to test but smex should still be included in those builds. AFAICT removing -l from the logger would break the only way of logging for those platforms (as you need the ldc file for it to work).

CC: @marc-hb please do correct me if I'm wrong here. Haven't really used sof-logger in a while :(

LE: just noticed #9421, sorry for any unnecessary recent tags/review requests :(

static inline const void *smex_placeholder_f(void)
{
_DECLARE_LOG_ENTRY(LOG_LEVEL_DEBUG,
"placeholder so .static_log.X are not all empty",
_TRACE_INV_CLASS, 0);

return &log_entry;
}

/* Need to actually use the function and export something otherwise the
* compiler optimizes everything away.
*/
const void *_smex_placeholder;

int task_main_start(struct sof *sof)
{
_smex_placeholder = smex_placeholder_f();

/* init default audio components */
sys_comp_init(sof);

Expand Down