]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/WIN32-MSVC/Trace_Recorder_Configuration/trcConfig.h
37345d497d8cdcae3f4001aa7c8151bfcc52a594
[freertos] / FreeRTOS / Demo / WIN32-MSVC / Trace_Recorder_Configuration / trcConfig.h
1 /*******************************************************************************\r
2  * Trace Recorder Library for Tracealyzer v3.1.2\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, 2016.\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_Win32\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  * TRC_CFG_FREERTOS_VERSION\r
103  *\r
104  * Specify what version of FreeRTOS that is used (don't change unless using the\r
105  * trace recorder library with an older version of FreeRTOS).\r
106  *\r
107  * TRC_FREERTOS_VERSION_7_3                                             If using FreeRTOS v7.3.x\r
108  * TRC_FREERTOS_VERSION_7_4                                             If using FreeRTOS v7.4.x \r
109  * TRC_FREERTOS_VERSION_7_5_OR_7_6                              If using FreeRTOS v7.5.0 - v7.6.0\r
110  * TRC_FREERTOS_VERSION_8_X                                             If using FreeRTOS v8.X.X\r
111  * TRC_FREERTOS_VERSION_9_0_0                                   If using FreeRTOS v9.0.0\r
112  * TRC_FREERTOS_VERSION_9_0_1                                   If using FreeRTOS v9.0.1\r
113  * TRC_FREERTOS_VERSION_9_0_2                                   If using FreeRTOS v9.0.2\r
114  * TRC_FREERTOS_VERSION_10_0_0                                  If using FreeRTOS v10.0.0 or later\r
115  *****************************************************************************/\r
116 #define TRC_CFG_FREERTOS_VERSION TRC_FREERTOS_VERSION_10_0_0\r
117 \r
118 /*******************************************************************************\r
119  * TRC_CFG_SCHEDULING_ONLY\r
120  *\r
121  * Macro which should be defined as an integer value.\r
122  *\r
123  * If this setting is enabled (= 1), only scheduling events are recorded.\r
124  * If disabled (= 0), all events are recorded (unless filtered in other ways).\r
125  *\r
126  * Default value is 0 (= include additional events).\r
127  ******************************************************************************/\r
128 #define TRC_CFG_SCHEDULING_ONLY 0\r
129 \r
130  /******************************************************************************\r
131  * TRC_CFG_INCLUDE_MEMMANG_EVENTS\r
132  *\r
133  * Macro which should be defined as either zero (0) or one (1).\r
134  *\r
135  * This controls if malloc and free calls should be traced. Set this to zero (0)\r
136  * to exclude malloc/free calls, or one (1) to include such events in the trace.\r
137  *\r
138  * Default value is 1.\r
139  *****************************************************************************/\r
140 #define TRC_CFG_INCLUDE_MEMMANG_EVENTS 1\r
141 \r
142  /******************************************************************************\r
143  * TRC_CFG_INCLUDE_USER_EVENTS\r
144  *\r
145  * Macro which should be defined as either zero (0) or one (1).\r
146  *\r
147  * If this is zero (0), all code related to User Events is excluded in order \r
148  * to reduce code size. Any attempts of storing User Events are then silently\r
149  * ignored.\r
150  *\r
151  * User Events are application-generated events, like "printf" but for the \r
152  * trace log, generated using vTracePrint and vTracePrintF. \r
153  * The formatting is done on host-side, by Tracealyzer. User Events are \r
154  * therefore much faster than a console printf and can often be used\r
155  * in timing critical code without problems.\r
156  *\r
157  * Note: In streaming mode, User Events are used to provide error messages\r
158  * and warnings from the recorder (in case of incorrect configuration) for\r
159  * display in Tracealyzer. Disabling user events will also disable these\r
160  * warnings. You can however still catch them by calling xTraceGetLastError\r
161  * or by putting breakpoints in prvTraceError and prvTraceWarning.\r
162  *\r
163  * Default value is 1.\r
164  *****************************************************************************/\r
165 #define TRC_CFG_INCLUDE_USER_EVENTS 1\r
166 \r
167  /*****************************************************************************\r
168  * TRC_CFG_INCLUDE_ISR_TRACING\r
169  *\r
170  * Macro which should be defined as either zero (0) or one (1).\r
171  *\r
172  * If this is zero (0), the code for recording Interrupt Service Routines is\r
173  * excluded, in order to reduce code size.\r
174  *\r
175  * Default value is 1.\r
176  *\r
177  * Note: tracing ISRs requires that you insert calls to vTraceStoreISRBegin\r
178  * and vTraceStoreISREnd in your interrupt handlers.\r
179  *****************************************************************************/\r
180 #define TRC_CFG_INCLUDE_ISR_TRACING 1\r
181 \r
182  /*****************************************************************************\r
183  * TRC_CFG_INCLUDE_READY_EVENTS\r
184  *\r
185  * Macro which should be defined as either zero (0) or one (1).\r
186  *\r
187  * If one (1), events are recorded when tasks enter scheduling state "ready".\r
188  * This allows Tracealyzer to show the initial pending time before tasks enter\r
189  * the execution state, and present accurate response times.\r
190  * If zero (0), "ready events" are not created, which allows for recording\r
191  * longer traces in the same amount of RAM.\r
192  *\r
193  * Default value is 1.\r
194  *****************************************************************************/\r
195 #define TRC_CFG_INCLUDE_READY_EVENTS 1\r
196 \r
197  /*****************************************************************************\r
198  * TRC_CFG_INCLUDE_OSTICK_EVENTS\r
199  *\r
200  * Macro which should be defined as either zero (0) or one (1).\r
201  *\r
202  * If this is one (1), events will be generated whenever the OS clock is\r
203  * increased. If zero (0), OS tick events are not generated, which allows for\r
204  * recording longer traces in the same amount of RAM.\r
205  *\r
206  * Default value is 1.\r
207  *****************************************************************************/\r
208 #define TRC_CFG_INCLUDE_OSTICK_EVENTS 1\r
209 \r
210  /*****************************************************************************\r
211  * TRC_CFG_INCLUDE_EVENT_GROUP_EVENTS\r
212  *\r
213  * Macro which should be defined as either zero (0) or one (1).\r
214  *\r
215  * If this is zero (0), the trace will exclude any "event group" events.\r
216  *\r
217  * Default value is 0 (excluded) since dependent on event_groups.c\r
218  *****************************************************************************/\r
219 #define TRC_CFG_INCLUDE_EVENT_GROUP_EVENTS 1\r
220 \r
221  /*****************************************************************************\r
222  * TRC_CFG_INCLUDE_TIMER_EVENTS\r
223  *\r
224  * Macro which should be defined as either zero (0) or one (1).\r
225  *\r
226  * If this is zero (0), the trace will exclude any Timer events.\r
227  *\r
228  * Default value is 0 since dependent on timers.c\r
229  *****************************************************************************/\r
230 #define TRC_CFG_INCLUDE_TIMER_EVENTS 1\r
231 \r
232  /*****************************************************************************\r
233  * TRC_CFG_INCLUDE_PEND_FUNC_CALL_EVENTS\r
234  *\r
235  * Macro which should be defined as either zero (0) or one (1).\r
236  *\r
237  * If this is zero (0), the trace will exclude any "pending function call" \r
238  * events, such as xTimerPendFunctionCall().\r
239  *\r
240  * Default value is 0 since dependent on timers.c\r
241  *****************************************************************************/\r
242 #define TRC_CFG_INCLUDE_PEND_FUNC_CALL_EVENTS 1\r
243 \r
244 /*******************************************************************************\r
245  * Configuration Macro: TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS\r
246  *\r
247  * Macro which should be defined as either zero (0) or one (1).\r
248  *\r
249  * If this is zero (0), the trace will exclude any stream buffer or message\r
250  * buffer events.\r
251  *\r
252  * Default value is 0 since dependent on stream_buffer.c (new in FreeRTOS v10)\r
253  ******************************************************************************/\r
254 #define TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS 1\r
255 \r
256 /*******************************************************************************\r
257  * Configuration Macro: TRC_CFG_RECORDER_BUFFER_ALLOCATION\r
258  *\r
259  * Specifies how the recorder buffer is allocated (also in case of streaming, in\r
260  * port using the recorder's internal temporary buffer)\r
261  *\r
262  * Values:\r
263  * TRC_RECORDER_BUFFER_ALLOCATION_STATIC  - Static allocation (internal)\r
264  * TRC_RECORDER_BUFFER_ALLOCATION_DYNAMIC - Malloc in vTraceEnable\r
265  * TRC_RECORDER_BUFFER_ALLOCATION_CUSTOM  - Use vTraceSetRecorderDataBuffer\r
266  *\r
267  * Static and dynamic mode does the allocation for you, either in compile time\r
268  * (static) or in runtime (malloc).\r
269  * The custom mode allows you to control how and where the allocation is made,\r
270  * for details see TRC_ALLOC_CUSTOM_BUFFER and vTraceSetRecorderDataBuffer().\r
271  ******************************************************************************/\r
272 #define TRC_CFG_RECORDER_BUFFER_ALLOCATION TRC_RECORDER_BUFFER_ALLOCATION_STATIC\r
273 \r
274 /******************************************************************************\r
275  * TRC_CFG_MAX_ISR_NESTING\r
276  *\r
277  * Defines how many levels of interrupt nesting the recorder can handle, in\r
278  * case multiple ISRs are traced and ISR nesting is possible. If this\r
279  * is exceeded, the particular ISR will not be traced and the recorder then\r
280  * logs an error message. This setting is used to allocate an internal stack\r
281  * for keeping track of the previous execution context (4 byte per entry).\r
282  *\r
283  * This value must be a non-zero positive constant, at least 1.\r
284  *\r
285  * Default value: 8\r
286  *****************************************************************************/\r
287 #define TRC_CFG_MAX_ISR_NESTING 8\r
288 \r
289 /* Specific configuration, depending on Streaming/Snapshot mode */\r
290 #if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_SNAPSHOT)\r
291 #include "trcSnapshotConfig.h"\r
292 #elif (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)\r
293 #include "trcStreamingConfig.h"\r
294 #endif\r
295 \r
296 #ifdef __cplusplus\r
297 }\r
298 #endif\r
299 \r
300 #endif /* _TRC_CONFIG_H */\r