The 'log_flush()' function is used to wait for all pending log messages to be processed by the background thread. This is performed by polling the 'log_data_pending()' function, which scans all available buffers. The log core already provides a 'buffered_cnt' variable that keeps track of the number of pending messages. This variable is updated atomically and could be a more efficient implementation for that check. This commit moves the 'buffered_cnt' decrement _after_ the message processing and buffer release, to ensure that the variable reflects the number of pending messages at any moment in time. The 'log_data_pending()' function is then replaced with a direct check of the 'buffered_cnt' variable. Signed-off-by: Luca Burelli <l.burelli@arduino.cc> |
||
|---|---|---|
| .. | ||
| backends | ||
| frontends | ||
| mipi_syst | ||
| CMakeLists.txt | ||
| Kconfig | ||
| Kconfig.filtering | ||
| Kconfig.formatting | ||
| 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_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 | ||