]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/config/trcConfig.h
ba6ddd29947640ce613dcd36d6a5d74f377be279
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-Trace / config / trcConfig.h
1 /*******************************************************************************\r
2  * Trace Recorder Library for Tracealyzer v4.1.1\r
3  * Percepio AB, www.percepio.com\r
4  *\r
5  * trcConfig.h\r
6  *\r
7  * Main configuration parameters for the trace recorder library.\r
8  * More settings can be found in trcStreamingConfig.h and trcSnapshotConfig.h.\r
9  *\r
10  * Read more at http://percepio.com/2016/10/05/rtos-tracing/\r
11  *\r
12  * Terms of Use\r
13  * This file is part of the trace recorder library (RECORDER), which is the\r
14  * intellectual property of Percepio AB (PERCEPIO) and provided under a\r
15  * license as follows.\r
16  * The RECORDER may be used free of charge for the purpose of recording data\r
17  * intended for analysis in PERCEPIO products. It may not be used or modified\r
18  * for other purposes without explicit permission from PERCEPIO.\r
19  * You may distribute the RECORDER in its original source code form, assuming\r
20  * this text (terms of use, disclaimer, copyright notice) is unchanged. You are\r
21  * allowed to distribute the RECORDER with minor modifications intended for\r
22  * configuration or porting of the RECORDER, e.g., to allow using it on a\r
23  * specific processor, processor family or with a specific communication\r
24  * interface. Any such modifications should be documented directly below\r
25  * this comment block.\r
26  *\r
27  * Disclaimer\r
28  * The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty\r
29  * as to its use or performance. PERCEPIO does not and cannot warrant the\r
30  * performance or results you may obtain by using the RECORDER or documentation.\r
31  * PERCEPIO make no warranties, express or implied, as to noninfringement of\r
32  * third party rights, merchantability, or fitness for any particular purpose.\r
33  * In no event will PERCEPIO, its technology partners, or distributors be liable\r
34  * to you for any consequential, incidental or special damages, including any\r
35  * lost profits or lost savings, even if a representative of PERCEPIO has been\r
36  * advised of the possibility of such damages, or for any claim by any third\r
37  * party. Some jurisdictions do not allow the exclusion or limitation of\r
38  * incidental, consequential or special damages, or the exclusion of implied\r
39  * warranties or limitations on how long an implied warranty may last, so the\r
40  * above limitations may not apply to you.\r
41  *\r
42  * Tabs are used for indent in this file (1 tab = 4 spaces)\r
43  *\r
44  * Copyright Percepio AB, 2018.\r
45  * www.percepio.com\r
46  ******************************************************************************/\r
47 \r
48 #ifndef TRC_CONFIG_H\r
49 #define TRC_CONFIG_H\r
50 \r
51 #ifdef __cplusplus\r
52 extern "C" {\r
53 #endif\r
54 \r
55 #include "trcPortDefines.h"\r
56 \r
57 /******************************************************************************\r
58  * Include of processor header file\r
59  *\r
60  * Here you may need to include the header file for your processor. This is\r
61  * required at least for the ARM Cortex-M port, that uses the ARM CMSIS API.\r
62  * Try that in case of build problems. Otherwise, remove the #error line below.\r
63  *****************************************************************************/\r
64 #error "Trace Recorder: Please include your processor's header file here and remove this line."\r
65 \r
66 /*******************************************************************************\r
67  * Configuration Macro: TRC_CFG_HARDWARE_PORT\r
68  *\r
69  * Specify what hardware port to use (i.e., the "timestamping driver").\r
70  *\r
71  * All ARM Cortex-M MCUs are supported by "TRC_HARDWARE_PORT_ARM_Cortex_M".\r
72  * This port uses the DWT cycle counter for Cortex-M3/M4/M7 devices, which is\r
73  * available on most such devices. In case your device don't have DWT support,\r
74  * you will get an error message opening the trace. In that case, you may\r
75  * force the recorder to use SysTick timestamping instead, using this define:\r
76  *\r
77  * #define TRC_CFG_ARM_CM_USE_SYSTICK\r
78  *\r
79  * For ARM Cortex-M0/M0+ devices, SysTick mode is used automatically.\r
80  *\r
81  * See trcHardwarePort.h for available ports and information on how to\r
82  * define your own port, if not already present.\r
83  ******************************************************************************/\r
84 #define TRC_CFG_HARDWARE_PORT TRC_HARDWARE_PORT_NOT_SET\r
85 \r
86 /*******************************************************************************\r
87  * Configuration Macro: TRC_CFG_RECORDER_MODE\r
88  *\r
89  * Specify what recording mode to use. Snapshot means that the data is saved in\r
90  * an internal RAM buffer, for later upload. Streaming means that the data is\r
91  * transferred continuously to the host PC.\r
92  *\r
93  * For more information, see http://percepio.com/2016/10/05/rtos-tracing/\r
94  * and the Tracealyzer User Manual.\r
95  *\r
96  * Values:\r
97  * TRC_RECORDER_MODE_SNAPSHOT\r
98  * TRC_RECORDER_MODE_STREAMING\r
99  ******************************************************************************/\r
100 #define TRC_CFG_RECORDER_MODE TRC_RECORDER_MODE_SNAPSHOT\r
101 \r
102 /******************************************************************************\r
103  * TRC_CFG_FREERTOS_VERSION\r
104  *\r
105  * Specify what version of FreeRTOS that is used (don't change unless using the\r
106  * trace recorder library with an older version of FreeRTOS).\r
107  *\r
108  * TRC_FREERTOS_VERSION_7_3                                             If using FreeRTOS v7.3.x\r
109  * TRC_FREERTOS_VERSION_7_4                                             If using FreeRTOS v7.4.x \r
110  * TRC_FREERTOS_VERSION_7_5_OR_7_6                              If using FreeRTOS v7.5.0 - v7.6.0\r
111  * TRC_FREERTOS_VERSION_8_X                                             If using FreeRTOS v8.X.X\r
112  * TRC_FREERTOS_VERSION_9_0_0                                   If using FreeRTOS v9.0.0\r
113  * TRC_FREERTOS_VERSION_9_0_1                                   If using FreeRTOS v9.0.1\r
114  * TRC_FREERTOS_VERSION_9_0_2                                   If using FreeRTOS v9.0.2\r
115  * TRC_FREERTOS_VERSION_10_0_0                                  If using FreeRTOS v10.0.0 or later\r
116  *****************************************************************************/\r
117 #define TRC_CFG_FREERTOS_VERSION TRC_FREERTOS_VERSION_10_0_0\r
118 \r
119 /*******************************************************************************\r
120  * TRC_CFG_SCHEDULING_ONLY\r
121  *\r
122  * Macro which should be defined as an integer value.\r
123  *\r
124  * If this setting is enabled (= 1), only scheduling events are recorded.\r
125  * If disabled (= 0), all events are recorded (unless filtered in other ways).\r
126  *\r
127  * Default value is 0 (= include additional events).\r
128  ******************************************************************************/\r
129 #define TRC_CFG_SCHEDULING_ONLY 0\r
130 \r
131  /******************************************************************************\r
132  * TRC_CFG_INCLUDE_MEMMANG_EVENTS\r
133  *\r
134  * Macro which should be defined as either zero (0) or one (1).\r
135  *\r
136  * This controls if malloc and free calls should be traced. Set this to zero (0)\r
137  * to exclude malloc/free calls, or one (1) to include such events in the trace.\r
138  *\r
139  * Default value is 1.\r
140  *****************************************************************************/\r
141 #define TRC_CFG_INCLUDE_MEMMANG_EVENTS 1\r
142 \r
143  /******************************************************************************\r
144  * TRC_CFG_INCLUDE_USER_EVENTS\r
145  *\r
146  * Macro which should be defined as either zero (0) or one (1).\r
147  *\r
148  * If this is zero (0), all code related to User Events is excluded in order \r
149  * to reduce code size. Any attempts of storing User Events are then silently\r
150  * ignored.\r
151  *\r
152  * User Events are application-generated events, like "printf" but for the \r
153  * trace log, generated using vTracePrint and vTracePrintF. \r
154  * The formatting is done on host-side, by Tracealyzer. User Events are \r
155  * therefore much faster than a console printf and can often be used\r
156  * in timing critical code without problems.\r
157  *\r
158  * Note: In streaming mode, User Events are used to provide error messages\r
159  * and warnings from the recorder (in case of incorrect configuration) for\r
160  * display in Tracealyzer. Disabling user events will also disable these\r
161  * warnings. You can however still catch them by calling xTraceGetLastError\r
162  * or by putting breakpoints in prvTraceError and prvTraceWarning.\r
163  *\r
164  * Default value is 1.\r
165  *****************************************************************************/\r
166 #define TRC_CFG_INCLUDE_USER_EVENTS 1\r
167 \r
168  /*****************************************************************************\r
169  * TRC_CFG_INCLUDE_ISR_TRACING\r
170  *\r
171  * Macro which should be defined as either zero (0) or one (1).\r
172  *\r
173  * If this is zero (0), the code for recording Interrupt Service Routines is\r
174  * excluded, in order to reduce code size.\r
175  *\r
176  * Default value is 1.\r
177  *\r
178  * Note: tracing ISRs requires that you insert calls to vTraceStoreISRBegin\r
179  * and vTraceStoreISREnd in your interrupt handlers.\r
180  *****************************************************************************/\r
181 #define TRC_CFG_INCLUDE_ISR_TRACING 1\r
182 \r
183  /*****************************************************************************\r
184  * TRC_CFG_INCLUDE_READY_EVENTS\r
185  *\r
186  * Macro which should be defined as either zero (0) or one (1).\r
187  *\r
188  * If one (1), events are recorded when tasks enter scheduling state "ready".\r
189  * This allows Tracealyzer to show the initial pending time before tasks enter\r
190  * the execution state, and present accurate response times.\r
191  * If zero (0), "ready events" are not created, which allows for recording\r
192  * longer traces in the same amount of RAM.\r
193  *\r
194  * Default value is 1.\r
195  *****************************************************************************/\r
196 #define TRC_CFG_INCLUDE_READY_EVENTS 1\r
197 \r
198  /*****************************************************************************\r
199  * TRC_CFG_INCLUDE_OSTICK_EVENTS\r
200  *\r
201  * Macro which should be defined as either zero (0) or one (1).\r
202  *\r
203  * If this is one (1), events will be generated whenever the OS clock is\r
204  * increased. If zero (0), OS tick events are not generated, which allows for\r
205  * recording longer traces in the same amount of RAM.\r
206  *\r
207  * Default value is 1.\r
208  *****************************************************************************/\r
209 #define TRC_CFG_INCLUDE_OSTICK_EVENTS 1\r
210 \r
211  /*****************************************************************************\r
212  * TRC_CFG_INCLUDE_EVENT_GROUP_EVENTS\r
213  *\r
214  * Macro which should be defined as either zero (0) or one (1).\r
215  *\r
216  * If this is zero (0), the trace will exclude any "event group" events.\r
217  *\r
218  * Default value is 0 (excluded) since dependent on event_groups.c\r
219  *****************************************************************************/\r
220 #define TRC_CFG_INCLUDE_EVENT_GROUP_EVENTS 0\r
221 \r
222  /*****************************************************************************\r
223  * TRC_CFG_INCLUDE_TIMER_EVENTS\r
224  *\r
225  * Macro which should be defined as either zero (0) or one (1).\r
226  *\r
227  * If this is zero (0), the trace will exclude any Timer events.\r
228  *\r
229  * Default value is 0 since dependent on timers.c\r
230  *****************************************************************************/\r
231 #define TRC_CFG_INCLUDE_TIMER_EVENTS 0\r
232 \r
233  /*****************************************************************************\r
234  * TRC_CFG_INCLUDE_PEND_FUNC_CALL_EVENTS\r
235  *\r
236  * Macro which should be defined as either zero (0) or one (1).\r
237  *\r
238  * If this is zero (0), the trace will exclude any "pending function call" \r
239  * events, such as xTimerPendFunctionCall().\r
240  *\r
241  * Default value is 0 since dependent on timers.c\r
242  *****************************************************************************/\r
243 #define TRC_CFG_INCLUDE_PEND_FUNC_CALL_EVENTS 0\r
244 \r
245 /*******************************************************************************\r
246  * Configuration Macro: TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS\r
247  *\r
248  * Macro which should be defined as either zero (0) or one (1).\r
249  *\r
250  * If this is zero (0), the trace will exclude any stream buffer or message\r
251  * buffer events.\r
252  *\r
253  * Default value is 0 since dependent on stream_buffer.c (new in FreeRTOS v10)\r
254  ******************************************************************************/\r
255 #define TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS 0\r
256 \r
257 /*******************************************************************************\r
258  * Configuration Macro: TRC_CFG_RECORDER_BUFFER_ALLOCATION\r
259  *\r
260  * Specifies how the recorder buffer is allocated (also in case of streaming, in\r
261  * port using the recorder's internal temporary buffer)\r
262  *\r
263  * Values:\r
264  * TRC_RECORDER_BUFFER_ALLOCATION_STATIC  - Static allocation (internal)\r
265  * TRC_RECORDER_BUFFER_ALLOCATION_DYNAMIC - Malloc in vTraceEnable\r
266  * TRC_RECORDER_BUFFER_ALLOCATION_CUSTOM  - Use vTraceSetRecorderDataBuffer\r
267  *\r
268  * Static and dynamic mode does the allocation for you, either in compile time\r
269  * (static) or in runtime (malloc).\r
270  * The custom mode allows you to control how and where the allocation is made,\r
271  * for details see TRC_ALLOC_CUSTOM_BUFFER and vTraceSetRecorderDataBuffer().\r
272  ******************************************************************************/\r
273 #define TRC_CFG_RECORDER_BUFFER_ALLOCATION TRC_RECORDER_BUFFER_ALLOCATION_STATIC\r
274 \r
275 /******************************************************************************\r
276  * TRC_CFG_MAX_ISR_NESTING\r
277  *\r
278  * Defines how many levels of interrupt nesting the recorder can handle, in\r
279  * case multiple ISRs are traced and ISR nesting is possible. If this\r
280  * is exceeded, the particular ISR will not be traced and the recorder then\r
281  * logs an error message. This setting is used to allocate an internal stack\r
282  * for keeping track of the previous execution context (4 byte per entry).\r
283  *\r
284  * This value must be a non-zero positive constant, at least 1.\r
285  *\r
286  * Default value: 8\r
287  *****************************************************************************/\r
288 #define TRC_CFG_MAX_ISR_NESTING 8\r
289 \r
290 /* Specific configuration, depending on Streaming/Snapshot mode */\r
291 #if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_SNAPSHOT)\r
292 #include "trcSnapshotConfig.h"\r
293 #elif (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)\r
294 #include "trcStreamingConfig.h"\r
295 #endif\r
296 \r
297 #ifdef __cplusplus\r
298 }\r
299 #endif\r
300 \r
301 #endif /* _TRC_CONFIG_H */\r