-
Notifications
You must be signed in to change notification settings - Fork 7k
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
logging: 32 bit float values don't work. #18351
Comments
A summary of the analysis only; I'd prefer @nordic-krch take on this task as it appears to be complex. The path this code takes through the logging system involves counting the number of arguments and caching one The count is a simple scan for the number of conversion specifiers. It does not take into account length modifiers or the specifier character itself, and so is incorrect when any given argument exceeds the size of A fix requires an analysis of the format string to determine the number of |
Removing 2.1 milestone |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
This is still an issue.
If these configs are enabled the system should be able to print floating point numbers regardless of print method, If this is not feasible/desirable, there should be some ASSERT or warning when using %f or %e. |
@carlescufi can this issue be reopened? |
Yes. It shouldn't have been closed. |
This is something that might be addressed if we build a fully-functional Zephyr API for printf-style formatting with stream output, which is the subject of #29203 (comment). |
With cbprintf_arglen it should now be possible to fix this and all the other bugs related to passing 64-bit values for log formatting. @nordic-krch @carlescufi |
@pabigot noted, i will take a look at that. |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
I'm running zephyr 2.4.0. |
yes, it will be addressed soon, see #30353. |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
floats can now be logged with new logging. Currently legacy version is the default one, so it has to be explicitly enabled ( |
hi have tried setting |
@manoj153 please check if float formatting is enabled in cbprintf |
yes that helps. works now |
Use deferred logging v2. After the change to deferred logging, floats were not properly printed anymore. This patch fixes this issue by using version 2 of deferred logging. Fix suggested in zephyrproject-rtos/zephyr#18351 and documented in https://docs.zephyrproject.org/latest/reference/logging/index.html Signed-off-by: Simen S. Røstad <simen.rostad@nordicsemi.no>
Use deferred logging v2. After the change to deferred logging, floats were not properly printed anymore. This patch fixes this issue by using version 2 of deferred logging. Fix suggested in zephyrproject-rtos/zephyr#18351 and documented in https://docs.zephyrproject.org/latest/reference/logging/index.html Signed-off-by: Simen S. Røstad <simen.rostad@nordicsemi.no>
Code
Output
Notes
CONFIG_LOG_ENABLE_FANCY_OUTPUT_FORMATTING=y
This uses the minimal libc print formatter for the log messages. The print formatter works for float formatting when invoked via printf, suggesting that the float value is somehow being clobbered in the log functions.
Environment
The text was updated successfully, but these errors were encountered: