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