Krzysztof Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 1 | # Copyright (c) 2021 Nordic Semiconductor ASA |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | |
| 4 | menu "Processing" |
| 5 | |
Krzysztof Chruscinski | c0808e3 | 2021-11-19 07:59:23 +0100 | [diff] [blame] | 6 | if !LOG_MODE_MINIMAL |
Krzysztof Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 7 | |
| 8 | config LOG_PRINTK |
| 9 | bool "Process printk messages" |
Flavio Ceolin | d027d26 | 2023-11-14 05:12:06 +0000 | [diff] [blame] | 10 | depends on !USERSPACE |
Anas Nashif | 996c845 | 2023-10-10 00:06:05 +0000 | [diff] [blame] | 11 | default y if PRINTK |
Krzysztof Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 12 | help |
Ladislav Podivin | 390b652 | 2023-10-13 16:29:16 +0200 | [diff] [blame] | 13 | If enabled, printk messages are redirected to the logging subsystem. |
| 14 | The messages are formatted in place and logged unconditionally. |
Krzysztof Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 15 | |
Krzysztof Chruscinski | 3392301 | 2022-03-29 15:47:01 +0200 | [diff] [blame] | 16 | if LOG_MODE_DEFERRED && !LOG_FRONTEND_ONLY |
Krzysztof Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 17 | |
| 18 | config 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 | |
| 25 | config LOG_BLOCK_IN_THREAD |
| 26 | bool "Block in thread context on full" |
Krzysztof Chruscinski | a4af0ee | 2021-04-19 08:56:52 +0200 | [diff] [blame] | 27 | depends on MULTITHREADING |
Krzysztof Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 28 | 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 | |
| 32 | config 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 | |
| 43 | config LOG_PROCESS_TRIGGER_THRESHOLD |
| 44 | int "Number of buffered log messages before flushing" |
| 45 | default 10 |
Krzysztof Chruscinski | a4af0ee | 2021-04-19 08:56:52 +0200 | [diff] [blame] | 46 | depends on MULTITHREADING |
Krzysztof Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 47 | 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 | |
| 53 | config 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 | |
| 63 | if LOG_PROCESS_THREAD |
| 64 | |
Emil Obalski | 6f4f1dc | 2021-08-13 15:56:51 +0200 | [diff] [blame] | 65 | config 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 Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 72 | config 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 | |
| 79 | config LOG_PROCESS_THREAD_STACK_SIZE |
| 80 | int "Stack size for the internal log processing thread" |
Krzysztof Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 81 | default 4096 if (X86 && X86_64) |
| 82 | default 4096 if ARM64 |
Evgeniy Paltsev | f54d0b7 | 2021-07-28 20:40:45 +0300 | [diff] [blame] | 83 | default 4096 if (ARC && 64BIT) |
Krzysztof Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 84 | default 4096 if SPARC |
Krzysztof Chruscinski | 292a15b | 2021-04-26 14:57:36 +0200 | [diff] [blame] | 85 | default 2048 if COVERAGE_GCOV |
Krzysztof Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 86 | default 2048 if (RISCV && 64BIT) |
Mateusz Syc | fe5f602 | 2020-08-21 09:15:45 +0200 | [diff] [blame] | 87 | default 2048 if LOG_BACKEND_FS |
Krzysztof Chruscinski | 292a15b | 2021-04-26 14:57:36 +0200 | [diff] [blame] | 88 | default 1152 if LOG_BACKEND_NET |
Krzysztof Chruscinski | 94a01d0 | 2021-12-14 14:11:52 +0100 | [diff] [blame] | 89 | default 4096 if NO_OPTIMIZATIONS |
Krzysztof Chruscinski | 292a15b | 2021-04-26 14:57:36 +0200 | [diff] [blame] | 90 | default 1024 if XTENSA |
Keith Packard | 2c310d4 | 2022-04-21 21:17:51 -0700 | [diff] [blame] | 91 | default 2048 if ASSERT || SPIN_VALIDATE |
Krzysztof Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 92 | default 768 |
| 93 | help |
| 94 | Set the internal stack size for log processing thread. |
| 95 | |
Krzysztof Chruscinski | e322447 | 2021-07-14 06:49:11 +0200 | [diff] [blame] | 96 | config 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 Huang | cb52641 | 2022-07-11 15:32:22 -1000 | [diff] [blame] | 107 | config LOG_PROCESS_THREAD_CUSTOM_PRIORITY |
| 108 | bool "Custom log thread priority" |
| 109 | help |
| 110 | Set a custom value for the log processing thread. |
| 111 | |
| 112 | config 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 Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 120 | endif # LOG_PROCESS_THREAD |
| 121 | |
| 122 | config LOG_BUFFER_SIZE |
| 123 | int "Number of bytes dedicated for the logger internal buffer" |
| 124 | default 1024 |
Jungo Lin | 7019abb | 2024-12-08 15:39:14 +0800 | [diff] [blame] | 125 | range 128 1048576 |
Krzysztof Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 126 | help |
| 127 | Number of bytes dedicated for the logger internal buffer. |
| 128 | |
Krzysztof Chruscinski | 3392301 | 2022-03-29 15:47:01 +0200 | [diff] [blame] | 129 | endif # LOG_MODE_DEFERRED && !LOG_FRONTEND_ONLY |
Krzysztof Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 130 | |
Krzysztof Chruscinski | e322447 | 2021-07-14 06:49:11 +0200 | [diff] [blame] | 131 | if LOG_MULTIDOMAIN |
| 132 | |
| 133 | config LOG_DOMAIN_NAME_CACHE_ENTRY_SIZE |
| 134 | int "Cache slot size of domain name" |
| 135 | default 8 |
| 136 | |
| 137 | config LOG_DOMAIN_NAME_CACHE_ENTRY_COUNT |
| 138 | int "Number of entries in domain name cache" |
| 139 | default 2 |
| 140 | |
| 141 | config LOG_SOURCE_NAME_CACHE_ENTRY_SIZE |
| 142 | int "Cache slot size of source name" |
| 143 | default 16 |
| 144 | |
| 145 | config LOG_SOURCE_NAME_CACHE_ENTRY_COUNT |
| 146 | int "Number of entries in source name cache" |
| 147 | default 8 |
| 148 | |
| 149 | endif # LOG_MULTIDOMAIN |
| 150 | |
Krzysztof Chruscinski | f6a40ae | 2020-11-19 17:25:03 +0100 | [diff] [blame] | 151 | config 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 | |
| 158 | config LOG_TIMESTAMP_64BIT |
| 159 | bool "Use 64 bit timestamp" |
| 160 | |
Fin Maaß | abdfc4b | 2024-02-23 11:26:59 +0100 | [diff] [blame] | 161 | config LOG_TIMESTAMP_USE_REALTIME |
| 162 | bool "Use real time clock for timestamp" |
| 163 | select LOG_TIMESTAMP_64BIT |
Chris Friedt | 4a5c4e5 | 2024-05-20 12:23:58 -0400 | [diff] [blame] | 164 | depends on POSIX_TIMERS |
Fin Maaß | abdfc4b | 2024-02-23 11:26:59 +0100 | [diff] [blame] | 165 | help |
| 166 | When enabled, real time clock is used for timestamping. |
| 167 | |
Krzysztof Chruscinski | f6a40ae | 2020-11-19 17:25:03 +0100 | [diff] [blame] | 168 | config LOG_SPEED |
| 169 | bool "Prefer performance over size" |
Krzysztof Chruscinski | 154ca85 | 2022-02-09 11:59:26 +0100 | [diff] [blame] | 170 | depends on LOG_MODE_DEFERRED |
Krzysztof Chruscinski | 7c72b78 | 2022-01-25 09:10:15 +0100 | [diff] [blame] | 171 | depends on !LOG_FRONTEND |
Krzysztof Chruscinski | f6a40ae | 2020-11-19 17:25:03 +0100 | [diff] [blame] | 172 | help |
| 173 | If enabled, logging may take more code size to get faster logging. |
Krzysztof Chruscinski | f6a40ae | 2020-11-19 17:25:03 +0100 | [diff] [blame] | 174 | |
Krzysztof Chruscinski | c0808e3 | 2021-11-19 07:59:23 +0100 | [diff] [blame] | 175 | endif # !LOG_MODE_MINIMAL |
Krzysztof Chruscinski | 7f08061 | 2021-01-18 14:31:11 +0100 | [diff] [blame] | 176 | |
| 177 | endmenu |