-
Notifications
You must be signed in to change notification settings - Fork 322
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
audio: comp_ext: workaround XCC compatibility with zephyr logging #5574
Conversation
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.
The first one we might just drop, but the perf_cnt might be more problematic. Maybe it's safer to ifdef both out just for Zephyr builds.
Failure unrelated, @lgirdwood @kv2019i Ping? |
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.
Thanks @aiChaoSONG , looks good.
@aiChaoSONG ping - can we get the comments added so this can be merged and tracked. Thanks |
You mean add the comment in code, right? The integration of zephyr log api into SOF now works well, please check the test result of #5411. I am thinking to merge the commit in this PR to PR#5411, and close this one. So PR#5411 should be ready to review. |
@lgirdwood I added some comments in the code, and test failures are not related to this PR. PR #5411 makes a lot of changes to the code, so we can merge this first, and I will rebase #5411 |
Can one of the admins verify this patch? |
@aiChaoSONG could you please point out to the code that is causing zephyrproject-rtos/zephyr#43786 - i.e. how are you adding |
SOFCI TEST |
2369932
to
775c88a
Compare
Multiple use of static inline functions that call Zephyr logging API across different C files will result in same symbol names defined in all of the corresponding object files with XCC, because XCC compiler emits the same symbol names based on the source file for those static variables inside functions. If Zephyr logging is used in SOF, we will have log context redefinition issue with XCC due to above reason. This patch workarounds the issue by removing the log calls in static inline functions that are used across multiple C files if Zephyr is used. BugLink: zephyrproject-rtos/zephyr#43786 Signed-off-by: Chao Song <chao.song@linux.intel.com>
@kkarask looks like CI got stuck, can you take a look. Thanks ! EDIT - ignore. I see the queue today, will check back later. |
The test on TGLU_UP_HDA_ZEPHYR is actually testing with IPC4, that's why we have errors. This because ipc-version.conf is left in /etc/modprobe.d by mistake. Retested. |
Thanks! So you add logging to component.h, component_ext.h and wait.h, but only component_ext.h is causing problems. Do we know why? wait.h is ok presumably because it only has one
would work with calling |
@lyakh Please check this issue zephyrproject-rtos/zephyr#43786, it is because a restriction of XCC, GCC is good. XCC cannot emit correct symbol if an inline function are called by multiple modules, for example, With this code, we are actually adding log context in functions(caller of comp_copy) in C file, actually this is not going to work, because we have a file level log context, they are going to collapse.
|
@aiChaoSONG Are you sure? When |
@lyakh I tested the code, I defined the Error Message
|
Aah, right. The reason is, that with that code static variables are defined within caller functions, not at the file scope, so other functions cannot access them. Sorry for a non-working proposal. I guess I don't have a better idea for now then than what this PR is proposing! |
@lgirdwood are we good to merge this now? so I can continue the work of #5411 |
Multiple use of static inline functions across different C
files will result in same symbol names defined in all of the
corresponding object files, because XCC compiler emits the
same symbol names based on the source file for those static
variables inside functions.
If Zephyr logging is used in SOF, we will have log context
redefinition issue with XCC due to above reason.
This patch workarounds the issue by removing the log calls
in static inline functions that are used across multiple C
files.
BugLink: zephyrproject-rtos/zephyr#43786
Signed-off-by: Chao Song chao.song@linux.intel.com