]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcKernelPort.h
Update to latest FreeRTOS+Trace recorder code.
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-Trace / trcKernelPort.h
1 /*******************************************************************************\r
2  * Tracealyzer v2.4.1 Recorder Library\r
3  * Percepio AB, www.percepio.com\r
4  *\r
5  * trcKernelPort.h\r
6  *\r
7  * Kernel-specific functionality for FreeRTOS, used by the recorder library.\r
8  * \r
9  * Terms of Use\r
10  * This software is copyright Percepio AB. The recorder library is free for\r
11  * use together with Percepio products. You may distribute the recorder library\r
12  * in its original form, including modifications in trcHardwarePort.c/.h\r
13  * given that these modification are clearly marked as your own modifications\r
14  * and documented in the initial comment section of these source files. \r
15  * This software is the intellectual property of Percepio AB and may not be \r
16  * sold or in other ways commercially redistributed without explicit written \r
17  * permission by Percepio AB.\r
18  *\r
19  * Disclaimer \r
20  * The trace tool and recorder library is being delivered to you AS IS and \r
21  * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
22  * not and cannot warrant the performance or results you may obtain by using the \r
23  * software or documentation. Percepio AB make no warranties, express or \r
24  * implied, as to noninfringement of third party rights, merchantability, or \r
25  * fitness for any particular purpose. In no event will Percepio AB, its \r
26  * technology partners, or distributors be liable to you for any consequential, \r
27  * incidental or special damages, including any lost profits or lost savings, \r
28  * even if a representative of Percepio AB has been advised of the possibility \r
29  * of such damages, or for any claim by any third party. Some jurisdictions do \r
30  * not allow the exclusion or limitation of incidental, consequential or special \r
31  * damages, or the exclusion of implied warranties or limitations on how long an \r
32  * implied warranty may last, so the above limitations may not apply to you.\r
33  *\r
34  * Copyright Percepio AB, 2013.\r
35  * www.percepio.com\r
36  ******************************************************************************/\r
37 \r
38 \r
39 #ifndef TRCKERNELPORT_H_\r
40 #define TRCKERNELPORT_H_\r
41 \r
42 #include "FreeRTOS.h"   // Defines configUSE_TRACE_FACILITY\r
43 \r
44 #define USE_TRACEALYZER_RECORDER configUSE_TRACE_FACILITY\r
45 \r
46 #if (USE_TRACEALYZER_RECORDER == 1)\r
47 \r
48 /* Defines that must be set for the recorder to work properly */\r
49 #define TRACE_KERNEL_VERSION 0x1AA1\r
50 #define TRACE_CPU_CLOCK_HZ configCPU_CLOCK_HZ /* Defined in "FreeRTOS.h" */\r
51 #define TRACE_PERIPHERAL_CLOCK_HZ configPERIPHERAL_CLOCK_HZ /* Defined in "FreeRTOS.h" */\r
52 #define TRACE_TICK_RATE_HZ configTICK_RATE_HZ /* Defined in "FreeRTOS.h" */\r
53 #define TRACE_CPU_CLOCKS_PER_TICK configCPU_CLOCKS_PER_TICK /* Defined in "FreeRTOS.h" */\r
54 \r
55 /************************************************************************/\r
56 /* KERNEL SPECIFIC OBJECT CONFIGURATION                                 */\r
57 /************************************************************************/\r
58 #define TRACE_NCLASSES 5\r
59 #define TRACE_CLASS_QUEUE ((traceObjectClass)0)\r
60 #define TRACE_CLASS_SEMAPHORE ((traceObjectClass)1)\r
61 #define TRACE_CLASS_MUTEX ((traceObjectClass)2)\r
62 #define TRACE_CLASS_TASK ((traceObjectClass)3)\r
63 #define TRACE_CLASS_ISR ((traceObjectClass)4)\r
64 \r
65 #define TRACE_KERNEL_OBJECT_COUNT (NQueue + NSemaphore + NMutex + NTask + NISR)\r
66 \r
67 /* The size of the Object Property Table entries, in bytes, per object */\r
68 \r
69 /* Queue properties (except name):     current number of message in queue */\r
70 #define PropertyTableSizeQueue         (NameLenQueue + 1)      \r
71 \r
72 /* Semaphore properties (except name): state (signaled = 1, cleared = 0) */\r
73 #define PropertyTableSizeSemaphore     (NameLenSemaphore + 1) \r
74 \r
75 /* Mutex properties (except name):     owner (task handle, 0 = free) */\r
76 #define PropertyTableSizeMutex         (NameLenMutex + 1)         \r
77 \r
78 /* Task properties (except name):      Byte 0: Current priority\r
79                                        Byte 1: state (if already active) \r
80                                        Byte 2: legacy, not used\r
81                                        Byte 3: legacy, not used */\r
82 #define PropertyTableSizeTask         (NameLenTask + 4)\r
83 \r
84 /* ISR properties:                     Byte 0: priority\r
85                                        Byte 1: state (if already active) */\r
86 #define PropertyTableSizeISR          (NameLenISR + 2)\r
87 \r
88 /* The layout of the byte array representing the Object Property Table */\r
89 #define StartIndexQueue            0\r
90 #define StartIndexSemaphore        StartIndexQueue     + NQueue * PropertyTableSizeQueue\r
91 #define StartIndexMutex            StartIndexSemaphore + NSemaphore * PropertyTableSizeSemaphore\r
92 #define StartIndexTask             StartIndexMutex     + NMutex * PropertyTableSizeMutex\r
93 #define StartIndexISR              StartIndexTask      + NTask * PropertyTableSizeTask\r
94 \r
95 /* Number of bytes used by the object table */\r
96 #define TRACE_OBJECT_TABLE_SIZE    StartIndexISR       + NISR * PropertyTableSizeISR\r
97 \r
98 \r
99 /* Includes */\r
100 #include "trcTypes.h"\r
101 #include "trcConfig.h"\r
102 #include "trcKernelHooks.h"\r
103 #include "trcHardwarePort.h"\r
104 #include "trcBase.h"\r
105 #include "trcKernel.h"\r
106 #include "trcUser.h"\r
107 \r
108 /* Initialization of the object property table */\r
109 void vTraceInitObjectPropertyTable(void);\r
110 \r
111 /* Initialization of the handle mechanism, see e.g, xTraceGetObjectHandle */\r
112 void vTraceInitObjectHandleStack(void);\r
113 \r
114 /* Returns the "Not enough handles" error message for the specified object class */\r
115 const char* pszTraceGetErrorNotEnoughHandles(traceObjectClass objectclass);\r
116 \r
117 /*******************************************************************************\r
118  * The event codes - should match the offline config file.\r
119  * \r
120  * Some sections below are encoded to allow for constructions like:\r
121  *\r
122  *  vTraceStoreKernelCall(EVENTGROUP_CREATE + objectclass, ...\r
123  *\r
124  * The object class ID is given by the three LSB bits, in such cases. Since each \r
125  * object class has a separate object property table, the class ID is needed to \r
126  * know what section in the object table to use for getting an object name from\r
127  * an object handle. \r
128  ******************************************************************************/\r
129 \r
130 #define NULL_EVENT                   (0x00)  /* Ignored in the analysis*/\r
131 \r
132 /*******************************************************************************\r
133  * EVENTGROUP_DIV\r
134  *\r
135  * Miscellaneous events.\r
136  ******************************************************************************/\r
137 #define EVENTGROUP_DIV               (NULL_EVENT + 1)                   /*0x01*/\r
138 #define DIV_XPS                      (EVENTGROUP_DIV + 0)               /*0x01*/\r
139 #define DIV_TASK_READY               (EVENTGROUP_DIV + 1)               /*0x02*/\r
140 #define DIV_NEW_TIME                 (EVENTGROUP_DIV + 2)               /*0x03*/\r
141 \r
142 /*******************************************************************************\r
143  * EVENTGROUP_TS\r
144  *\r
145  * Events for storing task-switches and interrupts. The RESUME events are \r
146  * generated if the task/interrupt is already marked active.\r
147  ******************************************************************************/\r
148 #define EVENTGROUP_TS                (EVENTGROUP_DIV + 3)               /*0x04*/\r
149 #define TS_ISR_BEGIN                 (EVENTGROUP_TS + 0)                /*0x04*/\r
150 #define TS_ISR_RESUME                (EVENTGROUP_TS + 1)                /*0x05*/\r
151 #define TS_TASK_BEGIN                (EVENTGROUP_TS + 2)                /*0x06*/\r
152 #define TS_TASK_RESUME               (EVENTGROUP_TS + 3)                /*0x07*/\r
153 \r
154 /*******************************************************************************\r
155  * EVENTGROUP_OBJCLOSE_NAME\r
156  * \r
157  * About Close Events\r
158  * When an object is evicted from the object property table (object close), two \r
159  * internal events are stored (EVENTGROUP_OBJCLOSE_NAME and \r
160  * EVENTGROUP_OBJCLOSE_PROP), containing the handle-name mapping and object \r
161  * properties valid up to this point.\r
162  ******************************************************************************/\r
163 #define EVENTGROUP_OBJCLOSE_NAME     (EVENTGROUP_TS + 4)                /*0x08*/\r
164 \r
165 /*******************************************************************************\r
166  * EVENTGROUP_OBJCLOSE_PROP\r
167  * \r
168  * The internal event carrying properties of deleted objects\r
169  * The handle and object class of the closed object is not stored in this event, \r
170  * but is assumed to be the same as in the preceding CLOSE event. Thus, these \r
171  * two events must be generated from within a critical section. \r
172  * When queues are closed, arg1 is the "state" property (i.e., number of \r
173  * buffered messages/signals).\r
174  * When actors are closed, arg1 is priority, arg2 is handle of the "instance \r
175  * finish" event, and arg3 is event code of the "instance finish" event. \r
176  * In this case, the lower three bits is the object class of the instance finish \r
177  * handle. The lower three bits are not used (always zero) when queues are \r
178  * closed since the queue type is given in the previous OBJCLOSE_NAME event.\r
179  ******************************************************************************/\r
180 #define EVENTGROUP_OBJCLOSE_PROP     (EVENTGROUP_OBJCLOSE_NAME + 8)     /*0x10*/\r
181 \r
182 /*******************************************************************************\r
183  * EVENTGROUP_CREATE\r
184  * \r
185  * The events in this group are used to log Kernel object creations.\r
186  * The lower three bits in the event code gives the object class, i.e., type of\r
187  * create operation (task, queue, semaphore, etc).\r
188  ******************************************************************************/\r
189 #define EVENTGROUP_CREATE_SUCCESS    (EVENTGROUP_OBJCLOSE_PROP + 8)             /*0x18*/\r
190 \r
191 /*******************************************************************************\r
192  * EVENTGROUP_SEND\r
193  * \r
194  * The events in this group are used to log Send/Give events on queues, \r
195  * semaphores and mutexes The lower three bits in the event code gives the \r
196  * object class, i.e., what type of object that is operated on (queue, semaphore \r
197  * or mutex).\r
198  ******************************************************************************/\r
199 #define EVENTGROUP_SEND_SUCCESS      (EVENTGROUP_CREATE_SUCCESS + 8)                    /*0x20*/\r
200 \r
201 /*******************************************************************************\r
202  * EVENTGROUP_RECEIVE\r
203  * \r
204  * The events in this group are used to log Receive/Take events on queues, \r
205  * semaphores and mutexes. The lower three bits in the event code gives the \r
206  * object class, i.e., what type of object that is operated on (queue, semaphore\r
207  * or mutex).\r
208  ******************************************************************************/\r
209 #define EVENTGROUP_RECEIVE_SUCCESS                       (EVENTGROUP_SEND_SUCCESS + 8)  /*0x28*/\r
210 \r
211 /* Send/Give operations, from ISR */\r
212 #define EVENTGROUP_SEND_FROM_ISR_SUCCESS              (EVENTGROUP_RECEIVE_SUCCESS + 8)  /*0x30*/\r
213 \r
214 /* Receive/Take operations, from ISR */\r
215 #define EVENTGROUP_RECEIVE_FROM_ISR_SUCCESS     (EVENTGROUP_SEND_FROM_ISR_SUCCESS + 8)  /*0x38*/\r
216 \r
217 /* "Failed" event type versions of above (timeout, failed allocation, etc) */\r
218 #define EVENTGROUP_KSE_FAILED         (EVENTGROUP_RECEIVE_FROM_ISR_SUCCESS + 8) /*0x40*/\r
219 \r
220 /* Failed create calls - memory allocation failed */\r
221 #define EVENTGROUP_CREATE_FAILED                (EVENTGROUP_KSE_FAILED) /*0x40*/\r
222 \r
223 /* Failed send/give - timeout! */\r
224 #define EVENTGROUP_SEND_FAILED           (EVENTGROUP_CREATE_FAILED + 8) /*0x48*/\r
225 \r
226 /* Failed receive/take - timeout! */\r
227 #define EVENTGROUP_RECEIVE_FAILED          (EVENTGROUP_SEND_FAILED + 8) /*0x50*/\r
228 \r
229 /* Failed non-blocking send/give - queue full */\r
230 #define EVENTGROUP_SEND_FROM_ISR_FAILED (EVENTGROUP_RECEIVE_FAILED + 8) /*0x58*/\r
231 \r
232 /* Failed non-blocking receive/take - queue empty */\r
233 #define EVENTGROUP_RECEIVE_FROM_ISR_FAILED \\r
234                                   (EVENTGROUP_SEND_FROM_ISR_FAILED + 8) /*0x60*/\r
235 \r
236 /* Events when blocking on receive/take */\r
237 #define EVENTGROUP_RECEIVE_BLOCK \\r
238                                (EVENTGROUP_RECEIVE_FROM_ISR_FAILED + 8) /*0x68*/\r
239 \r
240 /* Events when blocking on send/give */\r
241 #define EVENTGROUP_SEND_BLOCK     (EVENTGROUP_RECEIVE_BLOCK + 8)  /*0x70*/\r
242 \r
243 /* Events on queue peek (receive) */\r
244 #define EVENTGROUP_PEEK_SUCCESS              (EVENTGROUP_SEND_BLOCK + 8)     /*0x78*/\r
245 \r
246 /* Events on object delete (vTaskDelete or vQueueDelete) */\r
247 #define EVENTGROUP_DELETE_SUCCESS            (EVENTGROUP_PEEK_SUCCESS + 8)              /*0x80*/\r
248 \r
249 /* Other events - object class is implied: TASK */\r
250 #define EVENTGROUP_OTHERS            (EVENTGROUP_DELETE_SUCCESS + 8)            /*0x88*/\r
251 #define TASK_DELAY_UNTIL             (EVENTGROUP_OTHERS + 0)            /*0x88*/\r
252 #define TASK_DELAY                   (EVENTGROUP_OTHERS + 1)            /*0x89*/\r
253 #define TASK_SUSPEND                 (EVENTGROUP_OTHERS + 2)            /*0x8A*/\r
254 #define TASK_RESUME                  (EVENTGROUP_OTHERS + 3)            /*0x8B*/\r
255 #define TASK_RESUME_FROM_ISR         (EVENTGROUP_OTHERS + 4)            /*0x8C*/\r
256 #define TASK_PRIORITY_SET            (EVENTGROUP_OTHERS + 5)            /*0x8D*/\r
257 #define TASK_PRIORITY_INHERIT        (EVENTGROUP_OTHERS + 6)            /*0x8E*/\r
258 #define TASK_PRIORITY_DISINHERIT     (EVENTGROUP_OTHERS + 7)            /*0x8F*/\r
259 \r
260 /* Not yet used */\r
261 #define EVENTGROUP_FTRACE_PLACEHOLDER    (EVENTGROUP_OTHERS + 8)        /*0x90*/\r
262 \r
263 /* User events */\r
264 #define EVENTGROUP_USEREVENT (EVENTGROUP_FTRACE_PLACEHOLDER + 8)        /*0x98*/\r
265 #define USER_EVENT (EVENTGROUP_USEREVENT + 0)\r
266 \r
267 /* Allow for 0-15 arguments (the number of args is added to event code) */\r
268 #define USER_EVENT_LAST (EVENTGROUP_USEREVENT + 15)                     /*0xA7*/\r
269 \r
270 /*******************************************************************************\r
271  * XTS Event - eXtended TimeStamp events\r
272  * The timestamps used in the recorder are "differential timestamps" (DTS), i.e.\r
273  * the time since the last stored event. The DTS fields are either 1 or 2 bytes \r
274  * in the other events, depending on the bytes available in the event struct. \r
275  * If the time since the last event (the DTS) is larger than allowed for by \r
276  * the DTS field of the current event, an XTS event is inserted immediately \r
277  * before the original event. The XTS event contains up to 3 additional bytes \r
278  * of the DTS value - the higher bytes of the true DTS value. The lower 1-2 \r
279  * bytes are stored in the normal DTS field. \r
280  * There are two types of XTS events, XTS8 and XTS16. An XTS8 event is stored \r
281  * when there is only room for 1 byte (8 bit) DTS data in the original event, \r
282  * which means a limit of 0xFF (255). The XTS16 is used when the original event \r
283  * has a 16 bit DTS field and thereby can handle values up to 0xFFFF (65535).\r
284  * \r
285  * Using a very high frequency time base can result in many XTS events. \r
286  * Preferably, the time between two OS ticks should fit in 16 bits, i.e.,\r
287  * at most 65535. If your time base has a higher frequency, you can define\r
288  * the TRACE\r
289  ******************************************************************************/\r
290 \r
291 #define EVENTGROUP_SYS (EVENTGROUP_USEREVENT + 16)                      /*0xA8*/\r
292 #define XTS8 (EVENTGROUP_SYS + 0)                                       /*0xA8*/\r
293 #define XTS16 (EVENTGROUP_SYS + 1)                                      /*0xA9*/\r
294 \r
295 #define EVENT_BEING_WRITTEN (EVENTGROUP_SYS + 2)                        /*0xAA*/\r
296 \r
297 #define RESERVED_DUMMY_CODE (EVENTGROUP_SYS + 3)                        /*0xAB*/\r
298 \r
299 \r
300 \r
301 /************************************************************************/\r
302 /* KERNEL SPECIFIC DATA AND FUNCTIONS NEEDED TO PROVIDE THE             */\r
303 /* FUNCTIONALITY REQUESTED BY THE TRACE RECORDER                        */\r
304 /************************************************************************/\r
305 \r
306 /******************************************************************************\r
307  * TraceObjectClassTable\r
308  * Translates a FreeRTOS QueueType into trace objects classes (TRACE_CLASS_).\r
309  * This was added since we want to map both types of Mutex and both types of \r
310  * Semaphores on common classes for all Mutexes and all Semaphores respectively. \r
311  * \r
312  * FreeRTOS Queue types\r
313  * #define queueQUEUE_TYPE_BASE                  (0U) => TRACE_CLASS_QUEUE\r
314  * #define queueQUEUE_TYPE_MUTEX                 (1U) => TRACE_CLASS_MUTEX\r
315  * #define queueQUEUE_TYPE_COUNTING_SEMAPHORE    (2U) => TRACE_CLASS_SEMAPHORE\r
316  * #define queueQUEUE_TYPE_BINARY_SEMAPHORE      (3U) => TRACE_CLASS_SEMAPHORE\r
317  * #define queueQUEUE_TYPE_RECURSIVE_MUTEX       (4U) => TRACE_CLASS_MUTEX \r
318  ******************************************************************************/\r
319 \r
320 extern traceObjectClass TraceObjectClassTable[5];\r
321 \r
322 /* These functions are implemented in the .c file since certain header files must not be included in this one */\r
323 objectHandleType prvTraceGetObjectNumber(void* handle);\r
324 unsigned char prvTraceGetObjectType(void* handle);\r
325 objectHandleType prvTraceGetTaskNumber(void* handle);\r
326 unsigned char prvTraceIsSchedulerActive(void);\r
327 unsigned char prvTraceIsSchedulerSuspended(void);\r
328 unsigned char prvTraceIsSchedulerStarted(void);\r
329 void prvTraceEnterCritical(void);\r
330 void prvTraceExitCritical(void);\r
331 void* prvTraceGetCurrentTaskHandle(void);\r
332 \r
333 \r
334 /************************************************************************/\r
335 /* KERNEL SPECIFIC MACROS USED BY THE TRACE RECORDER                    */\r
336 /************************************************************************/\r
337 \r
338 #define TRACE_MALLOC(size) pvPortMalloc(size)\r
339 \r
340 #define TRACE_ENTER_CRITICAL_SECTION() prvTraceEnterCritical();\r
341 #define TRACE_EXIT_CRITICAL_SECTION() prvTraceExitCritical();\r
342 \r
343 #define TRACE_IS_SCHEDULER_ACTIVE() prvTraceIsSchedulerActive()\r
344 #define TRACE_IS_SCHEDULER_STARTED() prvTraceIsSchedulerStarted()\r
345 #define TRACE_IS_SCHEDULER_SUSPENDED() prvTraceIsSchedulerSuspended()\r
346 #define TRACE_GET_CURRENT_TASK() prvTraceGetCurrentTaskHandle()\r
347 \r
348 #define TRACE_GET_TASK_PRIORITY(pxTCB) ((uint8_t)pxTCB->uxPriority)\r
349 #define TRACE_GET_TASK_NAME(pxTCB) ((char*)pxTCB->pcTaskName)\r
350 #define TRACE_GET_TASK_NUMBER(pxTCB) (prvTraceGetTaskNumber(pxTCB))\r
351 #define TRACE_SET_TASK_NUMBER(pxTCB) pxTCB->uxTaskNumber = xTraceGetObjectHandle(TRACE_CLASS_TASK);\r
352 \r
353 #define TRACE_GET_CLASS_TRACE_CLASS(CLASS, kernelClass) TraceObjectClassTable[kernelClass]\r
354 #define TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject) TRACE_GET_CLASS_TRACE_CLASS(CLASS, prvTraceGetObjectType(pxObject))\r
355 \r
356 #define TRACE_GET_OBJECT_NUMBER(CLASS, pxObject) (prvTraceGetObjectNumber(pxObject))\r
357 #define TRACE_SET_OBJECT_NUMBER(CLASS, pxObject) pxObject->ucQueueNumber = xTraceGetObjectHandle(TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject));\r
358 \r
359 #define TRACE_GET_CLASS_EVENT_CODE(SERVICE, RESULT, CLASS, kernelClass) (uint8_t)(EVENTGROUP_##SERVICE##_##RESULT + TRACE_GET_CLASS_TRACE_CLASS(CLASS, kernelClass))\r
360 #define TRACE_GET_OBJECT_EVENT_CODE(SERVICE, RESULT, CLASS, pxObject) (uint8_t)(EVENTGROUP_##SERVICE##_##RESULT + TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject))\r
361 #define TRACE_GET_TASK_EVENT_CODE(SERVICE, RESULT, CLASS, pxTCB) (EVENTGROUP_##SERVICE##_##RESULT + TRACE_CLASS_TASK)\r
362 \r
363 \r
364 \r
365 /************************************************************************/\r
366 /* KERNEL SPECIFIC WRAPPERS THAT SHOULD BE CALLED BY THE KERNEL         */\r
367 /************************************************************************/\r
368 \r
369 /* Called for each task that becomes ready */\r
370 #undef traceMOVED_TASK_TO_READY_STATE\r
371 #define traceMOVED_TASK_TO_READY_STATE( pxTCB ) \\r
372         trcKERNEL_HOOKS_MOVED_TASK_TO_READY_STATE(pxTCB);\r
373 \r
374 /* Called on each OS tick. Will call uiPortGetTimestamp to make sure it is called at least once every OS tick. */\r
375 #undef traceTASK_INCREMENT_TICK\r
376 #define traceTASK_INCREMENT_TICK( xTickCount ) \\r
377     if (uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdTRUE || uxMissedTicks == 0) { trcKERNEL_HOOKS_INCREMENT_TICK(); } \\r
378         if (uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdFALSE) { trcKERNEL_HOOKS_NEW_TIME(DIV_NEW_TIME, xTickCount + 1); }\r
379 \r
380 /* Called on each task-switch */\r
381 #undef traceTASK_SWITCHED_IN\r
382 #define traceTASK_SWITCHED_IN() \\r
383         trcKERNEL_HOOKS_TASK_SWITCH(TRACE_GET_CURRENT_TASK());\r
384 \r
385 /* Called on vTaskSuspend */\r
386 #undef traceTASK_SUSPEND\r
387 #define traceTASK_SUSPEND( pxTaskToSuspend ) \\r
388         trcKERNEL_HOOKS_TASK_SUSPEND(TASK_SUSPEND, pxTaskToSuspend);\r
389 \r
390 /* Called on vTaskDelay - note the use of FreeRTOS variable xTicksToDelay */\r
391 #undef traceTASK_DELAY\r
392 #define traceTASK_DELAY() \\r
393         TRACE_ENTER_CRITICAL_SECTION(); \\r
394         trcKERNEL_HOOKS_TASK_DELAY(TASK_DELAY, pxCurrentTCB, xTicksToDelay); \\r
395         trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED(UNUSED,pxCurrentTCB); \\r
396         TRACE_EXIT_CRITICAL_SECTION();\r
397 \r
398 /* Called on vTaskDelayUntil - note the use of FreeRTOS variable xTimeToWake */\r
399 #undef traceTASK_DELAY_UNTIL\r
400 #define traceTASK_DELAY_UNTIL() \\r
401         TRACE_ENTER_CRITICAL_SECTION(); \\r
402         trcKERNEL_HOOKS_TASK_DELAY(TASK_DELAY_UNTIL, pxCurrentTCB, xTimeToWake); \\r
403         trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED(UNUSED,pxCurrentTCB); \\r
404         TRACE_EXIT_CRITICAL_SECTION();\r
405 \r
406 #if (INCLUDE_OBJECT_DELETE == 1)\r
407 /* Called on vTaskDelete */\r
408 #undef traceTASK_DELETE\r
409 #define traceTASK_DELETE( pxTaskToDelete ) \\r
410         trcKERNEL_HOOKS_TASK_DELETE(DELETE, pxTaskToDelete);\r
411 #endif\r
412 \r
413 #if (INCLUDE_OBJECT_DELETE == 1)\r
414 /* Called on vQueueDelete */\r
415 #undef traceQUEUE_DELETE\r
416 #define traceQUEUE_DELETE( pxQueue ) \\r
417         TRACE_ENTER_CRITICAL_SECTION(); \\r
418         trcKERNEL_HOOKS_OBJECT_DELETE(DELETE, UNUSED, pxQueue); \\r
419         TRACE_EXIT_CRITICAL_SECTION();\r
420 #endif\r
421 \r
422 /* Called on vTaskCreate */\r
423 #undef traceTASK_CREATE\r
424 #define traceTASK_CREATE(pxNewTCB) \\r
425         if (pxNewTCB != NULL) \\r
426         { \\r
427                 trcKERNEL_HOOKS_TASK_CREATE(CREATE, pxNewTCB); \\r
428         }\r
429 \r
430 /* Called in vTaskCreate, if it fails (typically if the stack can not be allocated) */\r
431 #undef traceTASK_CREATE_FAILED\r
432 #define traceTASK_CREATE_FAILED() \\r
433         TRACE_ENTER_CRITICAL_SECTION(); \\r
434         trcKERNEL_HOOKS_TASK_CREATE_FAILED(CREATE); \\r
435         TRACE_EXIT_CRITICAL_SECTION();\r
436 \r
437 /* Called in xQueueCreate, and thereby for all other object based on queues, such as semaphores. */\r
438 #undef traceQUEUE_CREATE\r
439 #define traceQUEUE_CREATE( pxNewQueue )\\r
440         TRACE_ENTER_CRITICAL_SECTION(); \\r
441         trcKERNEL_HOOKS_OBJECT_CREATE(CREATE, UNUSED, pxNewQueue); \\r
442         TRACE_EXIT_CRITICAL_SECTION();\r
443 \r
444 /* Called in xQueueCreate, if the queue creation fails */\r
445 #undef traceQUEUE_CREATE_FAILED\r
446 #define traceQUEUE_CREATE_FAILED( queueType ) \\r
447         TRACE_ENTER_CRITICAL_SECTION(); \\r
448         trcKERNEL_HOOKS_OBJECT_CREATE_FAILED(CREATE, UNUSED, queueType); \\r
449         TRACE_EXIT_CRITICAL_SECTION();\r
450 \r
451 /* Called in xQueueCreateMutex, and thereby also from xSemaphoreCreateMutex and xSemaphoreCreateRecursiveMutex */\r
452 #undef traceCREATE_MUTEX\r
453 #define traceCREATE_MUTEX( pxNewQueue ) \\r
454         TRACE_ENTER_CRITICAL_SECTION(); \\r
455         trcKERNEL_HOOKS_OBJECT_CREATE(CREATE, UNUSED, pxNewQueue); \\r
456         TRACE_EXIT_CRITICAL_SECTION();\r
457 \r
458 /* Called in xQueueCreateMutex when the operation fails (when memory allocation fails) */\r
459 #undef traceCREATE_MUTEX_FAILED\r
460 #define traceCREATE_MUTEX_FAILED() \\r
461         TRACE_ENTER_CRITICAL_SECTION(); \\r
462         trcKERNEL_HOOKS_OBJECT_CREATE_FAILED(CREATE, UNUSED, queueQUEUE_TYPE_MUTEX); \\r
463         TRACE_EXIT_CRITICAL_SECTION();\r
464 \r
465 /* Called when the Mutex can not be given, since not holder */\r
466 #undef traceGIVE_MUTEX_RECURSIVE_FAILED\r
467 #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex ) \\r
468         TRACE_ENTER_CRITICAL_SECTION(); \\r
469         trcKERNEL_HOOKS_KERNEL_SERVICE(SEND, FAILED, UNUSED, pxMutex); \\r
470         TRACE_EXIT_CRITICAL_SECTION();\r
471 \r
472 /* Called when a message is sent to a queue */\r
473 #undef traceQUEUE_SEND\r
474 #define traceQUEUE_SEND( pxQueue ) \\r
475         trcKERNEL_HOOKS_KERNEL_SERVICE(SEND, SUCCESS, UNUSED, pxQueue); \\r
476         trcKERNEL_HOOKS_SET_OBJECT_STATE(UNUSED, pxQueue, TRACE_GET_OBJECT_TRACE_CLASS(UNUSED, pxQueue) == TRACE_CLASS_MUTEX ? (uint8_t)0 : (uint8_t)(pxQueue->uxMessagesWaiting + 1)); /*For mutex, store the new owner rather than queue length */\r
477 \r
478 /* Called when a message failed to be sent to a queue (timeout) */\r
479 #undef traceQUEUE_SEND_FAILED\r
480 #define traceQUEUE_SEND_FAILED( pxQueue ) \\r
481     TRACE_ENTER_CRITICAL_SECTION();\\r
482     trcKERNEL_HOOKS_KERNEL_SERVICE(SEND, FAILED, UNUSED, pxQueue); \\r
483     TRACE_EXIT_CRITICAL_SECTION();\r
484 \r
485 /* Called when the task is blocked due to a send operation on a full queue */\r
486 #undef traceBLOCKING_ON_QUEUE_SEND\r
487 #define traceBLOCKING_ON_QUEUE_SEND( pxQueue ) \\r
488         TRACE_ENTER_CRITICAL_SECTION();\\r
489         trcKERNEL_HOOKS_KERNEL_SERVICE(SEND, BLOCK, UNUSED, pxQueue); \\r
490         TRACE_EXIT_CRITICAL_SECTION();\r
491 \r
492 /* Called when a message is received from a queue */\r
493 #undef traceQUEUE_RECEIVE\r
494 #define traceQUEUE_RECEIVE( pxQueue ) \\r
495         trcKERNEL_HOOKS_KERNEL_SERVICE(RECEIVE, SUCCESS, UNUSED, pxQueue); \\r
496         trcKERNEL_HOOKS_SET_OBJECT_STATE(UNUSED, pxQueue, TRACE_GET_OBJECT_TRACE_CLASS(UNUSED, pxQueue) == TRACE_CLASS_MUTEX ? TRACE_GET_TASK_NUMBER(TRACE_GET_CURRENT_TASK()) : (uint8_t)(pxQueue->uxMessagesWaiting - 1)); /*For mutex, store the new owner rather than queue length */\r
497 \r
498 /* Called when a receive operation on a queue fails (timeout) */\r
499 #undef traceQUEUE_RECEIVE_FAILED\r
500 #define traceQUEUE_RECEIVE_FAILED( pxQueue ) \\r
501         TRACE_ENTER_CRITICAL_SECTION(); \\r
502         trcKERNEL_HOOKS_KERNEL_SERVICE(RECEIVE, FAILED, UNUSED, pxQueue); \\r
503         TRACE_EXIT_CRITICAL_SECTION();\r
504 \r
505 /* Called when the task is blocked due to a receive operation on an empty queue */\r
506 #undef traceBLOCKING_ON_QUEUE_RECEIVE\r
507 #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue ) \\r
508         TRACE_ENTER_CRITICAL_SECTION(); \\r
509         trcKERNEL_HOOKS_KERNEL_SERVICE(RECEIVE, BLOCK, UNUSED, pxQueue); \\r
510         if (TRACE_GET_OBJECT_TRACE_CLASS(UNUSED, pxQueue) != TRACE_CLASS_MUTEX) \\r
511         { \\r
512                 trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED(UNUSED, pxQueue); \\r
513         } \\r
514         TRACE_EXIT_CRITICAL_SECTION();\r
515 \r
516 /* Called on xQueuePeek */\r
517 #undef traceQUEUE_PEEK\r
518 #define traceQUEUE_PEEK( pxQueue ) \\r
519         trcKERNEL_HOOKS_KERNEL_SERVICE(PEEK, SUCCESS, UNUSED, pxQueue);\r
520 \r
521 /* Called when a message is sent from interrupt context, e.g., using xQueueSendFromISR */\r
522 #undef traceQUEUE_SEND_FROM_ISR\r
523 #define traceQUEUE_SEND_FROM_ISR( pxQueue ) \\r
524         trcKERNEL_HOOKS_KERNEL_SERVICE(SEND_FROM_ISR, SUCCESS, UNUSED, pxQueue); \\r
525         trcKERNEL_HOOKS_SET_OBJECT_STATE(UNUSED, pxQueue, (uint8_t)(pxQueue->uxMessagesWaiting + 1));\r
526 \r
527 /* Called when a message send from interrupt context fails (since the queue was full) */\r
528 #undef traceQUEUE_SEND_FROM_ISR_FAILED\r
529 #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue ) \\r
530         trcKERNEL_HOOKS_KERNEL_SERVICE(SEND_FROM_ISR, FAILED, UNUSED, pxQueue);\r
531 \r
532 /* Called when a message is received in interrupt context, e.g., using xQueueReceiveFromISR */\r
533 #undef traceQUEUE_RECEIVE_FROM_ISR\r
534 #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue ) \\r
535         trcKERNEL_HOOKS_KERNEL_SERVICE(RECEIVE_FROM_ISR, SUCCESS, UNUSED, pxQueue); \\r
536         trcKERNEL_HOOKS_SET_OBJECT_STATE(UNUSED, pxQueue, (uint8_t)(pxQueue->uxMessagesWaiting - 1));\r
537 \r
538 /* Called when a message receive from interrupt context fails (since the queue was empty) */\r
539 #undef traceQUEUE_RECEIVE_FROM_ISR_FAILED\r
540 #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue ) \\r
541         trcKERNEL_HOOKS_KERNEL_SERVICE(RECEIVE_FROM_ISR, FAILED, UNUSED, pxQueue);\r
542 \r
543 /* Called in vTaskPrioritySet */\r
544 #undef traceTASK_PRIORITY_SET\r
545 #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority ) \\r
546         trcKERNEL_HOOKS_TASK_PRIORITY_CHANGE(TASK_PRIORITY_SET, pxTask, uxNewPriority);\r
547 \r
548 /* Called in vTaskPriorityInherit, which is called by Mutex operations */\r
549 #undef traceTASK_PRIORITY_INHERIT\r
550 #define traceTASK_PRIORITY_INHERIT( pxTask, uxNewPriority ) \\r
551         trcKERNEL_HOOKS_TASK_PRIORITY_CHANGE(TASK_PRIORITY_INHERIT, pxTask, uxNewPriority);\r
552 \r
553 /* Called in vTaskPriorityDisinherit, which is called by Mutex operations */\r
554 #undef traceTASK_PRIORITY_DISINHERIT\r
555 #define traceTASK_PRIORITY_DISINHERIT( pxTask, uxNewPriority ) \\r
556         trcKERNEL_HOOKS_TASK_PRIORITY_CHANGE(TASK_PRIORITY_DISINHERIT, pxTask, uxNewPriority);\r
557 \r
558 /* Called in vTaskResume */\r
559 #undef traceTASK_RESUME\r
560 #define traceTASK_RESUME( pxTaskToResume ) \\r
561         trcKERNEL_HOOKS_TASK_RESUME(TASK_RESUME, pxTaskToResume);\r
562 \r
563 /* Called in vTaskResumeFromISR */\r
564 #undef traceTASK_RESUME_FROM_ISR\r
565 #define traceTASK_RESUME_FROM_ISR( pxTaskToResume ) \\r
566         trcKERNEL_HOOKS_TASK_RESUME(TASK_RESUME_FROM_ISR, pxTaskToResume);\r
567 \r
568 \r
569 /************************************************************************/\r
570 /* KERNEL SPECIFIC MACROS TO EXCLUDE OR INCLUDE THINGS IN TRACE         */\r
571 /************************************************************************/\r
572 \r
573 /* Returns the exclude state of the object */\r
574 uint8_t uiTraceIsObjectExcluded(traceObjectClass objectclass, objectHandleType handle);\r
575 \r
576 #define TRACE_SET_QUEUE_FLAG_ISEXCLUDED(queueIndex) TRACE_SET_FLAG_ISEXCLUDED(excludedObjects, queueIndex)\r
577 #define TRACE_CLEAR_QUEUE_FLAG_ISEXCLUDED(queueIndex) TRACE_CLEAR_FLAG_ISEXCLUDED(excludedObjects, queueIndex)\r
578 #define TRACE_GET_QUEUE_FLAG_ISEXCLUDED(queueIndex) TRACE_GET_FLAG_ISEXCLUDED(excludedObjects, queueIndex)\r
579 \r
580 #define TRACE_SET_SEMAPHORE_FLAG_ISEXCLUDED(semaphoreIndex) TRACE_SET_FLAG_ISEXCLUDED(excludedObjects, NQueue+1+semaphoreIndex)\r
581 #define TRACE_CLEAR_SEMAPHORE_FLAG_ISEXCLUDED(semaphoreIndex) TRACE_CLEAR_FLAG_ISEXCLUDED(excludedObjects, NQueue+1+semaphoreIndex)\r
582 #define TRACE_GET_SEMAPHORE_FLAG_ISEXCLUDED(semaphoreIndex) TRACE_GET_FLAG_ISEXCLUDED(excludedObjects, NQueue+1+semaphoreIndex)\r
583 \r
584 #define TRACE_SET_MUTEX_FLAG_ISEXCLUDED(mutexIndex) TRACE_SET_FLAG_ISEXCLUDED(excludedObjects, NQueue+1+NSemaphore+1+mutexIndex)\r
585 #define TRACE_CLEAR_MUTEX_FLAG_ISEXCLUDED(mutexIndex) TRACE_CLEAR_FLAG_ISEXCLUDED(excludedObjects, NQueue+1+NSemaphore+1+mutexIndex)\r
586 #define TRACE_GET_MUTEX_FLAG_ISEXCLUDED(mutexIndex) TRACE_GET_FLAG_ISEXCLUDED(excludedObjects, NQueue+1+NSemaphore+1+mutexIndex)\r
587 \r
588 #define TRACE_SET_TASK_FLAG_ISEXCLUDED(taskIndex) TRACE_SET_FLAG_ISEXCLUDED(excludedObjects, NQueue+1+NSemaphore+1+NMutex+1+taskIndex)\r
589 #define TRACE_CLEAR_TASK_FLAG_ISEXCLUDED(taskIndex) TRACE_CLEAR_FLAG_ISEXCLUDED(excludedObjects, NQueue+1+NSemaphore+1+NMutex+1+taskIndex)\r
590 #define TRACE_GET_TASK_FLAG_ISEXCLUDED(taskIndex) TRACE_GET_FLAG_ISEXCLUDED(excludedObjects, NQueue+1+NSemaphore+1+NMutex+1+taskIndex)\r
591 \r
592 #define TRACE_CLEAR_OBJECT_FLAG_ISEXCLUDED(objectclass, handle) \\r
593 switch (objectclass) \\r
594 { \\r
595 case TRACE_CLASS_QUEUE: \\r
596         TRACE_CLEAR_QUEUE_FLAG_ISEXCLUDED(handle); \\r
597         break; \\r
598 case TRACE_CLASS_SEMAPHORE: \\r
599         TRACE_CLEAR_SEMAPHORE_FLAG_ISEXCLUDED(handle); \\r
600         break; \\r
601 case TRACE_CLASS_MUTEX: \\r
602         TRACE_CLEAR_MUTEX_FLAG_ISEXCLUDED(handle); \\r
603         break; \\r
604 case TRACE_CLASS_TASK: \\r
605         TRACE_CLEAR_TASK_FLAG_ISEXCLUDED(handle); \\r
606         break; \\r
607 }\r
608 \r
609 #define TRACE_SET_OBJECT_FLAG_ISEXCLUDED(objectclass, handle) \\r
610 switch (objectclass) \\r
611 { \\r
612 case TRACE_CLASS_QUEUE: \\r
613         TRACE_SET_QUEUE_FLAG_ISEXCLUDED(handle); \\r
614         break; \\r
615 case TRACE_CLASS_SEMAPHORE: \\r
616         TRACE_SET_SEMAPHORE_FLAG_ISEXCLUDED(handle); \\r
617         break; \\r
618 case TRACE_CLASS_MUTEX: \\r
619         TRACE_SET_MUTEX_FLAG_ISEXCLUDED(handle); \\r
620         break; \\r
621 case TRACE_CLASS_TASK: \\r
622         TRACE_SET_TASK_FLAG_ISEXCLUDED(handle); \\r
623         break; \\r
624 }\r
625 \r
626 /* Task */\r
627 #define vTraceExcludeTaskFromTrace(handle) \\r
628 TRACE_SET_TASK_FLAG_ISEXCLUDED(TRACE_GET_TASK_NUMBER(handle));\r
629 \r
630 #define vTraceIncludeTaskInTrace(handle) \\r
631 TRACE_CLEAR_TASK_FLAG_ISEXCLUDED(TRACE_GET_TASK_NUMBER(handle));\r
632 \r
633 \r
634 /* Queue */\r
635 #define vTraceExcludeQueueFromTrace(handle) \\r
636 TRACE_SET_QUEUE_FLAG_ISEXCLUDED(TRACE_GET_OBJECT_NUMBER(UNUSED, handle));\r
637 \r
638 #define vTraceIncludeQueueInTrace(handle) \\r
639 TRACE_CLEAR_QUEUE_FLAG_ISEXCLUDED(TRACE_GET_OBJECT_NUMBER(UNUSED, handle));\r
640 \r
641 \r
642 /* Semaphore */\r
643 #define vTraceExcludeSemaphoreFromTrace(handle) \\r
644 TRACE_SET_SEMAPHORE_FLAG_ISEXCLUDED(TRACE_GET_OBJECT_NUMBER(UNUSED, handle));\r
645 \r
646 #define vTraceIncludeSemaphoreInTrace(handle) \\r
647 TRACE_CLEAR_QUEUE_FLAG_ISEXCLUDED(TRACE_GET_OBJECT_NUMBER(UNUSED, handle));\r
648 \r
649 \r
650 /* Mutex */\r
651 #define vTraceExcludeMutexFromTrace(handle) \\r
652 TRACE_SET_MUTEX_FLAG_ISEXCLUDED(TRACE_GET_OBJECT_NUMBER(UNUSED, handle));\r
653 \r
654 #define vTraceIncludeMutexInTrace(handle) \\r
655 TRACE_CLEAR_QUEUE_FLAG_ISEXCLUDED(TRACE_GET_OBJECT_NUMBER(UNUSED, handle));\r
656 \r
657 \r
658 /* Kernel Services */\r
659 #define vTraceExcludeKernelServiceDelayFromTrace() \\r
660 TRACE_SET_EVENT_CODE_FLAG_ISEXCLUDED(TASK_DELAY); \\r
661 TRACE_SET_EVENT_CODE_FLAG_ISEXCLUDED(TASK_DELAY_UNTIL);\r
662 \r
663 #define vTraceIncludeKernelServiceDelayInTrace() \\r
664 TRACE_CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(TASK_DELAY); \\r
665 TRACE_CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(TASK_DELAY_UNTIL);\r
666 \r
667 /* HELPER MACROS FOR KERNEL SERVICES FOR OBJECTS */\r
668 #define vTraceExcludeKernelServiceSendFromTrace_HELPER(class) \\r
669 TRACE_SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_SUCCESS + class); \\r
670 TRACE_SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_BLOCK + class); \\r
671 TRACE_SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FAILED + class); \\r
672 TRACE_SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR_SUCCESS + class); \\r
673 TRACE_SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR_FAILED + class);\r
674 \r
675 #define vTraceIncludeKernelServiceSendInTrace_HELPER(class) \\r
676 TRACE_CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_SUCCESS + class); \\r
677 TRACE_CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_BLOCK + class); \\r
678 TRACE_CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FAILED + class); \\r
679 TRACE_CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR_SUCCESS + class); \\r
680 TRACE_CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR_FAILED + class);\r
681 \r
682 #define vTraceExcludeKernelServiceReceiveFromTrace_HELPER(class) \\r
683 TRACE_SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_SUCCESS + class); \\r
684 TRACE_SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_BLOCK + class); \\r
685 TRACE_SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FAILED + class); \\r
686 TRACE_SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR_SUCCESS + class); \\r
687 TRACE_SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR_FAILED + class);\r
688 \r
689 #define vTraceIncludeKernelServiceReceiveInTrace_HELPER(class) \\r
690 TRACE_CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_SUCCESS + class); \\r
691 TRACE_CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_BLOCK + class); \\r
692 TRACE_CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FAILED + class); \\r
693 TRACE_CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR_SUCCESS + class); \\r
694 TRACE_CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR_FAILED + class);\r
695 \r
696 /* EXCLUDE AND INCLUDE FOR QUEUE */\r
697 #define vTraceExcludeKernelServiceQueueSendFromTrace() \\r
698 vTraceExcludeKernelServiceSendFromTrace_HELPER(TRACE_CLASS_QUEUE);\r
699 \r
700 #define vTraceIncludeKernelServiceQueueSendInTrace() \\r
701 vTraceIncludeKernelServiceSendInTrace_HELPER(TRACE_CLASS_QUEUE);\r
702 \r
703 #define vTraceExcludeKernelServiceQueueReceiveFromTrace() \\r
704 vTraceExcludeKernelServiceReceiveFromTrace_HELPER(TRACE_CLASS_QUEUE);\r
705 \r
706 #define vTraceIncludeKernelServiceQueueReceiveInTrace() \\r
707 vTraceIncludeKernelServiceReceiveInTrace_HELPER(TRACE_CLASS_QUEUE);\r
708 \r
709 /* EXCLUDE AND INCLUDE FOR SEMAPHORE */\r
710 #define vTraceExcludeKernelServiceSemaphoreSendFromTrace() \\r
711 vTraceExcludeKernelServiceSendFromTrace_HELPER(TRACE_CLASS_SEMAPHORE);\r
712 \r
713 #define vTraceIncludeKernelServicSemaphoreSendInTrace() \\r
714 vTraceIncludeKernelServiceSendInTrace_HELPER(TRACE_CLASS_SEMAPHORE);\r
715 \r
716 #define vTraceExcludeKernelServiceSemaphoreReceiveFromTrace() \\r
717 vTraceExcludeKernelServiceReceiveFromTrace_HELPER(TRACE_CLASS_SEMAPHORE);\r
718 \r
719 #define vTraceIncludeKernelServiceSemaphoreReceiveInTrace() \\r
720 vTraceIncludeKernelServiceReceiveInTrace_HELPER(TRACE_CLASS_SEMAPHORE);\r
721 \r
722 /* EXCLUDE AND INCLUDE FOR MUTEX */\r
723 #define vTraceExcludeKernelServiceMutexSendFromTrace() \\r
724 vTraceExcludeKernelServiceSendFromTrace_HELPER(TRACE_CLASS_MUTEX);\r
725 \r
726 #define vTraceIncludeKernelServiceMutexSendInTrace() \\r
727 vTraceIncludeKernelServiceSendInTrace_HELPER(TRACE_CLASS_MUTEX);\r
728 \r
729 #define vTraceExcludeKernelServiceMutexReceiveFromTrace() \\r
730 vTraceExcludeKernelServiceReceiveFromTrace_HELPER(TRACE_CLASS_MUTEX);\r
731 \r
732 #define vTraceIncludeKernelServiceMutexReceiveInTrace() \\r
733 vTraceIncludeKernelServiceReceiveInTrace_HELPER(TRACE_CLASS_MUTEX);\r
734 \r
735 /************************************************************************/\r
736 /* KERNEL SPECIFIC MACROS TO NAME OBJECTS, IF NECESSARY                 */\r
737 /************************************************************************/\r
738 #define vTraceSetQueueName(object, name) \\r
739 vTraceSetObjectName(TRACE_GET_OBJECT_TRACE_CLASS(UNUSED, object), TRACE_GET_OBJECT_NUMBER(UNUSED, object), name);\r
740 \r
741 #define vTraceSetSemaphoreName(object, name) \\r
742 vTraceSetObjectName(TRACE_GET_OBJECT_TRACE_CLASS(UNUSED, object), TRACE_GET_OBJECT_NUMBER(UNUSED, object), name);\r
743 \r
744 #define vTraceSetMutexName(object, name) \\r
745 vTraceSetObjectName(TRACE_GET_OBJECT_TRACE_CLASS(UNUSED, object), TRACE_GET_OBJECT_NUMBER(UNUSED, object), name);\r
746 \r
747 #endif\r
748 \r
749 #endif /* TRCKERNELPORT_H_ */