blob: 8f96cbfd15cf459b7d51ad9f114cfeb31beb4ce5 [file] [log] [blame]
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +01001# Copyright (c) 2021 Nordic Semiconductor ASA
2# SPDX-License-Identifier: Apache-2.0
3
4menu "Processing"
5
Krzysztof Chruscinskic0808e32021-11-19 07:59:23 +01006if !LOG_MODE_MINIMAL
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +01007
8config LOG_PRINTK
9 bool "Process printk messages"
Flavio Ceolind027d262023-11-14 05:12:06 +000010 depends on !USERSPACE
Anas Nashif996c8452023-10-10 00:06:05 +000011 default y if PRINTK
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +010012 help
Ladislav Podivin390b6522023-10-13 16:29:16 +020013 If enabled, printk messages are redirected to the logging subsystem.
14 The messages are formatted in place and logged unconditionally.
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +010015
Krzysztof Chruscinski33923012022-03-29 15:47:01 +020016if LOG_MODE_DEFERRED && !LOG_FRONTEND_ONLY
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +010017
18config LOG_MODE_OVERFLOW
19 bool "Drop oldest message when full"
20 default y
21 help
22 If enabled, then if there is no space to log a new message, the
23 oldest one is dropped. If disabled, current message is dropped.
24
25config LOG_BLOCK_IN_THREAD
26 bool "Block in thread context on full"
Krzysztof Chruscinskia4af0ee2021-04-19 08:56:52 +020027 depends on MULTITHREADING
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +010028 help
29 When enabled logger will block (if in the thread context) when
30 internal logger buffer is full and new message cannot be allocated.
31
32config LOG_BLOCK_IN_THREAD_TIMEOUT_MS
33 int "Maximum time (in milliseconds) thread can be blocked"
34 default 1000
35 range -1 10000
36 depends on LOG_BLOCK_IN_THREAD
37 help
38 If new buffer for a log message cannot be allocated in that time, log
39 message is dropped. Forever blocking (-1) is possible however may lead
40 to the logger deadlock if logging is enabled in threads used for
41 logging (e.g. logger or shell thread).
42
43config LOG_PROCESS_TRIGGER_THRESHOLD
44 int "Number of buffered log messages before flushing"
45 default 10
Krzysztof Chruscinskia4af0ee2021-04-19 08:56:52 +020046 depends on MULTITHREADING
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +010047 help
48 When number of buffered messages reaches the threshold thread is waken
49 up. Log processing thread ID is provided during log initialization.
50 Set 0 to disable the feature. If LOG_PROCESS_THREAD is enabled then
51 this threshold is used by the internal thread.
52
53config LOG_PROCESS_THREAD
54 bool "Use internal thread for log processing"
55 depends on MULTITHREADING
56 default y
57 help
58 When enabled thread is created by the logger subsystem. Thread is
59 waken up periodically (see LOG_PROCESS_THREAD_SLEEP_MS) and whenever
60 number of buffered messages exceeds the threshold (see
61 LOG_PROCESS_TRIGGER_THR).
62
63if LOG_PROCESS_THREAD
64
Emil Obalski6f4f1dc2021-08-13 15:56:51 +020065config LOG_PROCESS_THREAD_STARTUP_DELAY_MS
66 int "Set log processing thread startup delay"
67 default 0
68 help
69 Log processing thread starts after requested delay given in
70 milliseconds. When started, thread process any buffered messages.
71
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +010072config LOG_PROCESS_THREAD_SLEEP_MS
73 int "Set internal log processing thread sleep period"
74 default 1000
75 help
76 Log processing thread sleeps for requested period given in
77 milliseconds. When waken up, thread process any buffered messages.
78
79config LOG_PROCESS_THREAD_STACK_SIZE
80 int "Stack size for the internal log processing thread"
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +010081 default 4096 if (X86 && X86_64)
82 default 4096 if ARM64
Evgeniy Paltsevf54d0b72021-07-28 20:40:45 +030083 default 4096 if (ARC && 64BIT)
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +010084 default 4096 if SPARC
Krzysztof Chruscinski292a15b2021-04-26 14:57:36 +020085 default 2048 if COVERAGE_GCOV
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +010086 default 2048 if (RISCV && 64BIT)
Mateusz Sycfe5f6022020-08-21 09:15:45 +020087 default 2048 if LOG_BACKEND_FS
Krzysztof Chruscinski292a15b2021-04-26 14:57:36 +020088 default 1152 if LOG_BACKEND_NET
Krzysztof Chruscinski94a01d02021-12-14 14:11:52 +010089 default 4096 if NO_OPTIMIZATIONS
Krzysztof Chruscinski292a15b2021-04-26 14:57:36 +020090 default 1024 if XTENSA
Keith Packard2c310d42022-04-21 21:17:51 -070091 default 2048 if ASSERT || SPIN_VALIDATE
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +010092 default 768
93 help
94 Set the internal stack size for log processing thread.
95
Krzysztof Chruscinskie3224472021-07-14 06:49:11 +020096config LOG_PROCESSING_LATENCY_US
97 int "Maximum remote message latency (in microseconds)"
98 default 100000
99 depends on LOG_MULTIDOMAIN
100 help
101 Arbitrary time between log message creation in the remote domain and
102 processing in the local domain. Higher value increases message processing
103 latency but increases chances of maintaining correct ordering of the
104 messages. Option is used only if links are using dedicated buffers
105 for remote messages.
106
Justin Huangcb526412022-07-11 15:32:22 -1000107config LOG_PROCESS_THREAD_CUSTOM_PRIORITY
108 bool "Custom log thread priority"
109 help
110 Set a custom value for the log processing thread.
111
112config LOG_PROCESS_THREAD_PRIORITY
113 int "Priority of the log processing thread"
114 default 0
115 depends on LOG_PROCESS_THREAD_CUSTOM_PRIORITY
116 help
117 The priority of the log processing thread.
118 When not set the prority is set to K_LOWEST_APPLICATION_THREAD_PRIO.
119
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +0100120endif # LOG_PROCESS_THREAD
121
122config LOG_BUFFER_SIZE
123 int "Number of bytes dedicated for the logger internal buffer"
124 default 1024
Jungo Lin7019abb2024-12-08 15:39:14 +0800125 range 128 1048576
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +0100126 help
127 Number of bytes dedicated for the logger internal buffer.
128
Krzysztof Chruscinski33923012022-03-29 15:47:01 +0200129endif # LOG_MODE_DEFERRED && !LOG_FRONTEND_ONLY
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +0100130
Krzysztof Chruscinskie3224472021-07-14 06:49:11 +0200131if LOG_MULTIDOMAIN
132
133config LOG_DOMAIN_NAME_CACHE_ENTRY_SIZE
134 int "Cache slot size of domain name"
135 default 8
136
137config LOG_DOMAIN_NAME_CACHE_ENTRY_COUNT
138 int "Number of entries in domain name cache"
139 default 2
140
141config LOG_SOURCE_NAME_CACHE_ENTRY_SIZE
142 int "Cache slot size of source name"
143 default 16
144
145config LOG_SOURCE_NAME_CACHE_ENTRY_COUNT
146 int "Number of entries in source name cache"
147 default 8
148
149endif # LOG_MULTIDOMAIN
150
Krzysztof Chruscinskif6a40ae2020-11-19 17:25:03 +0100151config LOG_TRACE_SHORT_TIMESTAMP
152 bool "Use 24 bit timestamp for tracing"
153 default y
154 help
155 When enabled, shorter timestamp is used and trace message is
156 compressed.
157
158config LOG_TIMESTAMP_64BIT
159 bool "Use 64 bit timestamp"
160
Fin Maaßabdfc4b2024-02-23 11:26:59 +0100161config LOG_TIMESTAMP_USE_REALTIME
162 bool "Use real time clock for timestamp"
163 select LOG_TIMESTAMP_64BIT
Chris Friedt4a5c4e52024-05-20 12:23:58 -0400164 depends on POSIX_TIMERS
Fin Maaßabdfc4b2024-02-23 11:26:59 +0100165 help
166 When enabled, real time clock is used for timestamping.
167
Krzysztof Chruscinskif6a40ae2020-11-19 17:25:03 +0100168config LOG_SPEED
169 bool "Prefer performance over size"
Krzysztof Chruscinski154ca852022-02-09 11:59:26 +0100170 depends on LOG_MODE_DEFERRED
Krzysztof Chruscinski7c72b782022-01-25 09:10:15 +0100171 depends on !LOG_FRONTEND
Krzysztof Chruscinskif6a40ae2020-11-19 17:25:03 +0100172 help
173 If enabled, logging may take more code size to get faster logging.
Krzysztof Chruscinskif6a40ae2020-11-19 17:25:03 +0100174
Krzysztof Chruscinskic0808e32021-11-19 07:59:23 +0100175endif # !LOG_MODE_MINIMAL
Krzysztof Chruscinski7f080612021-01-18 14:31:11 +0100176
177endmenu