This change will enable the logging system to handle printk() calls by default if printk support is enabled, which improves output resiliency when logging, mcumgr and printk calls are used. Will disable keep LOG_PRINTK disabled for tests which are not using the new API as moving to LOG_PRINTK causes test data to be output to a different UART in the old test system. Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
168 lines
4.9 KiB
Text
168 lines
4.9 KiB
Text
# Copyright (c) 2021 Nordic Semiconductor ASA
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
menu "Processing"
|
|
|
|
if !LOG_MODE_MINIMAL
|
|
|
|
config LOG_PRINTK
|
|
bool "Process printk messages"
|
|
default y if PRINTK && (!ZTEST || ZTEST_NEW_API)
|
|
help
|
|
LOG_PRINTK messages are formatted in place and logged unconditionally.
|
|
|
|
if LOG_MODE_DEFERRED && !LOG_FRONTEND_ONLY
|
|
|
|
config LOG_MODE_OVERFLOW
|
|
bool "Drop oldest message when full"
|
|
default y
|
|
help
|
|
If enabled, then if there is no space to log a new message, the
|
|
oldest one is dropped. If disabled, current message is dropped.
|
|
|
|
config LOG_BLOCK_IN_THREAD
|
|
bool "Block in thread context on full"
|
|
depends on MULTITHREADING
|
|
help
|
|
When enabled logger will block (if in the thread context) when
|
|
internal logger buffer is full and new message cannot be allocated.
|
|
|
|
config LOG_BLOCK_IN_THREAD_TIMEOUT_MS
|
|
int "Maximum time (in milliseconds) thread can be blocked"
|
|
default 1000
|
|
range -1 10000
|
|
depends on LOG_BLOCK_IN_THREAD
|
|
help
|
|
If new buffer for a log message cannot be allocated in that time, log
|
|
message is dropped. Forever blocking (-1) is possible however may lead
|
|
to the logger deadlock if logging is enabled in threads used for
|
|
logging (e.g. logger or shell thread).
|
|
|
|
config LOG_PROCESS_TRIGGER_THRESHOLD
|
|
int "Number of buffered log messages before flushing"
|
|
default 10
|
|
depends on MULTITHREADING
|
|
help
|
|
When number of buffered messages reaches the threshold thread is waken
|
|
up. Log processing thread ID is provided during log initialization.
|
|
Set 0 to disable the feature. If LOG_PROCESS_THREAD is enabled then
|
|
this threshold is used by the internal thread.
|
|
|
|
config LOG_PROCESS_THREAD
|
|
bool "Use internal thread for log processing"
|
|
depends on MULTITHREADING
|
|
default y
|
|
help
|
|
When enabled thread is created by the logger subsystem. Thread is
|
|
waken up periodically (see LOG_PROCESS_THREAD_SLEEP_MS) and whenever
|
|
number of buffered messages exceeds the threshold (see
|
|
LOG_PROCESS_TRIGGER_THR).
|
|
|
|
if LOG_PROCESS_THREAD
|
|
|
|
config LOG_PROCESS_THREAD_STARTUP_DELAY_MS
|
|
int "Set log processing thread startup delay"
|
|
default 0
|
|
help
|
|
Log processing thread starts after requested delay given in
|
|
milliseconds. When started, thread process any buffered messages.
|
|
|
|
config LOG_PROCESS_THREAD_SLEEP_MS
|
|
int "Set internal log processing thread sleep period"
|
|
default 1000
|
|
help
|
|
Log processing thread sleeps for requested period given in
|
|
milliseconds. When waken up, thread process any buffered messages.
|
|
|
|
config LOG_PROCESS_THREAD_STACK_SIZE
|
|
int "Stack size for the internal log processing thread"
|
|
default 4096 if (X86 && X86_64)
|
|
default 4096 if ARM64
|
|
default 4096 if (ARC && 64BIT)
|
|
default 4096 if SPARC
|
|
default 2048 if COVERAGE_GCOV
|
|
default 2048 if (RISCV && 64BIT)
|
|
default 2048 if LOG_BACKEND_FS
|
|
default 1152 if LOG_BACKEND_NET
|
|
default 4096 if NO_OPTIMIZATIONS
|
|
default 1024 if XTENSA
|
|
default 2048 if ASSERT || SPIN_VALIDATE
|
|
default 768
|
|
help
|
|
Set the internal stack size for log processing thread.
|
|
|
|
config LOG_PROCESSING_LATENCY_US
|
|
int "Maximum remote message latency (in microseconds)"
|
|
default 100000
|
|
depends on LOG_MULTIDOMAIN
|
|
help
|
|
Arbitrary time between log message creation in the remote domain and
|
|
processing in the local domain. Higher value increases message processing
|
|
latency but increases chances of maintaining correct ordering of the
|
|
messages. Option is used only if links are using dedicated buffers
|
|
for remote messages.
|
|
|
|
config LOG_PROCESS_THREAD_CUSTOM_PRIORITY
|
|
bool "Custom log thread priority"
|
|
help
|
|
Set a custom value for the log processing thread.
|
|
|
|
config LOG_PROCESS_THREAD_PRIORITY
|
|
int "Priority of the log processing thread"
|
|
default 0
|
|
depends on LOG_PROCESS_THREAD_CUSTOM_PRIORITY
|
|
help
|
|
The priority of the log processing thread.
|
|
When not set the prority is set to K_LOWEST_APPLICATION_THREAD_PRIO.
|
|
|
|
endif # LOG_PROCESS_THREAD
|
|
|
|
config LOG_BUFFER_SIZE
|
|
int "Number of bytes dedicated for the logger internal buffer"
|
|
default 1024
|
|
range 128 65536
|
|
help
|
|
Number of bytes dedicated for the logger internal buffer.
|
|
|
|
endif # LOG_MODE_DEFERRED && !LOG_FRONTEND_ONLY
|
|
|
|
if LOG_MULTIDOMAIN
|
|
|
|
config LOG_DOMAIN_NAME_CACHE_ENTRY_SIZE
|
|
int "Cache slot size of domain name"
|
|
default 8
|
|
|
|
config LOG_DOMAIN_NAME_CACHE_ENTRY_COUNT
|
|
int "Number of entries in domain name cache"
|
|
default 2
|
|
|
|
config LOG_SOURCE_NAME_CACHE_ENTRY_SIZE
|
|
int "Cache slot size of source name"
|
|
default 16
|
|
|
|
config LOG_SOURCE_NAME_CACHE_ENTRY_COUNT
|
|
int "Number of entries in source name cache"
|
|
default 8
|
|
|
|
endif # LOG_MULTIDOMAIN
|
|
|
|
config LOG_TRACE_SHORT_TIMESTAMP
|
|
bool "Use 24 bit timestamp for tracing"
|
|
default y
|
|
help
|
|
When enabled, shorter timestamp is used and trace message is
|
|
compressed.
|
|
|
|
config LOG_TIMESTAMP_64BIT
|
|
bool "Use 64 bit timestamp"
|
|
|
|
config LOG_SPEED
|
|
bool "Prefer performance over size"
|
|
depends on LOG_MODE_DEFERRED
|
|
depends on !LOG_FRONTEND
|
|
help
|
|
If enabled, logging may take more code size to get faster logging.
|
|
|
|
endif # !LOG_MODE_MINIMAL
|
|
|
|
endmenu
|