You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Issues with using Zephyr CONFIG_LOG_MIPI_SYST_USE_CATALOG with SOF #7703
Hmm, interesting, I tried SYS_USE_CATALOG with SOF2.5 (uses 9ff0732 , Zephyr ~3.3 e3ae110a05d3427647a03fcbeff4478c195c5a48 and Zephyr SDK 0.15), and SYST_USE_CATALOG works with that combination. So this is potentially a regression on Zephyr side (I see no changes on SOF side). FYI @dcpleung
commit caea9dc1966588de0a6ea712cb388d237acbfa83
Author: Kumar Gala <kumar.gala@intel.com>
Date: Thu Mar 16 05:55:18 2023 +0000
logging: Use TYPE_SECTION macros for log strings
Clean up log_strings to utilize macros for handling sections.
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
Tested reverting the "logging: Use TYPE_SECTION macros" , but did not seem to help. Filed a bug now to Zephyr side for better tracking. I'll try to bisect better when I just have the chance.
Any instructions on how to reproduce it on hardware? I have a UPX11 to test on. Meanwhile, I will try running Sys-T under QEMU to see if I can reproduce it using Zephyr's sample app.
@dcpleung
Basicly you need to rebuild SOF for tgl with following:
+++ b/app/prj.conf
@@ -25,6 +25,14 @@ CONFIG_LOG_BUFFER_SIZE=4096
# Use stack that is sufficient for SOF backends
CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=4096
+CONFIG_LOG_BACKEND_ADSP_MTRACE=y
+CONFIG_LOG_BACKEND_ADSP_MTRACE_OUTPUT_SYST=y
+CONFIG_LOG_MIPI_SYST_ENABLE=y
+CONFIG_LOG_MIPI_SYST_USE_CATALOG=y
For debugging, I additionally set "CONFIG_LOG_PRINTK=n" in work/sof/app/prj.conf and use the cavstool.py to observe the printk output.
I'm also trying to reproduce with the Zephyr unit test for syst. I got the unit test built for TGL UP i11 -- I got it to run but test never completes and there was no output. So I might have hit the same bug, or some user-error on my part.
Progress on both issues. One is a regression and another is missing definition in xt-clang toolchain setup ( zephyrproject-rtos/zephyr#58499 ). USE_CATALOG does require full libc support, and now one more issue is hit when using xt-clang is that the libc implemntation provided with xt-clang is not complete and build fails to link errors:
/home/kvehmane/xtensa/XtDevTools/install/tools/RI-2022.10-linux/XtensaTools/bin/xtensa-elf-ld: zephyr/libzephyr.a(cbprintf_packaged.c.obj):(.literal.cbvprintf_package+0x2c): undefined reference to `strlen'
/home/kvehmane/xtensa/XtDevTools/install/tools/RI-2022.10-linux/XtensaTools/bin/xtensa-elf-ld: zephyr/libzephyr.a(cbprintf_packaged.c.obj):(.literal.cbvprintf_package+0x34): undefined reference to `memcpy'
/home/kvehmane/xtensa/XtDevTools/install/tools/RI-2022.10-linux/XtensaTools/bin/xtensa-elf-ld: zephyr/libzephyr.a(cbprintf_packaged.c.obj): in function `cbvprintf_package':
/home/kvehmane/pr-ssd/f33-zephyrsof/work/zephyr/lib/os/cbprintf_packaged.c:675: undefined reference to `strlen'
/home/kvehmane/xtensa/XtDevTools/install/tools/RI-2022.10-linux/XtensaTools/bin/xtensa-elf-ld: /home/kvehmane/pr-ssd/f33-zephyrsof/work/zephyr/lib/os/
We now have at least RFC level solutions for all issues. Using these, I did a quick comparison of the code size impact of enabling MIPI_SYST_USE_CATALOG logging (SYST_CAT). Following is a Intel MTL build with xt-clang toolchain default params from SOF main:
Runtime performance: ~ around same cost to calling context
Overall image size: 810 KiB (SYST-CAT) versus 867 KiB (TEXT), difference of -57 KiB
Example sections with notable differences
- .text -> 317 KiB vs 385 KiB, difference of -68 KiB
- .rodata -> 317 KiB vs 360 KiB, difference of -43 KiB
- .log_strings -> 55 KiB vs 0 KiB, difference of +55KiB
Activity
kv2019i commentedon May 29, 2023
FYI @abonislawski @marc-hb @dbaluta @nashif @lgirdwood @mwasko
kv2019i commentedon May 29, 2023
Hmm, interesting, I tried SYS_USE_CATALOG with SOF2.5 (uses 9ff0732 , Zephyr ~3.3 e3ae110a05d3427647a03fcbeff4478c195c5a48 and Zephyr SDK 0.15), and SYST_USE_CATALOG works with that combination. So this is potentially a regression on Zephyr side (I see no changes on SOF side). FYI @dcpleung
dcpleung commentedon May 30, 2023
Maybe it's due to
kv2019i commentedon May 31, 2023
Tested reverting the "logging: Use TYPE_SECTION macros" , but did not seem to help. Filed a bug now to Zephyr side for better tracking. I'll try to bisect better when I just have the chance.
dcpleung commentedon May 31, 2023
Any instructions on how to reproduce it on hardware? I have a UPX11 to test on. Meanwhile, I will try running Sys-T under QEMU to see if I can reproduce it using Zephyr's sample app.
kv2019i commentedon May 31, 2023
@dcpleung
Basicly you need to rebuild SOF for tgl with following:
On UP i11, you will have to install the binary to IPC4 location and enable IPC4 in kernel. See instructions (to install SOF2.5 release on TGL systems) at :
https://github.com/thesofproject/sof-bin/tree/main/v2.5.x
The syst logs should come out with (https://github.com/thesofproject/sof/blob/main/tools/mtrace/mtrace-reader.py)
sh> sudo mtrace-reader.py
For debugging, I additionally set "CONFIG_LOG_PRINTK=n" in work/sof/app/prj.conf and use the cavstool.py to observe the printk output.
I'm also trying to reproduce with the Zephyr unit test for syst. I got the unit test built for TGL UP i11 -- I got it to run but test never completes and there was no output. So I might have hit the same bug, or some user-error on my part.
kv2019i commentedon May 31, 2023
Progress on both issues. One is a regression and another is missing definition in xt-clang toolchain setup ( zephyrproject-rtos/zephyr#58499 ). USE_CATALOG does require full libc support, and now one more issue is hit when using xt-clang is that the libc implemntation provided with xt-clang is not complete and build fails to link errors:
kv2019i commentedon Jun 1, 2023
We now have at least RFC level solutions for all issues. Using these, I did a quick comparison of the code size impact of enabling MIPI_SYST_USE_CATALOG logging (SYST_CAT). Following is a Intel MTL build with xt-clang toolchain default params from SOF main:
- .text -> 317 KiB vs 385 KiB, difference of -68 KiB
- .rodata -> 317 KiB vs 360 KiB, difference of -43 KiB
- .log_strings -> 55 KiB vs 0 KiB, difference of +55KiB
This is with zephyrproject-rtos/zephyr#58757 that allows to use minimal libc with mipi-syst-lib.
kv2019i commentedon Jun 20, 2023
One issue solved (ability to use mipi-syst library with minimal libc now possible with Zephyr mainline).
Unfortunately a new issue found on MTL where DSP crashes when catalog feature is enabled -> #7839
kv2019i commentedon Sep 5, 2023
I'm happy to report the last blocking bug has been solved in mainline (just did a retest today), so we can close this.
kv2019i commentedon Sep 5, 2023
FYI @dcpleung finally it all works! :)