1# SPDX-License-Identifier: BSD-3-Clause
2
3# Trace configs
4
5menu "Trace"
6
7config TRACE
8	bool "Trace"
9	default y
10	help
11	  Enabling traces. All traces (normal and error) are sent by dma.
12
13config TRACEV
14	bool "Trace verbose"
15	depends on TRACE
16	default n
17	help
18	  Enabling verbose traces. tr_dbg() statements depend on this at
19	  compile-time and on run-time filtering below too.
20
21config TRACEE
22	bool "Trace error"
23	depends on TRACE
24	default y
25	help
26	  Sending error traces by mailbox additionally.
27
28config TRACEM
29	bool "Trace mailbox"
30	depends on TRACE
31	default n
32	help
33	  Sending all traces by mailbox additionally.
34
35config TRACE_FILTERING
36	bool "Trace filtering"
37	depends on TRACE
38	default y
39	help
40		Filtering of trace messages based on their verbosity level and/or frequency.
41
42config TRACE_FILTERING_VERBOSITY
43	bool "Filter by verbosity"
44	depends on TRACE_FILTERING
45	default y
46	help
47		Filtering by log verbosity level, where maximum verbosity allowed is specified for each
48		context and may be adjusted in runtime. Most basic feature found in every logger.
49
50config TRACE_FILTERING_ADAPTIVE
51	bool "Adaptive rate limiting"
52	depends on TRACE_FILTERING
53	default y
54	help
55		Adaptive filtering of repeating trace messages, tracking up to
56		CONFIG_TRACE_RECENT_ENTRIES_COUNT and suppressing messages repeated in less than
57		CONFIG_TRACE_RECENT_TIME_THRESHOLD microseconds. This filtering and suppression are
58		turned off as soon as the user makes any runtime configuration change using the
59		sof-logger -F flag. Warning: log message parameters (formatted with a conversion
60		specifier %_) are ignored when comparing repeated messages and they are dropped by
61		this filtering.
62
63config TRACE_RECENT_ENTRIES_COUNT
64	int "How many recent log messages are stored"
65	depends on TRACE_FILTERING_ADAPTIVE
66	default 5
67	help
68		The most recent log messages are stored to match the currently processed
69		message. The size of that window affects effectiveness and performance. More recent
70		entries allow to better filter repetitive messages out, but also slightly decrease
71		performance due to the increased number of comparisons necessary.
72
73config TRACE_RECENT_TIME_THRESHOLD
74	int "Period of time considered recent (microseconds)"
75	depends on TRACE_FILTERING_ADAPTIVE
76	default 1500
77	range 1 TRACE_RECENT_MAX_TIME
78	help
79		Period of time during which entries are tracked and will be suppressed if reported again.
80		Entries expire after this time.
81
82config TRACE_RECENT_MAX_TIME
83	int "Maximum period of time that message can be suppressed (microseconds)"
84	depends on TRACE_FILTERING_ADAPTIVE
85	default 5000000
86	help
87		Maximum amount of time message can be suppressed for, due to repeated suppression.
88
89config TRACE_BURST_COUNT
90	int "Allowed amount of rapidly repeated messages, that will not be suppressed by the filter"
91	depends on TRACE_FILTERING_ADAPTIVE
92	default 4
93	help
94		Amount of messages that will pass through the filter even if sent in rapid succession.
95		Allowed message burst size before filter suppresses the message.
96
97config LOG_BACKEND_SOF_PROBE
98	bool "Logging backend with SOF probes"
99	depends on LOG
100	select LOG_OUTPUT
101	help
102		Enable backend for log output via SOF probe interface.
103		Probe interface allows to transmit logs and PCM data, muxed over
104		a shared DMA channel.
105		Logging is enabled by setting up a probe point with
106		probe purpose value of PROBE_PURPOSE_LOGGING.
107
108config LOG_BACKEND_SOF_PROBE_OUTPUT_DICTIONARY
109	bool "Dictionary"
110	select LOG_DICTIONARY_SUPPORT
111	help
112		Set output format of the SOF probe logging backend to
113		Zephyr log dictionary.
114		The resulting log file can be parsed with tools in
115		zephyr/scripts/logging/dictionary
116		A dictionary for the binary is created during build.
117
118config LOG_BACKEND_SOF_PROBE_OUTPUT
119	int "Set logging output format"
120	default 1 if LOG_MIPI_SYST_ENABLE
121	default 2 if LOG_BACKEND_SOF_PROBE_OUTPUT_DICTIONARY
122	default 0 # Text encoding is default
123        help
124                Set the logging format for SOF probe output.
125
126endmenu
127