Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 367
Zephyr preproc.h implementation (OPTION B)#9603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
915dc235bbaa1e6ec959040f09116e167caFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -6,9 +6,12 @@ menu "Trace" | ||
| config TRACE | ||
| bool "Trace" | ||
| default n if ZEPHYR_SOF_MODULE | ||
lgirdwood marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| default y | ||
| help | ||
| Enabling traces. All traces (normal and error) are sent by dma. | ||
| Enable SOF DMA based traces compatible with the sof-logger tool. | ||
| With Zephyr, RTOS side events are not seen in the SOF trace, so native | ||
| Zephyr logging (CONFIG_ZEPHYR_LOG) is recommended instead. | ||
| config TRACEV | ||
| bool "Trace verbose" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* SPDX-License-Identifier: BSD-3-Clause | ||
| * | ||
| * Copyright(c) 2024 Intel Corporation. | ||
| */ | ||
| #ifndef __SOF_TRACE_PREPROC_H__ | ||
| #define __SOF_TRACE_PREPROC_H__ | ||
| #ifdef CONFIG_TRACE | ||
| #error "SOF dma-trace (CONFIG_TRACE) not supported in Zephyr builds. \ | ||
| Please use CONFIG_ZEPHYR_LOG instead." | ||
| #endif | ||
| #ifndef CONFIG_ZEPHYR_LOG | ||
| /* | ||
| * Unlike the XTOS version of this macro, this does not silence all | ||
| * compiler warnings about unused variables. | ||
| */ | ||
| #define SOF_TRACE_UNUSED(arg1, ...) ((void)arg1) | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doesn't silence all - is it because of the lack of recursion? Leaving the rest of the arguments without
| ||
| #endif /* CONFIG_ZEPHYR_LOG */ | ||
| #endif /* __SOF_TRACE_PREPROC_H__ */ | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first I didn't like this, because it adds less than pretty code to potentially many locations (we need to handle information-, warning- and error-level messages similarly, right?), but then I thought, that if we have an automated way to identify all these locations, then maybe this is the best way to handle them. Firstly it's honest and explicit - it helps keep track of such cases and maybe avoid adding variables that can easily be avoided. The same holds for variables, only used in
assert()calls, right? So, yes, I'd buy this.