-
Describe the bug I was trying to enable a log in console. To Reproduce
Expected behavior Impact Environment (please complete the following information):
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Here is repo with my changes |
Beta Was this translation helpful? Give feedback.
-
I don't think going with LOG_MODE_MINIMAL will give you the desired fast output due to the very nature how USB works (host initiates every single transaction). The biggest limiting factor currently is that when CDC ACM is used as console, then every single character output to console tends to get transmitted in its own transfer. That is, on host you get 1 byte per URB which is seriously limiting the throughput. The console uart driver writes the characters with zephyr/drivers/console/uart_console.c Lines 77 to 95 in 85a7d0c which calls cdc_acm_poll_out :zephyr/subsys/usb/device/class/cdc_acm.c Lines 988 to 1020 in 85a7d0c
Therefore, if the console output happens in lower priority (i.e. any preemptive priority) then you'll essentially get one character at a time. You can get more characters at a time (which allows greater throughput, which is essentially what @DuMaM seems to want) by changing USB_WORKQUEUE_PRIORITY to lower priority (e.g. to 1; lowest cooperative priority is higher than any preemptive priority) but that might bring unforeseen issues. @pfalcon Any idea how to handle it? I think the USB workqueue being cooperative is generally good, however it clearly messes up with the possibility to fill up console buffer. |
Beta Was this translation helpful? Give feedback.
-
@DuMaM Could you please check if #53003 gives you enough speedup when used with deferred logging? |
Beta Was this translation helpful? Give feedback.
-
I need to send a lot of data. Throughput is one problem, but the second one is a space amount i have. |
Beta Was this translation helpful? Give feedback.
-
Minimal logging is working just fine with CDC ACM console when I disable CDC ACM logging. I think the only way around that is to either remove the CDC ACM logging completely or to fail build if CDC ACM is used as console and CDC ACM log level is not Off (done in #53032). |
Beta Was this translation helpful? Give feedback.
Minimal logging is working just fine with CDC ACM console when I disable CDC ACM logging. I think the only way around that is to either remove the CDC ACM logging completely or to fail build if CDC ACM is used as console and CDC ACM log level is not Off (done in #53032).