1menu "Application Level Tracing"
2
3    choice APPTRACE_DESTINATION
4        prompt "Data Destination"
5        default APPTRACE_DEST_NONE
6        help
7            Select destination for application trace: JTAG or none (to disable).
8
9        config APPTRACE_DEST_JTAG
10            bool "JTAG"
11            select APPTRACE_DEST_TRAX if IDF_TARGET_ARCH_XTENSA
12            select APPTRACE_MEMBUFS_APPTRACE_PROTO_ENABLE
13            select APPTRACE_ENABLE
14
15        config APPTRACE_DEST_NONE
16            bool "None"
17    endchoice
18
19    config APPTRACE_DEST_TRAX
20        bool
21        depends on IDF_TARGET_ARCH_XTENSA && !ESP32_TRAX && !ESP32S2_TRAX && !ESP32S3_TRAX
22        select ESP32_MEMMAP_TRACEMEM
23        select ESP32S2_MEMMAP_TRACEMEM
24        select ESP32S3_MEMMAP_TRACEMEM
25        select ESP32_MEMMAP_TRACEMEM_TWOBANKS
26        select ESP32S2_MEMMAP_TRACEMEM_TWOBANKS
27        select ESP32S3_MEMMAP_TRACEMEM_TWOBANKS
28        default n
29        help
30            Enables/disable TRAX tracing HW.
31
32    config APPTRACE_MEMBUFS_APPTRACE_PROTO_ENABLE
33        bool
34        default n
35        help
36            Enables/disable swapping memory buffers tracing protocol.
37
38    config APPTRACE_ENABLE
39        bool
40        default n
41        help
42            Enables/disable application tracing module.
43
44    config APPTRACE_LOCK_ENABLE
45        bool
46        default !APPTRACE_SV_ENABLE
47        help
48            Enables/disable application tracing module internal sync lock.
49
50    config APPTRACE_ONPANIC_HOST_FLUSH_TMO
51        int "Timeout for flushing last trace data to host on panic"
52        depends on APPTRACE_ENABLE
53        range -1 5000
54        default -1
55        help
56            Timeout for flushing last trace data to host in case of panic. In ms.
57            Use -1 to disable timeout and wait forever.
58
59    config APPTRACE_POSTMORTEM_FLUSH_THRESH
60        int "Threshold for flushing last trace data to host on panic"
61        depends on APPTRACE_ENABLE
62        range 0 16384
63        default 0
64        help
65            Threshold for flushing last trace data to host on panic in post-mortem mode.
66            This is minimal amount of data needed to perform flush. In bytes.
67
68    config APPTRACE_BUF_SIZE
69        int "Size of the apptrace buffer"
70        depends on APPTRACE_MEMBUFS_APPTRACE_PROTO_ENABLE && !APPTRACE_DEST_TRAX
71        default 16384
72        help
73            Size of the memory buffer for trace data in bytes.
74
75    config APPTRACE_PENDING_DATA_SIZE_MAX
76        int "Size of the pending data buffer"
77        depends on APPTRACE_MEMBUFS_APPTRACE_PROTO_ENABLE
78        default 0
79        help
80            Size of the buffer for events in bytes. It is useful for buffering events from
81            the time critical code (scheduler, ISRs etc). If this parameter is 0 then
82            events will be discarded when main HW buffer is full.
83
84    menu "FreeRTOS SystemView Tracing"
85        depends on APPTRACE_ENABLE
86        config APPTRACE_SV_ENABLE
87            bool "SystemView Tracing Enable"
88            depends on APPTRACE_ENABLE
89            default n
90            help
91                Enables supporrt for SEGGER SystemView tracing functionality.
92
93        choice APPTRACE_SV_TS_SOURCE
94            prompt "Timer to use as timestamp source"
95            depends on APPTRACE_SV_ENABLE
96            default APPTRACE_SV_TS_SOURCE_CCOUNT if FREERTOS_UNICORE && !PM_ENABLE && !IDF_TARGET_ESP32C3
97            default APPTRACE_SV_TS_SOURCE_TIMER_00 if !FREERTOS_UNICORE && !PM_ENABLE && !IDF_TARGET_ESP32C3
98            default APPTRACE_SV_TS_SOURCE_ESP_TIMER if PM_ENABLE || IDF_TARGET_ESP32C3
99            help
100                SystemView needs to use a hardware timer as the source of timestamps
101                when tracing. This option selects the timer for it.
102
103            config APPTRACE_SV_TS_SOURCE_CCOUNT
104                bool "CPU cycle counter (CCOUNT)"
105                depends on FREERTOS_UNICORE && !PM_ENABLE && !IDF_TARGET_ESP32C3
106
107            config APPTRACE_SV_TS_SOURCE_TIMER_00
108                bool "Timer 0, Group 0"
109                depends on !PM_ENABLE && !IDF_TARGET_ESP32C3
110
111            config APPTRACE_SV_TS_SOURCE_TIMER_01
112                bool "Timer 1, Group 0"
113                depends on !PM_ENABLE && !IDF_TARGET_ESP32C3
114
115            config APPTRACE_SV_TS_SOURCE_TIMER_10
116                bool "Timer 0, Group 1"
117                depends on !PM_ENABLE && !IDF_TARGET_ESP32C3
118
119            config APPTRACE_SV_TS_SOURCE_TIMER_11
120                bool "Timer 1, Group 1"
121                depends on !PM_ENABLE && !IDF_TARGET_ESP32C3
122
123            config APPTRACE_SV_TS_SOURCE_ESP_TIMER
124                bool "esp_timer high resolution timer"
125
126        endchoice
127
128        config APPTRACE_SV_MAX_TASKS
129            int "Maximum supported tasks"
130            depends on APPTRACE_SV_ENABLE
131            range 1 64
132            default 16
133            help
134                Configures maximum supported tasks in sysview debug
135
136        config APPTRACE_SV_BUF_WAIT_TMO
137            int "Trace buffer wait timeout"
138            depends on APPTRACE_SV_ENABLE
139            default 500
140            help
141                Configures timeout (in us) to wait for free space in trace buffer.
142                Set to -1 to wait forever and avoid lost events.
143
144        config APPTRACE_SV_EVT_OVERFLOW_ENABLE
145            bool "Trace Buffer Overflow Event"
146            depends on APPTRACE_SV_ENABLE
147            default y
148            help
149                Enables "Trace Buffer Overflow" event.
150
151        config APPTRACE_SV_EVT_ISR_ENTER_ENABLE
152            bool "ISR Enter Event"
153            depends on APPTRACE_SV_ENABLE
154            default y
155            help
156                Enables "ISR Enter" event.
157
158        config APPTRACE_SV_EVT_ISR_EXIT_ENABLE
159            bool "ISR Exit Event"
160            depends on APPTRACE_SV_ENABLE
161            default y
162            help
163                Enables "ISR Exit" event.
164
165        config APPTRACE_SV_EVT_ISR_TO_SCHED_ENABLE
166            bool "ISR Exit to Scheduler Event"
167            depends on APPTRACE_SV_ENABLE
168            default y
169            help
170                Enables "ISR to Scheduler" event.
171
172        config APPTRACE_SV_EVT_TASK_START_EXEC_ENABLE
173            bool "Task Start Execution Event"
174            depends on APPTRACE_SV_ENABLE
175            default y
176            help
177                Enables "Task Start Execution" event.
178
179        config APPTRACE_SV_EVT_TASK_STOP_EXEC_ENABLE
180            bool "Task Stop Execution Event"
181            depends on APPTRACE_SV_ENABLE
182            default y
183            help
184                Enables "Task Stop Execution" event.
185
186        config APPTRACE_SV_EVT_TASK_START_READY_ENABLE
187            bool "Task Start Ready State Event"
188            depends on APPTRACE_SV_ENABLE
189            default y
190            help
191                Enables "Task Start Ready State" event.
192
193        config APPTRACE_SV_EVT_TASK_STOP_READY_ENABLE
194            bool "Task Stop Ready State Event"
195            depends on APPTRACE_SV_ENABLE
196            default y
197            help
198                Enables "Task Stop Ready State" event.
199
200        config APPTRACE_SV_EVT_TASK_CREATE_ENABLE
201            bool "Task Create Event"
202            depends on APPTRACE_SV_ENABLE
203            default y
204            help
205                Enables "Task Create" event.
206
207        config APPTRACE_SV_EVT_TASK_TERMINATE_ENABLE
208            bool "Task Terminate Event"
209            depends on APPTRACE_SV_ENABLE
210            default y
211            help
212                Enables "Task Terminate" event.
213
214        config APPTRACE_SV_EVT_IDLE_ENABLE
215            bool "System Idle Event"
216            depends on APPTRACE_SV_ENABLE
217            default y
218            help
219                Enables "System Idle" event.
220
221        config APPTRACE_SV_EVT_TIMER_ENTER_ENABLE
222            bool "Timer Enter Event"
223            depends on APPTRACE_SV_ENABLE
224            default y
225            help
226                Enables "Timer Enter" event.
227
228        config APPTRACE_SV_EVT_TIMER_EXIT_ENABLE
229            bool "Timer Exit Event"
230            depends on APPTRACE_SV_ENABLE
231            default y
232            help
233                Enables "Timer Exit" event.
234
235    endmenu
236
237    config APPTRACE_GCOV_ENABLE
238        bool "GCOV to Host Enable"
239        depends on APPTRACE_ENABLE && !APPTRACE_SV_ENABLE
240        select ESP_DEBUG_STUBS_ENABLE
241        default n
242        help
243            Enables support for GCOV data transfer to host.
244
245endmenu
246