zephyr/subsys/logging
Luca Burelli 802156c0cb logging: improve log_flush() robustness
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>
2025-02-11 15:39:29 +01:00
..
backends logging: fs backend: simplify checking if file exists 2025-02-07 14:33:35 +01:00
frontends logging: frontends: stmesp: Fix logging single argument log twice 2025-01-24 15:43:19 +01:00
mipi_syst
CMakeLists.txt logging: Move frontends to the dedicated directory 2024-09-06 11:31:27 -04:00
Kconfig logging: Move frontends to the dedicated directory 2024-09-06 11:31:27 -04:00
Kconfig.filtering logging: Allow runtime filtering for frontend only case 2024-07-09 14:01:56 +02:00
Kconfig.formatting logging: remove part for when gmtime_r is not available 2024-12-10 08:06:25 +01:00
Kconfig.links
Kconfig.misc logging: log_cmds: Enable log commands for shell with the logging frontend 2024-10-17 10:48:25 -04:00
Kconfig.mode
Kconfig.processing logging: increase the maximum value of LOG_BUFFER_SIZE 2024-12-12 19:59:51 +01:00
Kconfig.template.log_config
Kconfig.template.log_config_inherit
Kconfig.template.log_format_config logging: Fix LOG_OUTPUT dependency 2024-10-09 18:37:49 +01:00
log_cache.c
log_cache.h
log_cmds.c logging: log_cmds: init uninitialized backend on log_go() 2025-02-04 15:00:58 +01:00
log_core.c logging: improve log_flush() robustness 2025-02-11 15:39:29 +01:00
log_link_ipc_service.c
log_mgmt.c logging: init backend id regardless of autostart 2025-02-04 15:00:58 +01:00
log_minimal.c
log_msg.c logging: Add log_source_id helper function 2024-10-08 16:57:59 +02:00
log_multidomain_link.c
log_output_custom.c
log_output_dict.c logging: log_output: Move flushing and writing to the header 2024-10-09 18:37:49 +01:00
log_output_syst.c logging: Add log_source_id helper function 2024-10-08 16:57:59 +02:00
log_output.c logging: log_output: move partly unused code 2024-12-10 08:06:25 +01:00