# 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"
	depends on !USERSPACE
	default y if PRINTK
	help
	  If enabled, printk messages are redirected to the logging subsystem.
	  The 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_TIMESTAMP_USE_REALTIME
	bool "Use real time clock for timestamp"
	select LOG_TIMESTAMP_64BIT
	depends on POSIX_TIMERS
	help
	  When enabled, real time clock is used for timestamping.

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
