2016-12-17 12:56:56 -05:00
|
|
|
# Copyright (c) 2016 Intel Corporation
|
2017-01-18 17:01:01 -08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2016-12-17 12:56:56 -05:00
|
|
|
|
2019-03-25 17:00:12 +01:00
|
|
|
menuconfig LOG
|
|
|
|
bool "Logging"
|
logging: Add basic userspace support
This commit adds basic userspace support to the logging subsystem.
With this change, the following API could be called from user mode:
- LOG_*()
- LOG_INST_*(),
- LOG_HEXDUMP_*(),
- LOG_HEXDUMP_INST_*(),
- LOG_PANIC(), LOG_PROCESS(),
- log_printk(), log_generic(), log_buffrered_cnt(),
- log_filter_set(NULL, ...)
With userspace disabled, the logger behavior and performance
is not affected. With userspace enabled, the calls from kernel
space have an additional overhead introduced by _is_user_context().
The logger behavior changes when it is called from the user context.
All strings logged using LOG_*() and LOG_INST_*() API from userspace
are rendered in place for security reasons and then placed in
log_strdup() memory pool, which should be large enough to hold bursts
of log messages.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-08-22 11:13:22 +02:00
|
|
|
select PRINTK if USERSPACE
|
2018-05-16 08:50:33 +02:00
|
|
|
help
|
|
|
|
Global switch for the logger, when turned off log calls will not be
|
|
|
|
compiled in.
|
|
|
|
|
|
|
|
if LOG
|
2019-03-25 17:00:12 +01:00
|
|
|
|
2019-09-22 16:44:43 -07:00
|
|
|
config LOG_MINIMAL
|
|
|
|
bool "Enable minimal-footprint logging"
|
|
|
|
imply PRINTK
|
|
|
|
help
|
|
|
|
Enable minimal logging implementation. This has very little footprint
|
|
|
|
overhead on top of the printk() implementation for standard
|
|
|
|
logging macros. Hexdump macros are also supported, with a small
|
|
|
|
amount of code pulled in if used. Build time filtering is supported,
|
|
|
|
but not runtime filtering. There are no timestamps, prefixes,
|
|
|
|
colors, or asynchronous logging, and all messages are simply
|
|
|
|
sent to printk().
|
|
|
|
|
2018-05-16 08:50:33 +02:00
|
|
|
config LOG_RUNTIME_FILTERING
|
|
|
|
bool "Enable runtime reconfiguration of the logger"
|
2019-09-22 16:44:43 -07:00
|
|
|
depends on !LOG_FRONTEND && !LOG_MINIMAL
|
2018-05-16 08:50:33 +02:00
|
|
|
help
|
|
|
|
Allow runtime configuration of maximal, independent severity
|
|
|
|
level for instance.
|
|
|
|
|
|
|
|
config LOG_DEFAULT_LEVEL
|
|
|
|
int "Default log level"
|
|
|
|
default 3
|
|
|
|
range 0 4
|
|
|
|
help
|
|
|
|
Sets log level for modules which don't specify it explicitly. When
|
|
|
|
set to 0 it means log will not be activated for those modules.
|
|
|
|
Levels are:
|
|
|
|
|
|
|
|
- 0 OFF, do not write by default
|
|
|
|
- 1 ERROR, default to only write LOG_LEVEL_ERR
|
|
|
|
- 2 WARNING, default to write LOG_LEVEL_WRN
|
|
|
|
- 3 INFO, default to write LOG_LEVEL_INFO
|
|
|
|
- 4 DEBUG, default to write LOG_LEVEL_DBG
|
|
|
|
|
|
|
|
config LOG_OVERRIDE_LEVEL
|
|
|
|
int "Override lowest log level"
|
|
|
|
default 0
|
|
|
|
range 0 4
|
|
|
|
help
|
|
|
|
Forces a minimum log level for all modules. Modules use their
|
|
|
|
specified level if it is greater than this option, otherwise they use
|
|
|
|
the level specified by this option instead of their default or
|
|
|
|
whatever was manually set.
|
|
|
|
Levels are:
|
|
|
|
|
|
|
|
- 0 OFF, do not override
|
|
|
|
- 1 ERROR, override to write LOG_LEVEL_ERR
|
|
|
|
- 2 WARNING, override to write LOG_LEVEL_WRN
|
|
|
|
- 3 INFO, override to write LOG_LEVEL_INFO
|
|
|
|
- 4 DEBUG, override to write LOG_LEVEL_DBG
|
|
|
|
|
|
|
|
config LOG_MAX_LEVEL
|
|
|
|
int "Maximal log level compiled in the system"
|
|
|
|
default 4
|
|
|
|
range 0 4
|
|
|
|
help
|
|
|
|
Forces a maximal log level for all modules. Modules saturates their
|
|
|
|
specified level if it is greater than this option, otherwise they use
|
|
|
|
the level specified by this option instead of their default or
|
|
|
|
whatever was manually set.
|
|
|
|
Levels are:
|
|
|
|
|
|
|
|
- 0 OFF, logging is turned off
|
|
|
|
- 1 ERROR, maximal level set to LOG_LEVEL_ERR
|
|
|
|
- 2 WARNING, maximal level set to LOG_LEVEL_WRN
|
|
|
|
- 3 INFO, maximal level set to LOG_LEVEL_INFO
|
|
|
|
- 4 DEBUG, maximal level set to LOG_LEVEL_DBG
|
|
|
|
|
2019-10-29 05:45:55 +08:00
|
|
|
config LOG_MIPI_SYST_ENABLE
|
|
|
|
bool "Enable mipi syst format output"
|
|
|
|
select MIPI_SYST_LIB
|
|
|
|
help
|
|
|
|
Enable mipi syst format output for the logger system.
|
|
|
|
|
2019-09-22 16:44:43 -07:00
|
|
|
if !LOG_MINIMAL
|
|
|
|
|
2020-06-15 09:28:47 +02:00
|
|
|
menu "Prepend non-hexdump log message with function name"
|
2019-06-13 15:00:51 +02:00
|
|
|
depends on !LOG_FRONTEND
|
2018-11-08 12:02:02 +01:00
|
|
|
|
|
|
|
config LOG_FUNC_NAME_PREFIX_ERR
|
|
|
|
bool "Error messages prepended"
|
|
|
|
|
|
|
|
config LOG_FUNC_NAME_PREFIX_WRN
|
|
|
|
bool "Warning messages prepended"
|
|
|
|
|
|
|
|
config LOG_FUNC_NAME_PREFIX_INF
|
|
|
|
bool "Info messages prepended"
|
|
|
|
|
|
|
|
config LOG_FUNC_NAME_PREFIX_DBG
|
|
|
|
bool "Debug messages prepended"
|
2018-10-19 09:26:46 +02:00
|
|
|
default y
|
2018-11-08 12:02:02 +01:00
|
|
|
|
|
|
|
endmenu
|
2018-10-19 09:26:46 +02:00
|
|
|
|
2018-05-16 08:50:33 +02:00
|
|
|
config LOG_PRINTK
|
|
|
|
bool "Enable processing of printk messages."
|
|
|
|
help
|
2018-08-07 14:03:09 -07:00
|
|
|
LOG_PRINTK messages are formatted in place and logged unconditionally.
|
2018-05-16 08:50:33 +02:00
|
|
|
|
|
|
|
config LOG_PRINTK_MAX_STRING_LENGTH
|
|
|
|
int "Maximum string length supported by LOG_PRINTK"
|
|
|
|
depends on LOG_PRINTK
|
logging: Add basic userspace support
This commit adds basic userspace support to the logging subsystem.
With this change, the following API could be called from user mode:
- LOG_*()
- LOG_INST_*(),
- LOG_HEXDUMP_*(),
- LOG_HEXDUMP_INST_*(),
- LOG_PANIC(), LOG_PROCESS(),
- log_printk(), log_generic(), log_buffrered_cnt(),
- log_filter_set(NULL, ...)
With userspace disabled, the logger behavior and performance
is not affected. With userspace enabled, the calls from kernel
space have an additional overhead introduced by _is_user_context().
The logger behavior changes when it is called from the user context.
All strings logged using LOG_*() and LOG_INST_*() API from userspace
are rendered in place for security reasons and then placed in
log_strdup() memory pool, which should be large enough to hold bursts
of log messages.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-08-22 11:13:22 +02:00
|
|
|
depends on (!LOG_IMMEDIATE || USERSPACE)
|
2018-05-16 08:50:33 +02:00
|
|
|
default 128
|
|
|
|
help
|
|
|
|
Array is allocated on the stack.
|
|
|
|
|
2019-01-10 08:37:15 +01:00
|
|
|
config LOG_IMMEDIATE
|
|
|
|
bool "Enable synchronous processing"
|
2018-05-16 08:50:33 +02:00
|
|
|
help
|
|
|
|
When enabled log is processed in the context of the call. It impacts
|
2018-06-28 13:17:09 +02:00
|
|
|
performance of the system since time consuming operations are
|
|
|
|
performed in the context of the log entry (e.g. high priority
|
2019-01-10 08:37:15 +01:00
|
|
|
interrupt).Logger backends must support exclusive access to work
|
|
|
|
flawlessly in that mode because one log operation can be interrupted
|
|
|
|
by another one in the higher priority context.
|
|
|
|
|
2019-11-20 14:28:06 +01:00
|
|
|
config LOG_IMMEDIATE_CLEAN_OUTPUT
|
|
|
|
bool "Enable clean log output"
|
kconfig: Replace some single-symbol 'if's with 'depends on'
I think people might be reading differences into 'if' and 'depends on'
that aren't there, like maybe 'if' being needed to "hide" a symbol,
while 'depends on' just adds a dependency.
There are no differences between 'if' and 'depends on'. 'if' is just a
shorthand for 'depends on'. They work the same when it comes to creating
implicit menus too.
The way symbols get "hidden" is through their dependencies not being
satisfied ('if'/'depends on' get copied up as a dependency on the
prompt).
Since 'if' and 'depends on' are the same, an 'if' with just a single
symbol in it can be replaced with a 'depends on'. IMO, it's best to
avoid 'if' there as a style choice too, because it confuses people into
thinking there's deep Kconfig magic going on that requires 'if'.
Going for 'depends on' can also remove some nested 'if's, which
generates nicer symbol information and docs, because nested 'if's really
are so simple/dumb that they just add the dependencies from both 'if's
to all symbols within.
Replace a bunch of single-symbol 'if's with 'depends on' to despam the
Kconfig files a bit and make it clearer how things work. Also do some
other minor related dependency refactoring.
The replacement isn't complete. Will fix up the rest later. Splitting it
a bit to make it more manageable.
(Everything above is true for choices, menus, and comments as well.)
Detected by tweaking the Kconfiglib parsing code. It's impossible to
detect after parsing, because 'if' turns into 'depends on'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 03:45:50 +01:00
|
|
|
depends on LOG_IMMEDIATE
|
2019-11-20 14:28:06 +01:00
|
|
|
help
|
|
|
|
If enabled, interrupts are locked during whole log message processing.
|
|
|
|
As a result, processing on one log message cannot be interrupted by
|
|
|
|
another one and output is clean, not interleaved. However, enabling
|
|
|
|
this option is causing interrupts locking for significant amount of
|
|
|
|
time (up to multiple milliseconds).
|
|
|
|
|
2019-03-04 11:49:19 +01:00
|
|
|
config LOG_ENABLE_FANCY_OUTPUT_FORMATTING
|
2019-09-27 21:39:51 +02:00
|
|
|
depends on MINIMAL_LIBC
|
2019-03-04 11:49:19 +01:00
|
|
|
bool "Format strings with minimal libc _prf() instead of _vprintk()"
|
2019-02-01 12:06:44 -08:00
|
|
|
help
|
2019-03-04 11:49:19 +01:00
|
|
|
Selecting this option will choose more robust _prf() function from
|
|
|
|
minimal libc for handling format strings instead of the _vprintk()
|
|
|
|
function. Choosing this option adds around ~3K flash and ~250 bytes on
|
|
|
|
stack.
|
2019-02-01 12:06:44 -08:00
|
|
|
|
2019-01-10 08:37:15 +01:00
|
|
|
if !LOG_IMMEDIATE
|
|
|
|
|
|
|
|
choice
|
|
|
|
prompt "Log full strategy"
|
|
|
|
|
|
|
|
config LOG_MODE_OVERFLOW
|
|
|
|
bool "Oldest logs are discarded"
|
|
|
|
|
|
|
|
config LOG_MODE_NO_OVERFLOW
|
|
|
|
bool "New logs are dropped"
|
|
|
|
|
|
|
|
endchoice
|
2018-05-16 08:50:33 +02:00
|
|
|
|
2019-05-16 10:26:29 +02:00
|
|
|
config LOG_BLOCK_IN_THREAD
|
|
|
|
bool "On log full block in thread context"
|
|
|
|
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
|
kconfig: Replace some single-symbol 'if's with 'depends on'
I think people might be reading differences into 'if' and 'depends on'
that aren't there, like maybe 'if' being needed to "hide" a symbol,
while 'depends on' just adds a dependency.
There are no differences between 'if' and 'depends on'. 'if' is just a
shorthand for 'depends on'. They work the same when it comes to creating
implicit menus too.
The way symbols get "hidden" is through their dependencies not being
satisfied ('if'/'depends on' get copied up as a dependency on the
prompt).
Since 'if' and 'depends on' are the same, an 'if' with just a single
symbol in it can be replaced with a 'depends on'. IMO, it's best to
avoid 'if' there as a style choice too, because it confuses people into
thinking there's deep Kconfig magic going on that requires 'if'.
Going for 'depends on' can also remove some nested 'if's, which
generates nicer symbol information and docs, because nested 'if's really
are so simple/dumb that they just add the dependencies from both 'if's
to all symbols within.
Replace a bunch of single-symbol 'if's with 'depends on' to despam the
Kconfig files a bit and make it clearer how things work. Also do some
other minor related dependency refactoring.
The replacement isn't complete. Will fix up the rest later. Splitting it
a bit to make it more manageable.
(Everything above is true for choices, menus, and comments as well.)
Detected by tweaking the Kconfiglib parsing code. It's impossible to
detect after parsing, because 'if' turns into 'depends on'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 03:45:50 +01:00
|
|
|
depends on LOG_BLOCK_IN_THREAD
|
2019-05-16 10:26:29 +02:00
|
|
|
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).
|
|
|
|
|
2018-06-27 10:47:14 +02:00
|
|
|
config LOG_PROCESS_TRIGGER_THRESHOLD
|
|
|
|
int "Amount of buffered logs which triggers processing thread."
|
2018-07-19 14:27:07 +02:00
|
|
|
default 10
|
2018-06-27 10:47:14 +02:00
|
|
|
help
|
|
|
|
When number of buffered messages reaches the threshold thread is waken
|
|
|
|
up. Log processing thread ID is provided during log initialization.
|
2018-07-10 09:43:49 +02:00
|
|
|
Set 0 to disable the feature. If LOG_PROCESS_THREAD is enabled then
|
|
|
|
this threshold is used by the internal thread.
|
2018-06-27 10:47:14 +02:00
|
|
|
|
2018-06-28 13:17:09 +02:00
|
|
|
config LOG_PROCESS_THREAD
|
|
|
|
bool "Enable internal thread for log processing"
|
|
|
|
depends on MULTITHREADING
|
2018-07-19 14:27:07 +02:00
|
|
|
default y
|
2018-06-28 13:17:09 +02:00
|
|
|
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).
|
|
|
|
|
2018-07-10 09:43:49 +02:00
|
|
|
if LOG_PROCESS_THREAD
|
|
|
|
|
2018-06-28 13:17:09 +02:00
|
|
|
config LOG_PROCESS_THREAD_SLEEP_MS
|
2018-07-10 09:43:49 +02:00
|
|
|
int "Set internal log processing thread sleep period"
|
2018-06-28 13:17:09 +02:00
|
|
|
default 1000
|
|
|
|
help
|
|
|
|
Log processing thread sleeps for requested period given in
|
|
|
|
milliseconds. When waken up, thread process any buffered messages.
|
|
|
|
|
2018-07-10 09:43:49 +02:00
|
|
|
config LOG_PROCESS_THREAD_STACK_SIZE
|
|
|
|
int "Stack size for the internal log processing thread"
|
2018-10-11 13:32:39 +05:30
|
|
|
default 2048 if COVERAGE_GCOV
|
2019-02-07 12:49:46 +01:00
|
|
|
default 1024 if NO_OPTIMIZATIONS
|
2019-02-10 20:57:55 -05:00
|
|
|
default 1024 if XTENSA
|
2019-10-24 12:57:57 -07:00
|
|
|
default 4096 if (X86 && X86_64)
|
2019-11-18 14:10:55 +00:00
|
|
|
default 4096 if ARM64
|
2018-07-10 09:43:49 +02:00
|
|
|
default 768
|
|
|
|
help
|
|
|
|
Set the internal stack size for log processing thread.
|
|
|
|
|
2019-01-10 08:37:15 +01:00
|
|
|
endif # LOG_PROCESS_THREAD
|
2018-07-10 09:43:49 +02:00
|
|
|
|
2018-05-16 08:50:33 +02:00
|
|
|
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.
|
|
|
|
|
2019-05-21 13:03:13 +02:00
|
|
|
config LOG_DETECT_MISSED_STRDUP
|
|
|
|
bool "Detect missed handling of transient strings"
|
|
|
|
default y if !LOG_IMMEDIATE
|
|
|
|
help
|
|
|
|
If enabled, logger will assert and log error message is it detects
|
|
|
|
that string format specifier (%s) and string address which is not from
|
|
|
|
read only memory section and not from pool used for string duplicates.
|
|
|
|
String argument must be duplicated in that case using log_strdup().
|
|
|
|
Detection is performed during log processing thus it does not impact
|
|
|
|
logging timing.
|
|
|
|
|
2018-09-20 11:41:20 +02:00
|
|
|
config LOG_STRDUP_MAX_STRING
|
|
|
|
int "Longest string that can be duplicated using log_strdup()"
|
|
|
|
default 46 if NETWORKING
|
|
|
|
default 32
|
|
|
|
help
|
|
|
|
Longer strings are truncated.
|
|
|
|
|
|
|
|
config LOG_STRDUP_BUF_COUNT
|
|
|
|
int "Number of buffers in the pool used by log_strdup()"
|
|
|
|
default 4
|
|
|
|
help
|
2018-11-30 10:16:27 +03:00
|
|
|
Number of calls to log_strdup() which can be pending before flushed
|
|
|
|
to output. If "<log_strdup alloc failed>" message is seen in the log
|
|
|
|
output, it means this value is too small and should be increased.
|
|
|
|
Each entry takes CONFIG_LOG_STRDUP_MAX_STRING bytes of memory plus
|
|
|
|
some additional fixed overhead.
|
2018-09-20 11:41:20 +02:00
|
|
|
|
2019-05-22 09:19:26 +02:00
|
|
|
config LOG_STRDUP_POOL_PROFILING
|
|
|
|
bool "Enable profiling of pool used for log_strdup()"
|
|
|
|
help
|
|
|
|
When enabled, maximal utilization of the pool is tracked. It can
|
|
|
|
be read out using shell command.
|
|
|
|
|
2019-01-10 08:37:15 +01:00
|
|
|
endif # !LOG_IMMEDIATE
|
|
|
|
|
2018-05-16 08:50:33 +02:00
|
|
|
config LOG_DOMAIN_ID
|
|
|
|
int "Domain ID"
|
|
|
|
default 0
|
|
|
|
range 0 7
|
|
|
|
help
|
|
|
|
In multicore system each application/core must have unique domain ID.
|
|
|
|
|
2018-08-09 11:44:03 +02:00
|
|
|
config LOG_CMDS
|
|
|
|
bool "Enable shell commands"
|
2018-11-29 20:12:06 +05:30
|
|
|
depends on SHELL
|
2018-08-09 11:44:03 +02:00
|
|
|
default y if SHELL
|
|
|
|
|
2019-06-13 15:00:51 +02:00
|
|
|
config LOG_FRONTEND
|
|
|
|
bool "Enable frontend"
|
|
|
|
select LOG_IMMEDIATE
|
|
|
|
help
|
|
|
|
When enabled, logs are redirected to a custom frontend instead
|
|
|
|
of being processed by the logger.
|
|
|
|
|
2018-05-16 08:50:33 +02:00
|
|
|
config LOG_BACKEND_UART
|
|
|
|
bool "Enable UART backend"
|
|
|
|
depends on UART_CONSOLE
|
2018-11-13 07:42:05 +01:00
|
|
|
default y if !SHELL_BACKEND_SERIAL
|
2018-05-16 08:50:33 +02:00
|
|
|
help
|
|
|
|
When enabled backend is using UART to output logs.
|
|
|
|
|
2019-10-29 05:51:27 +08:00
|
|
|
config LOG_BACKEND_UART_SYST_ENABLE
|
|
|
|
bool "Enable UART syst backend"
|
|
|
|
depends on LOG_BACKEND_UART
|
|
|
|
depends on LOG_MIPI_SYST_ENABLE
|
|
|
|
help
|
|
|
|
When enabled backend is using UART to output syst format logs.
|
|
|
|
|
2018-12-20 09:01:14 +01:00
|
|
|
config LOG_BACKEND_SWO
|
|
|
|
bool "Enable Serial Wire Output (SWO) backend"
|
|
|
|
depends on HAS_SWO
|
|
|
|
help
|
|
|
|
When enabled, backend will use SWO for logging.
|
|
|
|
|
|
|
|
if LOG_BACKEND_SWO
|
|
|
|
|
|
|
|
config LOG_BACKEND_SWO_FREQ_HZ
|
|
|
|
int "Set SWO output frequency"
|
|
|
|
default 0
|
|
|
|
help
|
|
|
|
Set SWO output frequency. Value 0 will select maximum frequency
|
|
|
|
supported by the given MCU. Not all debug probes support high
|
|
|
|
frequency SWO operation. In this case the frequency has to be set
|
|
|
|
manually.
|
|
|
|
|
|
|
|
SWO value defined by this option will be configured at boot. Most SWO
|
|
|
|
viewer programs will configure SWO frequency when attached to the
|
|
|
|
debug probe. Such configuration will persist only until the device
|
|
|
|
reset. To ensure flawless operation the frequency configured here and
|
|
|
|
by the SWO viewer program has to match.
|
|
|
|
|
2019-10-29 05:56:10 +08:00
|
|
|
config LOG_BACKEND_SWO_SYST_ENABLE
|
|
|
|
bool "Enable SWO syst backend"
|
|
|
|
depends on LOG_MIPI_SYST_ENABLE
|
|
|
|
help
|
|
|
|
When enabled backend is using SWO to output syst format logs.
|
|
|
|
|
2018-12-20 09:01:14 +01:00
|
|
|
endif # LOG_BACKEND_SWO
|
|
|
|
|
2018-10-17 10:17:14 +02:00
|
|
|
config LOG_BACKEND_RTT
|
|
|
|
bool "Enable Segger J-Link RTT backend"
|
2018-10-17 19:40:58 +02:00
|
|
|
depends on USE_SEGGER_RTT
|
2018-11-21 09:20:38 +01:00
|
|
|
default y if !SHELL_BACKEND_RTT
|
2018-10-17 10:17:14 +02:00
|
|
|
help
|
2018-10-18 09:44:13 +02:00
|
|
|
When enabled, backend will use RTT for logging. This backend works on a per
|
|
|
|
message basis. Only a whole message (terminated with a carriage return: '\r')
|
2018-10-17 10:17:14 +02:00
|
|
|
is transferred to up-buffer at once depending on available space and
|
|
|
|
selected mode.
|
2018-10-18 09:44:13 +02:00
|
|
|
In panic mode backend always blocks and waits until there is space
|
2018-10-17 10:17:14 +02:00
|
|
|
in up-buffer for a message and message is transferred to host.
|
|
|
|
|
|
|
|
if LOG_BACKEND_RTT
|
|
|
|
|
|
|
|
choice
|
2018-11-02 12:09:45 -07:00
|
|
|
prompt "Logger behavior"
|
2018-10-18 12:53:55 +02:00
|
|
|
default LOG_BACKEND_RTT_MODE_BLOCK
|
2018-10-17 10:17:14 +02:00
|
|
|
|
|
|
|
config LOG_BACKEND_RTT_MODE_DROP
|
2018-10-17 12:13:57 +02:00
|
|
|
bool "Drop messages that do not fit in up-buffer."
|
2018-10-17 10:17:14 +02:00
|
|
|
help
|
2018-10-18 12:53:55 +02:00
|
|
|
If there is not enough space in up-buffer for a message, drop it.
|
|
|
|
Number of dropped messages will be logged.
|
|
|
|
Increase up-buffer size helps to reduce dropping of messages.
|
2018-10-17 10:17:14 +02:00
|
|
|
|
|
|
|
config LOG_BACKEND_RTT_MODE_BLOCK
|
2018-10-18 12:53:55 +02:00
|
|
|
bool "Block until message is transferred to host."
|
|
|
|
help
|
2018-12-14 08:38:39 +01:00
|
|
|
Waits until there is enough space in the up-buffer for a message.
|
2018-10-17 10:17:14 +02:00
|
|
|
|
2019-10-29 05:58:46 +08:00
|
|
|
config LOG_BACKEND_RTT_SYST_ENABLE
|
|
|
|
bool "Enable RTT syst backend"
|
|
|
|
depends on LOG_MIPI_SYST_ENABLE
|
|
|
|
help
|
|
|
|
When enabled backend is using RTT to output syst format logs.
|
|
|
|
|
2018-10-17 10:17:14 +02:00
|
|
|
endchoice
|
|
|
|
|
|
|
|
config LOG_BACKEND_RTT_MESSAGE_SIZE
|
|
|
|
int "Size of internal buffer for storing messages."
|
|
|
|
range 32 256
|
|
|
|
default 128
|
kconfig: Replace some single-symbol 'if's with 'depends on'
I think people might be reading differences into 'if' and 'depends on'
that aren't there, like maybe 'if' being needed to "hide" a symbol,
while 'depends on' just adds a dependency.
There are no differences between 'if' and 'depends on'. 'if' is just a
shorthand for 'depends on'. They work the same when it comes to creating
implicit menus too.
The way symbols get "hidden" is through their dependencies not being
satisfied ('if'/'depends on' get copied up as a dependency on the
prompt).
Since 'if' and 'depends on' are the same, an 'if' with just a single
symbol in it can be replaced with a 'depends on'. IMO, it's best to
avoid 'if' there as a style choice too, because it confuses people into
thinking there's deep Kconfig magic going on that requires 'if'.
Going for 'depends on' can also remove some nested 'if's, which
generates nicer symbol information and docs, because nested 'if's really
are so simple/dumb that they just add the dependencies from both 'if's
to all symbols within.
Replace a bunch of single-symbol 'if's with 'depends on' to despam the
Kconfig files a bit and make it clearer how things work. Also do some
other minor related dependency refactoring.
The replacement isn't complete. Will fix up the rest later. Splitting it
a bit to make it more manageable.
(Everything above is true for choices, menus, and comments as well.)
Detected by tweaking the Kconfiglib parsing code. It's impossible to
detect after parsing, because 'if' turns into 'depends on'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 03:45:50 +01:00
|
|
|
depends on LOG_BACKEND_RTT_MODE_DROP
|
2018-10-17 10:17:14 +02:00
|
|
|
help
|
2018-10-18 12:53:55 +02:00
|
|
|
This option defines maximum message size transferable to up-buffer.
|
2018-10-17 10:17:14 +02:00
|
|
|
|
2018-12-14 08:38:39 +01:00
|
|
|
if LOG_BACKEND_RTT_MODE_BLOCK
|
|
|
|
|
|
|
|
config LOG_BACKEND_RTT_OUTPUT_BUFFER_SIZE
|
|
|
|
int "Size of the output buffer"
|
|
|
|
default 16
|
|
|
|
help
|
|
|
|
Buffer is used by log_output module for preparing output data (e.g.
|
|
|
|
string formatting).
|
|
|
|
|
|
|
|
config LOG_BACKEND_RTT_RETRY_CNT
|
|
|
|
int "Number of retries"
|
|
|
|
default 4
|
|
|
|
help
|
|
|
|
Number of TX retries before dropping the data and assuming that
|
|
|
|
RTT session is inactive.
|
|
|
|
|
|
|
|
config LOG_BACKEND_RTT_RETRY_DELAY_MS
|
|
|
|
int "Delay between TX retries in milliseconds"
|
|
|
|
default 5
|
|
|
|
help
|
|
|
|
Sleep period between TX retry attempts. During RTT session, host pulls
|
|
|
|
data periodically. Period starts from 1-2 milliseconds and can be
|
|
|
|
increased if traffic on RTT increases (also from host to device). In
|
|
|
|
case of heavy traffic data can be lost and it may be necessary to
|
|
|
|
increase delay or number of retries.
|
|
|
|
|
2019-03-25 17:00:12 +01:00
|
|
|
endif # LOG_BACKEND_RTT_MODE_BLOCK
|
2018-12-14 08:38:39 +01:00
|
|
|
|
2018-10-17 10:17:14 +02:00
|
|
|
config LOG_BACKEND_RTT_BUFFER
|
|
|
|
int "Buffer number used for logger output."
|
|
|
|
range 0 SEGGER_RTT_MAX_NUM_UP_BUFFERS
|
|
|
|
default 0
|
|
|
|
help
|
2018-10-18 09:44:13 +02:00
|
|
|
Select index of up-buffer used for logger output, by default it uses
|
2018-10-17 10:17:14 +02:00
|
|
|
terminal up-buffer and its settings.
|
|
|
|
|
|
|
|
config LOG_BACKEND_RTT_BUFFER_SIZE
|
|
|
|
int "Size of reserved up-buffer for logger output."
|
|
|
|
default 1024
|
kconfig: Replace some single-symbol 'if's with 'depends on'
I think people might be reading differences into 'if' and 'depends on'
that aren't there, like maybe 'if' being needed to "hide" a symbol,
while 'depends on' just adds a dependency.
There are no differences between 'if' and 'depends on'. 'if' is just a
shorthand for 'depends on'. They work the same when it comes to creating
implicit menus too.
The way symbols get "hidden" is through their dependencies not being
satisfied ('if'/'depends on' get copied up as a dependency on the
prompt).
Since 'if' and 'depends on' are the same, an 'if' with just a single
symbol in it can be replaced with a 'depends on'. IMO, it's best to
avoid 'if' there as a style choice too, because it confuses people into
thinking there's deep Kconfig magic going on that requires 'if'.
Going for 'depends on' can also remove some nested 'if's, which
generates nicer symbol information and docs, because nested 'if's really
are so simple/dumb that they just add the dependencies from both 'if's
to all symbols within.
Replace a bunch of single-symbol 'if's with 'depends on' to despam the
Kconfig files a bit and make it clearer how things work. Also do some
other minor related dependency refactoring.
The replacement isn't complete. Will fix up the rest later. Splitting it
a bit to make it more manageable.
(Everything above is true for choices, menus, and comments as well.)
Detected by tweaking the Kconfiglib parsing code. It's impossible to
detect after parsing, because 'if' turns into 'depends on'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 03:45:50 +01:00
|
|
|
depends on LOG_BACKEND_RTT_BUFFER > 0
|
2018-10-17 10:17:14 +02:00
|
|
|
help
|
|
|
|
Specify reserved size of up-buffer used for logger output.
|
|
|
|
|
2019-03-13 09:54:56 +01:00
|
|
|
# Enable processing of printk calls using log if terminal buffer is used.
|
|
|
|
# Same buffer is used by RTT console. If printk would go through RTT console
|
|
|
|
# that will lead to corruption of RTT data which is not protected against being
|
|
|
|
# interrupted by an interrupt.
|
|
|
|
config LOG_BACKEND_RTT_FORCE_PRINTK
|
|
|
|
bool
|
2020-01-27 12:22:57 +01:00
|
|
|
default y if LOG_BACKEND_RTT_BUFFER = 0 && RTT_CONSOLE
|
2019-03-13 09:54:56 +01:00
|
|
|
select LOG_PRINTK
|
|
|
|
|
2018-10-17 10:17:14 +02:00
|
|
|
endif # LOG_BACKEND_RTT
|
|
|
|
|
2018-09-13 12:52:32 +03:00
|
|
|
config LOG_BACKEND_NATIVE_POSIX
|
|
|
|
bool "Enable native backend"
|
|
|
|
depends on ARCH_POSIX
|
|
|
|
help
|
|
|
|
Enable backend in native_posix
|
|
|
|
|
2019-03-03 20:16:08 -05:00
|
|
|
config LOG_BACKEND_XTENSA_SIM
|
|
|
|
bool "Enable xtensa simulator backend"
|
2019-11-19 12:35:35 +02:00
|
|
|
depends on SOC_XTENSA_SAMPLE_CONTROLLER || SOC_INTEL_APL_ADSP
|
2019-03-03 20:16:08 -05:00
|
|
|
help
|
|
|
|
Enable backend in xtensa simulator
|
|
|
|
|
|
|
|
config LOG_BACKEND_XTENSA_OUTPUT_BUFFER_SIZE
|
|
|
|
int "Size of the output buffer"
|
|
|
|
default 16
|
2019-03-25 17:00:12 +01:00
|
|
|
depends on LOG_BACKEND_XTENSA_SIM
|
2019-03-03 20:16:08 -05:00
|
|
|
help
|
|
|
|
Buffer is used by log_output module for preparing output data (e.g.
|
|
|
|
string formatting).
|
|
|
|
|
2018-10-12 17:31:57 +03:00
|
|
|
config LOG_BACKEND_NET
|
|
|
|
bool "Enable networking backend"
|
|
|
|
depends on NETWORKING
|
|
|
|
select NET_CONTEXT_NET_PKT_POOL
|
|
|
|
help
|
|
|
|
Send syslog messages to network server.
|
|
|
|
See RFC 5424 (syslog protocol) and RFC 5426 (syslog over UDP)
|
|
|
|
specifications for details.
|
|
|
|
|
|
|
|
if LOG_BACKEND_NET
|
|
|
|
|
|
|
|
config LOG_BACKEND_NET_SERVER
|
|
|
|
string "Syslog server IP address"
|
|
|
|
help
|
|
|
|
This can be either IPv4 or IPv6 address.
|
|
|
|
Server listen UDP port number can be configured here too.
|
|
|
|
Following syntax is supported:
|
|
|
|
192.0.2.1:514
|
|
|
|
192.0.2.42
|
|
|
|
[2001:db8::1]:514
|
|
|
|
[2001:db8::2]
|
|
|
|
2001:db::42
|
|
|
|
|
|
|
|
config LOG_BACKEND_NET_MAX_BUF
|
|
|
|
int "How many network buffers to allocate for sending messages"
|
|
|
|
range 3 256
|
|
|
|
default 3
|
|
|
|
help
|
|
|
|
Each syslog message should fit into a network packet that will be
|
|
|
|
sent to server. This number tells how many syslog messages can be
|
|
|
|
in transit to the server.
|
|
|
|
|
|
|
|
config LOG_BACKEND_NET_MAX_BUF_SIZE
|
|
|
|
int "Max syslog message size"
|
|
|
|
range 64 1180
|
|
|
|
default 1180 if NET_IPV6
|
|
|
|
default 480 if NET_IPV4
|
|
|
|
default 256
|
|
|
|
help
|
|
|
|
As each syslog message needs to fit to UDP packet, set this value
|
|
|
|
so that messages are not truncated.
|
|
|
|
The RFC 5426 recommends that for IPv4 the size is 480 octets and for
|
|
|
|
IPv6 the size is 1180 octets. As each buffer will use RAM, the value
|
|
|
|
should be selected so that typical messages will fit the buffer.
|
|
|
|
|
2019-10-29 06:24:38 +08:00
|
|
|
config LOG_BACKEND_NET_SYST_ENABLE
|
|
|
|
bool "Enable networking syst backend"
|
|
|
|
depends on LOG_MIPI_SYST_ENABLE
|
|
|
|
help
|
|
|
|
When enabled backend is using networking to output syst format logs.
|
|
|
|
|
2018-10-12 17:31:57 +03:00
|
|
|
endif # LOG_BACKEND_NET
|
|
|
|
|
2020-02-10 13:47:06 +02:00
|
|
|
config LOG_BACKEND_RB
|
|
|
|
bool "Enable memory ring buffer backend"
|
2019-11-19 12:35:35 +02:00
|
|
|
select RING_BUFFER
|
|
|
|
help
|
2020-02-10 13:47:06 +02:00
|
|
|
Enable backend in memory using ring buffer to keep messages.
|
2019-11-19 12:35:35 +02:00
|
|
|
|
2020-02-10 13:47:06 +02:00
|
|
|
if LOG_BACKEND_RB
|
2019-11-19 12:35:35 +02:00
|
|
|
|
2020-02-10 13:47:06 +02:00
|
|
|
config LOG_BACKEND_RB_MEM_BASE
|
|
|
|
hex "Ring buffer memory base address"
|
2019-11-19 12:35:35 +02:00
|
|
|
help
|
|
|
|
Address of the ring buffer in the memory.
|
|
|
|
|
2020-02-10 13:47:06 +02:00
|
|
|
config LOG_BACKEND_RB_MEM_SIZE
|
2020-02-12 13:04:16 +02:00
|
|
|
int "Size of the ring buffer"
|
2019-11-19 12:35:35 +02:00
|
|
|
help
|
2020-02-10 13:23:07 +02:00
|
|
|
Size of the ring buffer. Must be multiply of the message slot
|
|
|
|
size.
|
|
|
|
|
|
|
|
config LOG_BACKEND_RB_SLOT_SIZE
|
|
|
|
int "Size of the message slot"
|
|
|
|
default 64
|
|
|
|
help
|
|
|
|
Size of the message slot inside ring buffer. All log messages
|
|
|
|
are split to similar sized logging slots.
|
2019-11-19 12:35:35 +02:00
|
|
|
|
2020-02-10 13:47:06 +02:00
|
|
|
endif # LOG_BACKEND_RB
|
2019-11-19 12:35:35 +02:00
|
|
|
|
2018-09-14 09:52:16 +03:00
|
|
|
config LOG_BACKEND_SHOW_COLOR
|
|
|
|
bool "Enable colors in the backend"
|
2018-12-20 09:01:14 +01:00
|
|
|
depends on LOG_BACKEND_UART || LOG_BACKEND_NATIVE_POSIX || LOG_BACKEND_RTT \
|
2019-03-03 20:16:08 -05:00
|
|
|
|| LOG_BACKEND_SWO || LOG_BACKEND_XTENSA_SIM
|
2018-05-16 08:50:33 +02:00
|
|
|
default y
|
|
|
|
help
|
2018-10-17 10:17:14 +02:00
|
|
|
When enabled selected backend prints errors in red and warning in yellow.
|
2018-05-16 08:50:33 +02:00
|
|
|
|
2018-09-14 09:52:16 +03:00
|
|
|
config LOG_BACKEND_FORMAT_TIMESTAMP
|
|
|
|
bool "Enable timestamp formatting in the backend"
|
2018-12-20 09:01:14 +01:00
|
|
|
depends on LOG_BACKEND_UART || LOG_BACKEND_NATIVE_POSIX || LOG_BACKEND_RTT \
|
2019-03-03 20:16:08 -05:00
|
|
|
|| LOG_BACKEND_SWO || LOG_BACKEND_XTENSA_SIM
|
2018-05-16 08:50:33 +02:00
|
|
|
default y
|
|
|
|
help
|
|
|
|
When enabled timestamp is formatted to hh:mm:ss:ms,us.
|
2018-09-13 12:52:32 +03:00
|
|
|
|
2019-09-22 16:44:43 -07:00
|
|
|
endif # LOG_MINIMAL
|
2019-03-25 17:00:12 +01:00
|
|
|
endif # LOG
|