1# Copyright (c) 2021 Nordic Semiconductor ASA
2# SPDX-License-Identifier: Apache-2.0
3
4menu "Misc"
5
6config LOG_DOMAIN_ID
7	int "Domain ID [DEPRECATED]"
8	depends on !LOG_MODE_MINIMAL
9	default 0
10	range 0 7
11	help
12	  Deprecated. It is not used in the code.
13
14config LOG_CMDS
15	bool "Shell commands"
16	depends on SHELL
17	depends on !LOG_FRONTEND_ONLY && !LOG_MODE_MINIMAL
18	default y if SHELL
19
20config LOG_TEST_CLEAR_MESSAGE_SPACE
21	bool "Clear message after allocation"
22	default y
23	depends on ZTEST
24	help
25	  Used in testing to simplify message comparision if message contains
26	  paddings.
27
28config LOG_USE_VLA
29	bool "Using variable length arrays"
30	default y if !MISRA_SANE
31	help
32	  Using VLA slightly decreases stack usage in some cases it may not be
33	  supported. Note that VLA are used for arrays which size is resolved at
34	  compile time so at runtime arrays have fixed size.
35
36config LOG_ALWAYS_RUNTIME
37	bool "Always use runtime message creation (v2)"
38	default y if NO_OPTIMIZATIONS
39	default y if LOG_MODE_IMMEDIATE
40	default y if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "xcc"
41	help
42	  If enabled, runtime method is always used for message creation. Static
43	  creation relies on compiler being able to optimize and remove code
44	  based on information known at compile time. Runtime only approach must
45	  be used when optimization is disabled because some compilers
46	  (seen on arm_cortex_m and x86) were using unrealistic amount of stack
47	  for dead code. It is also required in immediate mode since it requires
48	  less stack than static message creation and speed has lower priority
49	  in that mode.
50
51config LOG_FMT_SECTION
52	bool "Keep log strings in dedicated section"
53	help
54	  When enabled, logs are kept in dedicated memory section. It allows
55	  removing strings from final binary and should be used for dictionary
56	  logging.
57
58config LOG_USE_TAGGED_ARGUMENTS
59	bool "Using tagged arguments for packaging"
60	depends on !PICOLIBC
61	select CBPRINTF_PACKAGE_SUPPORT_TAGGED_ARGUMENTS
62	select LOG_ALWAYS_RUNTIME
63	help
64	  If enabled, packaging uses tagged arguments.
65
66config LOG_MEM_UTILIZATION
67	bool "Tracking maximum memory utilization"
68	depends on LOG_MODE_DEFERRED
69	default y if LOG_CMDS
70	help
71	  When enabled, maximum usage of memory used for log messages in deferred
72	  mode is tracked. It can be used to trim LOG_BUFFER_SIZE.
73
74config LOG_DICTIONARY_DB
75	bool
76
77config LOG_MSG_APPEND_RO_STRING_LOC
78	bool
79	help
80	  Enable this option to force log messages to always append location of
81	  read-only string arguments in the package. This should be selected by
82	  backends if required.
83
84config LOG_FAILURE_REPORT_PERIOD
85	int "Failure report period (in milliseconds)"
86	default 1000
87	depends on LOG_MODE_DEFERRED
88	help
89	  Determines how often failures are reported. Report contains number
90	  of dropped messages. It may contain additional information depending
91	  on the mode.
92
93config LOG_DOMAIN_NAME
94	string "Domain name"
95	default ""
96
97if LOG_MULTIDOMAIN
98
99config LOG_REMOTE_DOMAIN_MAX_COUNT
100	int "Maximum number of link domains"
101	default 4
102	help
103	  Number of domains that can be handled by a link
104
105endif
106endmenu
107