Skip to content

Commit 188d2df

Browse files
wojciechslenskastephanosio
authored andcommitted
shell: shell_log_backend: take buffer size from config
Use LOG_MESSAGE_QUEUE_SIZE config instead of hardcoded value. LOG_MESSAGE_QUEUE_SIZE default value has been changed to 512, so it is now matching to the hardcoded value. Signed-off-by: Wojciech Slenska <[email protected]>
1 parent a9bfe0a commit 188d2df

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

include/zephyr/shell/shell_log_backend.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ int z_shell_log_backend_output_func(uint8_t *data, size_t length, void *ctx);
7272
LOG_OUTPUT_DEFINE(_name##_log_output, z_shell_log_backend_output_func,\
7373
_buf, _size); \
7474
static struct shell_log_backend_control_block _name##_control_block; \
75-
static uint32_t __aligned(Z_LOG_MSG2_ALIGNMENT) _name##_buf[128]; \
75+
static uint32_t __aligned(Z_LOG_MSG2_ALIGNMENT) \
76+
_name##_buf[_queue_size / sizeof(uint32_t)]; \
7677
const struct mpsc_pbuf_buffer_config _name##_mpsc_buffer_config = { \
7778
.buf = _name##_buf, \
7879
.size = ARRAY_SIZE(_name##_buf), \

subsys/shell/Kconfig.template.shell_log_queue_size

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ config $(module)_LOG_MESSAGE_QUEUE_SIZE
44
int "Log message queue size"
55
default $(default-size)
66
help
7-
Amount of messages that can enqueued in order to be processed by shell
8-
thread. Too small queue may lead to logger thread being blocked
7+
Size of buffer for messages that can be enqueued in order to be processed
8+
by shell thread. Too small queue may lead to the logger thread being blocked
99
(see $(module)_LOG_MESSAGE_QUEUE_TIMEOUT). Too big queue on relatively
10-
slow shell transport may lead to situation where logs are dropped
10+
slow shell transport may lead to situations where logs are dropped
1111
because all log messages are enqueued.

subsys/shell/backends/Kconfig.backends

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ module = SHELL_BACKEND_SERIAL
8282
default-timeout = 100
8383
source "subsys/shell/Kconfig.template.shell_log_queue_timeout"
8484

85-
default-size = 10
85+
default-size = 512
8686
source "subsys/shell/Kconfig.template.shell_log_queue_size"
8787

8888
choice

0 commit comments

Comments
 (0)