1# Debug configuration options
2
3# Copyright (c) 2015 Wind River Systems, Inc.
4# SPDX-License-Identifier: Apache-2.0
5
6DT_CHOSEN_Z_CONSOLE := zephyr,console
7
8config TRACING
9	bool "Tracing Support"
10	imply THREAD_NAME
11	imply THREAD_STACK_INFO
12	imply THREAD_MONITOR
13	select INSTRUMENT_THREAD_SWITCHING
14	help
15	  Enable system tracing. This requires a backend such as SEGGER
16	  Systemview to be enabled as well.
17
18if TRACING
19
20config TRACING_CORE
21	bool
22	help
23	  Automatically selected by formats that require the core
24	  tracing infrastructure.
25
26choice TRACING_FORMAT_CHOICE
27	prompt "Tracing Format"
28	default TRACING_NONE
29
30config TRACING_NONE
31	bool "No tracing format selected"
32	help
33	  None of the available tracing formats is selected.
34
35config PERCEPIO_TRACERECORDER
36	bool "Percepio Tracealyzer support"
37	select THREAD_NAME
38	select INIT_STACKS
39	select THREAD_MONITOR
40	depends on ZEPHYR_PERCEPIO_MODULE
41
42config SEGGER_SYSTEMVIEW
43	bool "Segger SystemView support"
44	select USE_SEGGER_RTT
45	select THREAD_MONITOR
46	select SEGGER_RTT_CUSTOM_LOCKING
47
48config TRACING_CTF
49	bool "Tracing via Common Trace Format support"
50	select TRACING_CORE
51	help
52	  Enable tracing to a Common Trace Format stream.
53
54config TRACING_TEST
55	bool "Tracing for test usage"
56	select TRACING_CORE
57	help
58	  Enable tracing for testing kinds of format purpose. It must
59	  implement the tracing hooks defined in tracing_test.h
60
61config TRACING_USER
62	bool "Tracing using user-defined functions"
63	help
64	  Use user-defined functions for tracing task switching and irqs
65
66endchoice
67
68
69config TRACING_CTF_TIMESTAMP
70	bool "CTF internal timestamp"
71	default y
72	depends on TRACING_CTF
73	help
74	  Timestamp prefix will be added to the beginning of CTF
75	  event internally.
76
77choice TRACING_METHOD_CHOICE
78	prompt "Tracing Method"
79	default TRACING_ASYNC
80
81config TRACING_SYNC
82	bool "Synchronous Tracing"
83	select RING_BUFFER
84	help
85	  Enable synchronous tracing. This requires the backend to be
86	  very low-latency.
87
88config TRACING_ASYNC
89	bool "Asynchronous Tracing"
90	select RING_BUFFER
91	help
92	  Enable asynchronous tracing. This will buffer all the tracing
93	  packets to the ring buffer first, tracing thread will try to
94	  output as much data as possible from the buffer when tracing
95	  thread get scheduled.
96
97endchoice
98
99config TRACING_THREAD_STACK_SIZE
100	int "Stack size of tracing thread"
101	default 1024
102	depends on TRACING_ASYNC
103	help
104	  Stack size of tracing thread.
105
106config TRACING_THREAD_WAIT_THRESHOLD
107	int "Tracing thread waiting threshold"
108	default 100
109	depends on TRACING_ASYNC
110	help
111	  Tracing thread waiting period given in milliseconds after
112	  every first packet put to tracing buffer.
113
114config TRACING_BUFFER_SIZE
115	int "Size of tracing buffer"
116	default 2048 if TRACING_ASYNC
117	default TRACING_PACKET_MAX_SIZE if TRACING_SYNC
118	range 32 65536
119	help
120	  Size of tracing buffer. If TRACING_ASYNC is enabled, tracing buffer
121	  is used as a ring buffer to buffer data packet and string packet. If
122	  TRACING_SYNC is enabled, the buffer is used to hold the formatted data.
123
124config TRACING_PACKET_MAX_SIZE
125	int "Max size of one tracing packet"
126	default 32
127	help
128	  Max size of one tracing packet.
129
130choice TRACING_BACKEND_CHOICE
131	prompt "Tracing Backend"
132	default TRACING_BACKEND_UART
133
134config TRACING_BACKEND_UART
135	bool "UART backend"
136	depends on UART_CONSOLE
137
138	help
139	  Use UART to output tracing data.
140
141config TRACING_BACKEND_USB
142	bool "USB backend"
143	depends on USB_DEVICE_STACK_NEXT
144	depends on TRACING_ASYNC
145	help
146	  Use USB to output tracing data.
147
148config TRACING_BACKEND_POSIX
149	bool "Posix architecture (native) backend"
150	depends on TRACING_SYNC
151	depends on ARCH_POSIX
152	help
153	  Use posix architecture to output tracing data to file system.
154
155config TRACING_BACKEND_RAM
156	bool "RAM backend"
157	help
158	  Use a ram buffer to output tracing data which can
159	  be dumped to a file at runtime with a debugger.
160	  See gdb dump binary memory documentation for example.
161
162config TRACING_BACKEND_SEMIHOST
163	bool "Semihost backend"
164	depends on SEMIHOST
165	help
166	  Use semihosting to output tracing data. This is useful
167	  for debugging on a host machine, such as when using QEMU.
168
169config TRACING_BACKEND_ADSP_MEMORY_WINDOW
170	bool "Memory window in RAM"
171	depends on SOC_FAMILY_INTEL_ADSP
172	depends on TRACING_SYNC
173	help
174	  Use ADSP memory debug memory window to output tracing data
175
176endchoice
177
178config TRACING_BACKEND_NAME
179	string
180	default "tracing_backend_uart" if TRACING_BACKEND_UART
181	default "tracing_backend_usb" if TRACING_BACKEND_USB
182	default "tracing_backend_posix" if TRACING_BACKEND_POSIX
183	default "tracing_backend_ram" if TRACING_BACKEND_RAM
184	default "tracing_backend_semihost" if TRACING_BACKEND_SEMIHOST
185	default "tracing_backend_adsp_memory_window" if TRACING_BACKEND_ADSP_MEMORY_WINDOW
186
187config RAM_TRACING_BUFFER_SIZE
188	int "Ram Tracing buffer size"
189	default 4096
190	depends on TRACING_BACKEND_RAM
191	help
192	  Size of the RAM trace buffer. Trace will be discarded if the
193	  length is exceeded.
194
195config TRACING_HANDLE_HOST_CMD
196	bool "Host command handle"
197	select UART_INTERRUPT_DRIVEN if TRACING_BACKEND_UART
198	help
199	  When enabled tracing will handle cmd from host to dynamically
200	  enable and disable tracing to have host capture tracing stream
201	  data conveniently.
202
203config TRACING_CMD_BUFFER_SIZE
204	int "Size of tracing command buffer"
205	default 32
206	range 32 128
207	help
208	  Size of tracing command buffer.
209
210config TRACING_OBJECT_TRACKING
211	bool "Object tracking"
212	help
213	  Keep lists to track kernel objects.
214
215menu "Tracing Configuration"
216
217config TRACING_SYSCALL
218	bool "Tracing Syscalls"
219	default y
220	help
221	  Enable tracing Syscalls.
222
223config TRACING_THREAD
224	bool "Tracing Threads"
225	default y
226	help
227	  Enable tracing Threads.
228
229config TRACING_WORK
230	bool "Tracing Work"
231	default y
232	help
233	  Enable tracing Work and Work queue events
234
235config TRACING_ISR
236	bool "Tracing ISRs"
237	default y
238	help
239	  Enable tracing ISRs. This requires the backend to be
240	  very low-latency.
241
242config TRACING_SEMAPHORE
243	bool "Tracing Semaphores"
244	default y
245	help
246	  Enable tracing Semaphores.
247
248config TRACING_MUTEX
249	bool "Tracing Mutexes"
250	default y
251	help
252	  Enable tracing Mutexes.
253
254config TRACING_CONDVAR
255	bool "Tracing Condition Variables"
256	default y
257	help
258	  Enable tracing Condition Variables
259
260config TRACING_QUEUE
261	bool "Tracing Queues"
262	default y
263	help
264	  Enable tracing Queues.
265
266config TRACING_FIFO
267	bool "Tracing FIFO queues"
268	default y
269	help
270	  Enable tracing FIFO queues.
271
272config TRACING_LIFO
273	bool "Tracing LIFO queues"
274	default y
275	help
276	  Enable tracing LIFO queues.
277
278config TRACING_STACK
279	bool "Tracing Memory Stacks"
280	default y
281	help
282	  Enable tracing Memory Stacks.
283
284config TRACING_MESSAGE_QUEUE
285	bool "Tracing Message Queues"
286	default y
287	help
288	  Enable tracing Message Queues.
289
290config TRACING_MAILBOX
291	bool "Tracing Mailboxes"
292	default y
293	help
294	  Enable tracing Mailboxes.
295
296config TRACING_PIPE
297	bool "Tracing Pipes"
298	default y
299	help
300	  Enable tracing Pipes.
301
302config TRACING_HEAP
303	bool "Tracing Memory Heaps"
304	default y
305	help
306	  Enable tracing Memory Heaps.
307
308config TRACING_MEMORY_SLAB
309	bool "Tracing Memory Slabs"
310	default y
311	help
312	  Enable tracing Memory Slabs.
313
314config TRACING_TIMER
315	bool "Tracing Timers"
316	default y
317	help
318	  Enable tracing Timers.
319
320config TRACING_EVENT
321	bool "Tracing Events"
322	default y
323	help
324	  Enable tracing Events.
325
326config TRACING_POLLING
327	bool "Tracing Polling"
328	default y
329	help
330	  Enable tracing Work Polling and Polling API.
331
332config TRACING_PM
333	bool "Tracing Power Management"
334	default y
335	help
336	  Enable tracing Power Management.
337
338config TRACING_NETWORKING
339	bool "Tracing Network Objects"
340	default y if NETWORKING
341	help
342	  Enable tracing network objects.
343
344config TRACING_NET_SOCKETS
345	bool "Tracing Network Sockets"
346	depends on TRACING_NETWORKING
347	default y if NET_SOCKETS
348	help
349	  Enable tracing network sockets.
350
351config TRACING_NET_CORE
352	bool "Tracing Network Core IP stack"
353	depends on TRACING_NETWORKING
354	default y if NET_IP
355	help
356	  Enable tracing core network IP stack, like packet reception
357	  and sending.
358
359config TRACING_GPIO
360	bool "Tracing GPIO"
361	default n
362	help
363	  Enable tracing GPIO.
364
365config TRACING_IDLE
366	bool "Tracing Idle"
367	default y
368	help
369	  Enable tracing Idle state.
370
371endmenu  # Tracing Configuration
372
373endif
374
375source "subsys/tracing/sysview/Kconfig"
376