Some compilers (e.g. riscv32) does not handle well complex macros for logging. Generated code is bigger than expected (e.g. riscv32 code is almost twice bigger than cortex-m code). Use of logging can lead to unexpected code increase. To handle that an analysis of the zephyr code base was performed and it shown that 75-80% of logs are simple strings with 0 arguments (~45%), one 32 bit argument (~26%) or two 32 bit arguments (~6%). Given that a set of dedicated macro were created which are applied to those 3 cases which on 32 bit platform create very simple log messages without padding or alignment needed. Such dedicated macros save up to 40% of code (riscv32) and also executes 30% faster (arm cortex and riscv32). Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no> |
||
|---|---|---|
| .. | ||
| backends | ||
| mipi_syst | ||
| CMakeLists.txt | ||
| Kconfig | ||
| Kconfig.filtering | ||
| Kconfig.formatting | ||
| Kconfig.frontends | ||
| Kconfig.links | ||
| Kconfig.misc | ||
| Kconfig.mode | ||
| Kconfig.processing | ||
| Kconfig.template.log_config | ||
| Kconfig.template.log_config_inherit | ||
| Kconfig.template.log_format_config | ||
| log_cache.c | ||
| log_cache.h | ||
| log_cmds.c | ||
| log_core.c | ||
| log_frontend_dict_uart.c | ||
| log_link_ipc_service.c | ||
| log_mgmt.c | ||
| log_minimal.c | ||
| log_msg.c | ||
| log_multidomain_link.c | ||
| log_output_custom.c | ||
| log_output_dict.c | ||
| log_output_syst.c | ||
| log_output.c | ||