/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.5\r
* Percepio AB, www.percepio.com\r
*\r
* trcHardwarePort.h\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.5\r
* Percepio AB, www.percepio.com\r
*\r
* Terms of Use\r
#define TRACE_GET_STREAMBUFFER_FILTER(pxObject) prvTraceGetStreamBufferNumberHigh16((void*)pxObject)\r
#define TRACE_SET_STREAMBUFFER_FILTER(pxObject, group) prvTraceSetStreamBufferNumberHigh16((void*)pxObject, group)\r
\r
+/* We can only support filtering if FreeRTOS is at least v7.4 */\r
+#if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_4)\r
#define TRACE_GET_OBJECT_FILTER(CLASS, pxObject) TRACE_GET_##CLASS##_FILTER(pxObject)\r
#define TRACE_SET_OBJECT_FILTER(CLASS, pxObject, group) TRACE_SET_##CLASS##_FILTER(pxObject, group)\r
+#else /* (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_4) */\r
+#define TRACE_GET_OBJECT_FILTER(CLASS, pxObject) 1\r
+#define TRACE_SET_OBJECT_FILTER(CLASS, pxObject, group) \r
+#endif /* (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_4) */\r
\r
/******************************************************************************/\r
/*** Definitions for Snapshot mode ********************************************/\r
#undef traceTASK_NOTIFY_WAIT\r
#if (TRC_CFG_FREERTOS_VERSION < TRC_FREERTOS_VERSION_9_0_0)\r
#define traceTASK_NOTIFY_WAIT() \\r
- if (TRACE_GET_TASK_FILTER(pxCurrentTCB) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxCurrentTCB) & CurrentFilterMask) \\r
{ \\r
if (pxCurrentTCB->eNotifyState == eNotified) \\r
prvTraceStoreKernelCallWithParam(TRACE_TASK_NOTIFY_WAIT, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxCurrentTCB), xTicksToWait); \\r
}\r
#else /* TRC_CFG_FREERTOS_VERSION < TRC_FREERTOS_VERSION_9_0_0 */\r
#define traceTASK_NOTIFY_WAIT() \\r
- if (TRACE_GET_TASK_FILTER(pxCurrentTCB) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxCurrentTCB) & CurrentFilterMask) \\r
{ \\r
if (pxCurrentTCB->ucNotifyState == taskNOTIFICATION_RECEIVED) \\r
prvTraceStoreKernelCallWithParam(TRACE_TASK_NOTIFY_WAIT, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxCurrentTCB), xTicksToWait); \\r
\r
#undef traceTASK_NOTIFY_WAIT_BLOCK\r
#define traceTASK_NOTIFY_WAIT_BLOCK() \\r
- if (TRACE_GET_TASK_FILTER(pxCurrentTCB) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxCurrentTCB) & CurrentFilterMask) \\r
prvTraceStoreKernelCallWithParam(TRACE_TASK_NOTIFY_WAIT_TRCBLOCK, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxCurrentTCB), xTicksToWait); \\r
trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED();\r
\r
#undef traceTASK_NOTIFY\r
#define traceTASK_NOTIFY() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
- if (TRACE_GET_TASK_FILTER(xTaskToNotify) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, xTaskToNotify) & CurrentFilterMask) \\r
prvTraceStoreKernelCall(TRACE_TASK_NOTIFY, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(xTaskToNotify));\r
\r
#undef traceTASK_NOTIFY_FROM_ISR\r
#define traceTASK_NOTIFY_FROM_ISR() \\r
- if (TRACE_GET_TASK_FILTER(xTaskToNotify) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, xTaskToNotify) & CurrentFilterMask) \\r
prvTraceStoreKernelCall(TRACE_TASK_NOTIFY_FROM_ISR, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(xTaskToNotify));\r
\r
#undef traceTASK_NOTIFY_GIVE_FROM_ISR\r
#define traceTASK_NOTIFY_GIVE_FROM_ISR() \\r
- if (TRACE_GET_TASK_FILTER(xTaskToNotify) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, xTaskToNotify) & CurrentFilterMask) \\r
prvTraceStoreKernelCall(TRACE_TASK_NOTIFY_GIVE_FROM_ISR, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(xTaskToNotify));\r
\r
#if (TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS == 1)\r
#undef traceSTREAM_BUFFER_CREATE_FAILED\r
#define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer ) \\r
trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_NUMERIC_PARAM_ONLY(TRACE_GET_CLASS_EVENT_CODE(CREATE_OBJ, TRCFAILED, STREAMBUFFER, xIsMessageBuffer), 0);\r
-\r
-#if 0 /*_RB_ Not defined anywhere*/\r
+ \r
#undef traceSTREAM_BUFFER_CREATE_STATIC_FAILED\r
#define traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xIsMessageBuffer ) \\r
- traceSTREAM_BUFFER_CREATE_TRCFAILED( xIsMessageBuffer )\r
-#endif\r
+ traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer )\r
\r
#undef traceSTREAM_BUFFER_DELETE\r
#define traceSTREAM_BUFFER_DELETE( xStreamBuffer ) \\r
/* Called on each task-switch */\r
#undef traceTASK_SWITCHED_IN\r
#define traceTASK_SWITCHED_IN() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
{ \\r
if (prvIsNewTCB(pxCurrentTCB)) \\r
{ \\r
#if (TRC_CFG_INCLUDE_READY_EVENTS == 1)\r
#undef traceMOVED_TASK_TO_READY_STATE\r
#define traceMOVED_TASK_TO_READY_STATE( pxTCB ) \\r
- if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \\r
prvTraceStoreEvent1(PSF_EVENT_TASK_READY, (uint32_t)pxTCB);\r
#endif\r
\r
prvTraceSaveSymbol(pxNewTCB, pxNewTCB->pcTaskName); \\r
prvTraceSaveObjectData(pxNewTCB, pxNewTCB->uxPriority); \\r
prvTraceStoreStringEvent(1, PSF_EVENT_OBJ_NAME, pxNewTCB->pcTaskName, pxNewTCB); \\r
- TRACE_SET_TASK_FILTER(pxNewTCB, CurrentFilterGroup); \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
- if (TRACE_GET_TASK_FILTER(pxNewTCB) & CurrentFilterMask) \\r
+ TRACE_SET_OBJECT_FILTER(TASK, pxNewTCB, CurrentFilterGroup); \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxNewTCB) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_TASK_CREATE, (uint32_t)pxNewTCB, pxNewTCB->uxPriority); \\r
}\r
#else /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */\r
prvTraceSaveSymbol(pxNewTCB, (const char*)pcName); \\r
prvTraceSaveObjectData(pxNewTCB, uxPriority); \\r
prvTraceStoreStringEvent(1, PSF_EVENT_OBJ_NAME, (const char*)pcName, pxNewTCB); \\r
- TRACE_SET_TASK_FILTER(pxNewTCB, CurrentFilterGroup); \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
- if (TRACE_GET_TASK_FILTER(pxNewTCB) & CurrentFilterMask) \\r
+ TRACE_SET_OBJECT_FILTER(TASK, pxNewTCB, CurrentFilterGroup); \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxNewTCB) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_TASK_CREATE, (uint32_t)pxNewTCB, uxPriority); \\r
}\r
#endif /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */\r
/* Called in vTaskCreate, if it fails (typically if the stack can not be allocated) */\r
#undef traceTASK_CREATE_FAILED\r
#define traceTASK_CREATE_FAILED() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent0(PSF_EVENT_TASK_CREATE_FAILED);\r
\r
/* Called on vTaskDelete */\r
#undef traceTASK_DELETE // We don't allow for filtering out "delete" events. They are important and not very frequent. Moreover, we can't exclude create events, so this should be symmetrical.\r
#define traceTASK_DELETE( pxTaskToDelete ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
- if (TRACE_GET_TASK_FILTER(pxTaskToDelete) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTaskToDelete) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_TASK_DELETE, (uint32_t)pxTaskToDelete, (pxTaskToDelete != NULL) ? (pxTaskToDelete->uxPriority) : 0); \\r
prvTraceDeleteSymbol(pxTaskToDelete); \\r
prvTraceDeleteObjectData(pxTaskToDelete);\r
/* Called on vTaskSuspend */\r
#undef traceTASK_SUSPEND\r
#define traceTASK_SUSPEND( pxTaskToSuspend ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
- if (TRACE_GET_TASK_FILTER(pxTaskToSuspend) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTaskToSuspend) & CurrentFilterMask) \\r
prvTraceStoreEvent1(PSF_EVENT_TASK_SUSPEND, (uint32_t)pxTaskToSuspend);\r
\r
/* Called on vTaskDelay - note the use of FreeRTOS variable xTicksToDelay */\r
#undef traceTASK_DELAY\r
#define traceTASK_DELAY() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent1(PSF_EVENT_TASK_DELAY, xTicksToDelay);\r
\r
/* Called on vTaskDelayUntil - note the use of FreeRTOS variable xTimeToWake */\r
#undef traceTASK_DELAY_UNTIL\r
#if TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0\r
#define traceTASK_DELAY_UNTIL(xTimeToWake) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent1(PSF_EVENT_TASK_DELAY_UNTIL, (uint32_t)xTimeToWake);\r
#else /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */\r
#define traceTASK_DELAY_UNTIL() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent1(PSF_EVENT_TASK_DELAY_UNTIL, (uint32_t)xTimeToWake);\r
#endif /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */\r
\r
#undef traceQUEUE_CREATE\r
#define traceQUEUE_CREATE( pxNewQueue )\\r
TRACE_SET_OBJECT_FILTER(QUEUE, pxNewQueue, CurrentFilterGroup); \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
{ \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxNewQueue) & CurrentFilterMask) \\r
{ \\r
/* Called in xQueueCreate, if the queue creation fails */\r
#undef traceQUEUE_CREATE_FAILED\r
#define traceQUEUE_CREATE_FAILED( queueType ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
{ \\r
switch (queueType) \\r
{ \\r
\r
#undef traceQUEUE_DELETE // We don't allow for filtering out "delete" events. They are important and not very frequent. Moreover, we can't exclude create events, so this should be symmetrical.\r
#define traceQUEUE_DELETE( pxQueue ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
{ \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \\r
{ \\r
#if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_8_X)\r
#define traceCREATE_COUNTING_SEMAPHORE() \\r
TRACE_SET_OBJECT_FILTER(QUEUE, xHandle, CurrentFilterGroup); \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, xHandle) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE, (uint32_t)xHandle, uxMaxCount)\r
#elif (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_5_OR_7_6)\r
#define traceCREATE_COUNTING_SEMAPHORE() \\r
TRACE_SET_OBJECT_FILTER(QUEUE, xHandle, CurrentFilterGroup); \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, xHandle) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE, (uint32_t)xHandle, uxInitialCount);\r
#elif (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_4)\r
#define traceCREATE_COUNTING_SEMAPHORE() \\r
TRACE_SET_OBJECT_FILTER(QUEUE, xHandle, CurrentFilterGroup); \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, xHandle) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE, (uint32_t)xHandle, uxCountValue);\r
#else\r
#define traceCREATE_COUNTING_SEMAPHORE() \\r
TRACE_SET_OBJECT_FILTER(QUEUE, pxHandle, CurrentFilterGroup); \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxHandle) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE, (uint32_t)pxHandle, uxCountValue);\r
#endif /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_8_X */\r
#undef traceCREATE_COUNTING_SEMAPHORE_FAILED\r
#if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_8_X)\r
#define traceCREATE_COUNTING_SEMAPHORE_FAILED() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE_FAILED, 0, uxMaxCount);\r
#elif (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_5_OR_7_6)\r
#define traceCREATE_COUNTING_SEMAPHORE_FAILED() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE_FAILED, 0, uxInitialCount);\r
#elif (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_4)\r
#define traceCREATE_COUNTING_SEMAPHORE_FAILED() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE_FAILED, 0, uxCountValue);\r
#else\r
#define traceCREATE_COUNTING_SEMAPHORE_FAILED() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE_FAILED, 0, uxCountValue);\r
#endif /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_8_X */\r
\r
#undef traceCREATE_MUTEX\r
#define traceCREATE_MUTEX( pxNewQueue ) \\r
TRACE_SET_OBJECT_FILTER(QUEUE, pxNewQueue, CurrentFilterGroup); \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
{ \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxNewQueue) & CurrentFilterMask) \\r
{ \\r
/* Called in xQueueCreateMutex when the operation fails (when memory allocation fails) */\r
#undef traceCREATE_MUTEX_FAILED\r
#define traceCREATE_MUTEX_FAILED() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent1(PSF_EVENT_MUTEX_CREATE_FAILED, 0);\r
#endif /* (TRC_CFG_FREERTOS_VERSION < TRC_FREERTOS_VERSION_9_0_0) */\r
\r
/* Called when a message is sent to a queue */ /* CS IS NEW ! */\r
#undef traceQUEUE_SEND\r
#define traceQUEUE_SEND( pxQueue ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \\r
switch (pxQueue->ucQueueType) \\r
{ \\r
/* Called when a message failed to be sent to a queue (timeout) */\r
#undef traceQUEUE_SEND_FAILED\r
#define traceQUEUE_SEND_FAILED( pxQueue ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \\r
switch (pxQueue->ucQueueType) \\r
{ \\r
/* Called when the task is blocked due to a send operation on a full queue */\r
#undef traceBLOCKING_ON_QUEUE_SEND\r
#define traceBLOCKING_ON_QUEUE_SEND( pxQueue ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \\r
switch (pxQueue->ucQueueType) \\r
{ \\r
/* Called when a message is received from a queue */\r
#undef traceQUEUE_RECEIVE\r
#define traceQUEUE_RECEIVE( pxQueue ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \\r
switch (pxQueue->ucQueueType) \\r
{ \\r
/* Called when a receive operation on a queue fails (timeout) */\r
#undef traceQUEUE_RECEIVE_FAILED\r
#define traceQUEUE_RECEIVE_FAILED( pxQueue ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \\r
switch (pxQueue->ucQueueType) \\r
{ \\r
/* Called when the task is blocked due to a receive operation on an empty queue */\r
#undef traceBLOCKING_ON_QUEUE_RECEIVE\r
#define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \\r
switch (pxQueue->ucQueueType) \\r
{ \\r
/* Called when a peek operation on a queue fails (timeout) */\r
#undef traceQUEUE_PEEK_FAILED\r
#define traceQUEUE_PEEK_FAILED( pxQueue ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \\r
switch (pxQueue->ucQueueType) \\r
{ \\r
/* Called when the task is blocked due to a peek operation on an empty queue */\r
#undef traceBLOCKING_ON_QUEUE_PEEK\r
#define traceBLOCKING_ON_QUEUE_PEEK( pxQueue ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \\r
switch (pxQueue->ucQueueType) \\r
{ \\r
/* Called on xQueuePeek */\r
#undef traceQUEUE_PEEK\r
#define traceQUEUE_PEEK( pxQueue ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \\r
switch (pxQueue->ucQueueType) \\r
{ \\r
#undef traceTASK_PRIORITY_SET\r
#define traceTASK_PRIORITY_SET( pxTask, uxNewPriority ) \\r
prvTraceSaveObjectData(pxTask, uxNewPriority); \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
- if (TRACE_GET_TASK_FILTER(pxTask) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTask) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_TASK_PRIORITY, (uint32_t)pxTask, uxNewPriority);\r
\r
/* Called in vTaskPriorityInherit, which is called by Mutex operations */\r
#undef traceTASK_PRIORITY_INHERIT\r
#define traceTASK_PRIORITY_INHERIT( pxTask, uxNewPriority ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
- if (TRACE_GET_TASK_FILTER(pxTask) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTask) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_TASK_PRIO_INHERIT, (uint32_t)pxTask, uxNewPriority);\r
\r
/* Called in vTaskPriorityDisinherit, which is called by Mutex operations */\r
#undef traceTASK_PRIORITY_DISINHERIT\r
#define traceTASK_PRIORITY_DISINHERIT( pxTask, uxNewPriority ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
- if (TRACE_GET_TASK_FILTER(pxTask) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTask) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_TASK_PRIO_DISINHERIT, (uint32_t)pxTask, uxNewPriority);\r
\r
/* Called in vTaskResume */\r
#undef traceTASK_RESUME\r
#define traceTASK_RESUME( pxTaskToResume ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
- if (TRACE_GET_TASK_FILTER(pxTaskToResume) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTaskToResume) & CurrentFilterMask) \\r
prvTraceStoreEvent1(PSF_EVENT_TASK_RESUME, (uint32_t)pxTaskToResume);\r
\r
/* Called in vTaskResumeFromISR */\r
#undef traceTASK_RESUME_FROM_ISR\r
#define traceTASK_RESUME_FROM_ISR( pxTaskToResume ) \\r
- if (TRACE_GET_TASK_FILTER(pxTaskToResume) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTaskToResume) & CurrentFilterMask) \\r
prvTraceStoreEvent1(PSF_EVENT_TASK_RESUME_FROMISR, (uint32_t)pxTaskToResume);\r
\r
#if (TRC_CFG_INCLUDE_MEMMANG_EVENTS == 1)\r
\r
#undef traceMALLOC\r
#define traceMALLOC( pvAddress, uiSize ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_MALLOC, (uint32_t)pvAddress, uiSize);\r
\r
#undef traceFREE\r
#define traceFREE( pvAddress, uiSize ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_FREE, (uint32_t)pvAddress, (uint32_t)(0 - uiSize)); /* "0 -" instead of just "-" to get rid of a warning... */\r
\r
#endif /* (TRC_CFG_INCLUDE_MEMMANG_EVENTS == 1) */\r
TRACE_SET_OBJECT_FILTER(TIMER, tmr, CurrentFilterGroup); \\r
prvTraceSaveSymbol(tmr, tmr->pcTimerName); \\r
prvTraceStoreStringEvent(1, PSF_EVENT_OBJ_NAME, tmr->pcTimerName, tmr); \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(TIMER, tmr) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_TIMER_CREATE, (uint32_t)tmr, tmr->xTimerPeriodInTicks);\r
\r
#undef traceTIMER_CREATE_FAILED\r
#define traceTIMER_CREATE_FAILED() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent0(PSF_EVENT_TIMER_CREATE_FAILED);\r
\r
#if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_8_X)\r
/* Note that xCommandID can never be tmrCOMMAND_EXECUTE_CALLBACK (-1) since the trace macro is not called in that case */\r
#undef traceTIMER_COMMAND_SEND\r
#define traceTIMER_COMMAND_SEND(tmr, xCommandID, xOptionalValue, xReturn) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(TIMER, tmr) & CurrentFilterMask) \\r
switch(xCommandID) \\r
{ \\r
\r
#undef traceTIMER_EXPIRED\r
#define traceTIMER_EXPIRED(tmr) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(TIMER, tmr) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_TIMER_EXPIRED, (uint32_t)tmr->pxCallbackFunction, (uint32_t)tmr->pvTimerID);\r
\r
#undef traceEVENT_GROUP_CREATE\r
#define traceEVENT_GROUP_CREATE(eg) \\r
TRACE_SET_OBJECT_FILTER(EVENTGROUP, eg, CurrentFilterGroup); \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \\r
prvTraceStoreEvent1(PSF_EVENT_EVENTGROUP_CREATE, (uint32_t)eg);\r
\r
#undef traceEVENT_GROUP_DELETE\r
#define traceEVENT_GROUP_DELETE(eg) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \\r
prvTraceStoreEvent1(PSF_EVENT_EVENTGROUP_DELETE, (uint32_t)eg); \\r
prvTraceDeleteSymbol(eg);\r
\r
#undef traceEVENT_GROUP_CREATE_FAILED\r
#define traceEVENT_GROUP_CREATE_FAILED() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent0(PSF_EVENT_EVENTGROUP_CREATE_FAILED);\r
\r
#undef traceEVENT_GROUP_SYNC_BLOCK\r
#define traceEVENT_GROUP_SYNC_BLOCK(eg, bitsToSet, bitsToWaitFor) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_EVENTGROUP_SYNC_BLOCK, (uint32_t)eg, bitsToWaitFor);\r
\r
#undef traceEVENT_GROUP_SYNC_END\r
#define traceEVENT_GROUP_SYNC_END(eg, bitsToSet, bitsToWaitFor, wasTimeout) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \\r
prvTraceStoreEvent2((wasTimeout != pdTRUE) ? PSF_EVENT_EVENTGROUP_SYNC : PSF_EVENT_EVENTGROUP_SYNC_FAILED, (uint32_t)eg, bitsToWaitFor);\r
\r
#undef traceEVENT_GROUP_WAIT_BITS_BLOCK\r
#define traceEVENT_GROUP_WAIT_BITS_BLOCK(eg, bitsToWaitFor) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_EVENTGROUP_WAITBITS_BLOCK, (uint32_t)eg, bitsToWaitFor);\r
\r
#undef traceEVENT_GROUP_WAIT_BITS_END\r
#define traceEVENT_GROUP_WAIT_BITS_END(eg, bitsToWaitFor, wasTimeout) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \\r
prvTraceStoreEvent2((wasTimeout != pdTRUE) ? PSF_EVENT_EVENTGROUP_WAITBITS : PSF_EVENT_EVENTGROUP_WAITBITS_FAILED, (uint32_t)eg, bitsToWaitFor);\r
\r
#undef traceEVENT_GROUP_CLEAR_BITS\r
#define traceEVENT_GROUP_CLEAR_BITS(eg, bitsToClear) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_EVENTGROUP_CLEARBITS, (uint32_t)eg, bitsToClear);\r
\r
\r
#undef traceEVENT_GROUP_SET_BITS\r
#define traceEVENT_GROUP_SET_BITS(eg, bitsToSet) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_EVENTGROUP_SETBITS, (uint32_t)eg, bitsToSet);\r
\r
#undef traceTASK_NOTIFY_TAKE\r
#if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0)\r
#define traceTASK_NOTIFY_TAKE() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \\r
if (pxCurrentTCB->ucNotifyState == taskNOTIFICATION_RECEIVED) \\r
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_TAKE, (uint32_t)pxCurrentTCB, xTicksToWait); \\r
else \\r
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_TAKE_FAILED, (uint32_t)pxCurrentTCB, xTicksToWait);}\r
#else /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */\r
#define traceTASK_NOTIFY_TAKE() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \\r
if (pxCurrentTCB->eNotifyState == eNotified) \\r
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_TAKE, (uint32_t)pxCurrentTCB, xTicksToWait); \\r
else \\r
\r
#undef traceTASK_NOTIFY_TAKE_BLOCK\r
#define traceTASK_NOTIFY_TAKE_BLOCK() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_TAKE_BLOCK, (uint32_t)pxCurrentTCB, xTicksToWait);\r
\r
#undef traceTASK_NOTIFY_WAIT\r
#if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0)\r
#define traceTASK_NOTIFY_WAIT() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \\r
if (pxCurrentTCB->ucNotifyState == taskNOTIFICATION_RECEIVED) \\r
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_WAIT, (uint32_t)pxCurrentTCB, xTicksToWait); \\r
else \\r
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_WAIT_FAILED, (uint32_t)pxCurrentTCB, xTicksToWait);}\r
#else /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */\r
#define traceTASK_NOTIFY_WAIT() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \\r
if (pxCurrentTCB->eNotifyState == eNotified) \\r
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_WAIT, (uint32_t)pxCurrentTCB, xTicksToWait); \\r
else \\r
\r
#undef traceTASK_NOTIFY_WAIT_BLOCK\r
#define traceTASK_NOTIFY_WAIT_BLOCK() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_WAIT_BLOCK, (uint32_t)pxCurrentTCB, xTicksToWait);\r
\r
#undef traceTASK_NOTIFY\r
#define traceTASK_NOTIFY() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
- if (TRACE_GET_TASK_FILTER(xTaskToNotify) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, xTaskToNotify) & CurrentFilterMask) \\r
prvTraceStoreEvent1(PSF_EVENT_TASK_NOTIFY, (uint32_t)xTaskToNotify);\r
\r
#undef traceTASK_NOTIFY_FROM_ISR\r
#define traceTASK_NOTIFY_FROM_ISR() \\r
- if (TRACE_GET_TASK_FILTER(xTaskToNotify) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, xTaskToNotify) & CurrentFilterMask) \\r
prvTraceStoreEvent1(PSF_EVENT_TASK_NOTIFY_FROM_ISR, (uint32_t)xTaskToNotify);\r
\r
#undef traceTASK_NOTIFY_GIVE_FROM_ISR\r
#define traceTASK_NOTIFY_GIVE_FROM_ISR() \\r
- if (TRACE_GET_TASK_FILTER(xTaskToNotify) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, xTaskToNotify) & CurrentFilterMask) \\r
prvTraceStoreEvent1(PSF_EVENT_TASK_NOTIFY_GIVE_FROM_ISR, (uint32_t)xTaskToNotify);\r
\r
#undef traceQUEUE_REGISTRY_ADD\r
#undef traceSTREAM_BUFFER_CREATE\r
#define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer ) \\r
TRACE_SET_OBJECT_FILTER(STREAMBUFFER, pxStreamBuffer, CurrentFilterGroup); \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, pxStreamBuffer) & CurrentFilterMask) \\r
prvTraceStoreEvent2(xIsMessageBuffer == 1 ? PSF_EVENT_MESSAGEBUFFER_CREATE : PSF_EVENT_STREAMBUFFER_CREATE, (uint32_t)pxStreamBuffer, xBufferSizeBytes);\r
\r
#undef traceSTREAM_BUFFER_CREATE_FAILED\r
#define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreEvent2(xIsMessageBuffer == 1 ? PSF_EVENT_MESSAGEBUFFER_CREATE_FAILED : PSF_EVENT_STREAMBUFFER_CREATE_FAILED, 0 , xBufferSizeBytes);\r
\r
#undef traceSTREAM_BUFFER_CREATE_STATIC_FAILED\r
\r
#undef traceSTREAM_BUFFER_DELETE\r
#define traceSTREAM_BUFFER_DELETE( xStreamBuffer ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, pxStreamBuffer) & CurrentFilterMask) \\r
prvTraceStoreEvent2(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_DELETE : PSF_EVENT_STREAMBUFFER_DELETE, (uint32_t)xStreamBuffer, prvBytesInBuffer(xStreamBuffer)); \\r
prvTraceDeleteSymbol(xStreamBuffer);\r
\r
#undef traceSTREAM_BUFFER_RESET\r
#define traceSTREAM_BUFFER_RESET( xStreamBuffer ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \\r
prvTraceStoreEvent2(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_RESET : PSF_EVENT_STREAMBUFFER_RESET, (uint32_t)xStreamBuffer, 0);\r
\r
#undef traceSTREAM_BUFFER_SEND\r
#define traceSTREAM_BUFFER_SEND( xStreamBuffer, xReturn ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \\r
prvTraceStoreEvent2(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_SEND : PSF_EVENT_STREAMBUFFER_SEND, (uint32_t)xStreamBuffer, prvBytesInBuffer(xStreamBuffer));\r
\r
#undef traceBLOCKING_ON_STREAM_BUFFER_SEND\r
#define traceBLOCKING_ON_STREAM_BUFFER_SEND( xStreamBuffer ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \\r
prvTraceStoreEvent1(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_SEND_BLOCK : PSF_EVENT_STREAMBUFFER_SEND_BLOCK, (uint32_t)xStreamBuffer);\r
\r
#undef traceSTREAM_BUFFER_SEND_FAILED\r
#define traceSTREAM_BUFFER_SEND_FAILED( xStreamBuffer ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \\r
prvTraceStoreEvent1(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_SEND_FAILED : PSF_EVENT_STREAMBUFFER_SEND_FAILED, (uint32_t)xStreamBuffer);\r
\r
#undef traceSTREAM_BUFFER_RECEIVE\r
#define traceSTREAM_BUFFER_RECEIVE( xStreamBuffer, xReceivedLength ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \\r
prvTraceStoreEvent2(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_RECEIVE: PSF_EVENT_STREAMBUFFER_RECEIVE, (uint32_t)xStreamBuffer, prvBytesInBuffer(xStreamBuffer));\r
\r
#undef traceBLOCKING_ON_STREAM_BUFFER_RECEIVE\r
#define traceBLOCKING_ON_STREAM_BUFFER_RECEIVE( xStreamBuffer ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \\r
prvTraceStoreEvent1(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_RECEIVE_BLOCK: PSF_EVENT_STREAMBUFFER_RECEIVE_BLOCK, (uint32_t)xStreamBuffer);\r
\r
#undef traceSTREAM_BUFFER_RECEIVE_FAILED\r
#define traceSTREAM_BUFFER_RECEIVE_FAILED( xStreamBuffer ) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \\r
prvTraceStoreEvent1(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_RECEIVE_FAILED: PSF_EVENT_STREAMBUFFER_RECEIVE_FAILED, (uint32_t)xStreamBuffer);\r
\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.5\r
* Percepio AB, www.percepio.com\r
*\r
* trcPortDefines.h\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.5\r
* Percepio AB, www.percepio.com\r
*\r
* trcRecorder.h\r
extern "C" {\r
#endif\r
\r
-#include <stdarg.h>\r
#include <stdint.h>\r
#include <stddef.h>\r
+\r
#include "trcConfig.h"\r
#include "trcPortDefines.h"\r
\r
#include "trcHardwarePort.h"\r
#include "trcKernelPort.h"\r
\r
+// Not available in snapshot mode\r
+#define vTraceConsoleChannelPrintF(fmt, ...)\r
+\r
#endif\r
\r
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)\r
\r
#if (TRC_USE_TRACEALYZER_RECORDER == 1)\r
\r
+/* The user event channel for recorder warnings, must be defined in trcKernelPort.c */\r
+extern traceString trcWarningChannel;\r
+\r
#define TRACE_GET_LOW16(value) ((uint16_t)((value) & 0x0000FFFF))\r
#define TRACE_GET_HIGH16(value) ((uint16_t)(((value) >> 16) & 0x0000FFFF))\r
#define TRACE_SET_LOW16(current, value) (((current) & 0xFFFF0000) | (value))\r
#define vTracePrint(chn, ...) (void)chn\r
#endif\r
\r
+\r
+/*******************************************************************************\r
+* vTraceConsoleChannelPrintF\r
+*\r
+* Wrapper for vTracePrint, using the default channel. Can be used as a drop-in\r
+* replacement for printf and similar functions, e.g. in a debug logging macro.\r
+*\r
+* Example:\r
+*\r
+* // Old: #define LogString debug_console_printf\r
+*\r
+* // New, log to Tracealyzer instead:\r
+* #define LogString vTraceConsoleChannelPrintF \r
+* ...\r
+* LogString("My value is: %d", myValue);\r
+******************************************************************************/\r
+#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)\r
+void vTraceConsoleChannelPrintF(const char* fmt, ...);\r
+#endif\r
+\r
/*******************************************************************************\r
* xTraceRegisterString\r
*\r
/* This macro will create a task in the object table */\r
#undef trcKERNEL_HOOKS_TASK_CREATE\r
#define trcKERNEL_HOOKS_TASK_CREATE(SERVICE, CLASS, pxTCB) \\r
- TRACE_SET_TASK_NUMBER(pxTCB); \\r
- TRACE_SET_TASK_FILTER(pxTCB, CurrentFilterGroup); \\r
+ TRACE_SET_OBJECT_NUMBER(TASK, pxTCB); \\r
+ TRACE_SET_OBJECT_FILTER(TASK, pxTCB, CurrentFilterGroup); \\r
prvTraceSetObjectName(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_GET_TASK_NAME(pxTCB)); \\r
prvTraceSetPriorityProperty(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_GET_TASK_PRIORITY(pxTCB)); \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
- if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \\r
prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB));\r
\r
/* This macro will remove the task and store it in the event buffer */\r
#undef trcKERNEL_HOOKS_TASK_DELETE\r
#define trcKERNEL_HOOKS_TASK_DELETE(SERVICE, SERVICE_NAME, SERVICE_PROP, pxTCB) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
- if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \\r
prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB)); \\r
prvTraceStoreObjectNameOnCloseEvent(SERVICE_NAME, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_CLASS_TASK); \\r
prvTraceStoreObjectPropertiesOnCloseEvent(SERVICE_PROP, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_CLASS_TASK); \\r
TRACE_SET_OBJECT_NUMBER(CLASS, pxObject);\\r
TRACE_SET_OBJECT_FILTER(CLASS, pxObject, CurrentFilterGroup); \\r
prvMarkObjectAsUsed(TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject));\\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \\r
prvTraceStoreKernelCall(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject)); \\r
prvTraceSetObjectState(TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject), 0);\r
/* This macro will remove the object and store it in the event buffer */\r
#undef trcKERNEL_HOOKS_OBJECT_DELETE\r
#define trcKERNEL_HOOKS_OBJECT_DELETE(SERVICE, SERVICE_NAME, SERVICE_PROP, CLASS, pxObject) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \\r
prvTraceStoreKernelCall(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject)); \\r
prvTraceStoreObjectNameOnCloseEvent(SERVICE_NAME, TRACE_GET_OBJECT_NUMBER(CLASS, pxObject), TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject)); \\r
/* This macro will create a call to a kernel service with a certain result, with an object as parameter */\r
#undef trcKERNEL_HOOKS_KERNEL_SERVICE\r
#define trcKERNEL_HOOKS_KERNEL_SERVICE(SERVICE, CLASS, pxObject) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \\r
prvTraceStoreKernelCall(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject));\r
\r
+/* This macro will create a call to a kernel service with a certain result, with a null object as parameter */\r
+#undef trcKERNEL_HOOKS_KERNEL_SERVICE_NULL_OBJECT\r
+#define trcKERNEL_HOOKS_KERNEL_SERVICE_NULL_OBJECT(SERVICE, TRACECLASS) \\r
+ if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ prvTraceStoreKernelCall(SERVICE, TRACECLASS, 0);\r
+\r
/* This macro will create a call to a kernel service with a certain result, with an object as parameter */\r
#undef trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_PARAM\r
#define trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_PARAM(SERVICE, CLASS, pxObject, param) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \\r
prvTraceStoreKernelCallWithParam(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject), (uint32_t)param);\r
\r
+/* This macro will create a call to a kernel service with a certain result, with a null object and other value as parameter */\r
+#undef trcKERNEL_HOOKS_KERNEL_SERVICE_NULL_OBJECT_WITH_PARAM\r
+#define trcKERNEL_HOOKS_KERNEL_SERVICE_NULL_OBJECT_WITH_PARAM(SERVICE, TRACECLASS, param) \\r
+ if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ prvTraceStoreKernelCallWithParam(SERVICE, TRACECLASS, 0, param);\r
+\r
/* This macro will create a call to a kernel service with a certain result, with an object as parameter */\r
#undef trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_NUMERIC_PARAM_ONLY\r
#define trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_NUMERIC_PARAM_ONLY(SERVICE, param) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceStoreKernelCallWithNumericParamOnly(SERVICE, (uint32_t)param);\r
\r
/* This macro will create a call to a kernel service with a certain result, with an object as parameter */\r
/* This macro will flag a certain task as a finished instance */\r
#undef trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED\r
#define trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED() \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
prvTraceSetTaskInstanceFinished(TRACE_GET_TASK_NUMBER(TRACE_GET_CURRENT_TASK()));\r
\r
#if (TRC_CFG_INCLUDE_READY_EVENTS == 1)\r
/* This macro will create an event to indicate that a task became Ready */\r
#undef trcKERNEL_HOOKS_MOVED_TASK_TO_READY_STATE\r
#define trcKERNEL_HOOKS_MOVED_TASK_TO_READY_STATE(pxTCB) \\r
- if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \\r
prvTraceStoreTaskReady(TRACE_GET_TASK_NUMBER(pxTCB));\r
#else /*(TRC_CFG_INCLUDE_READY_EVENTS == 1)*/\r
#undef trcKERNEL_HOOKS_MOVED_TASK_TO_READY_STATE\r
/* This macro will create a task switch event to the currently executing task */\r
#undef trcKERNEL_HOOKS_TASK_SWITCH\r
#define trcKERNEL_HOOKS_TASK_SWITCH( pxTCB ) \\r
- if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \\r
prvTraceStoreTaskswitch(TRACE_GET_TASK_NUMBER(pxTCB));\r
\r
/* This macro will create an event to indicate that the task has been suspended */\r
#undef trcKERNEL_HOOKS_TASK_SUSPEND\r
#define trcKERNEL_HOOKS_TASK_SUSPEND(SERVICE, pxTCB) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
- if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \\r
prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB)); \\r
prvTraceSetTaskInstanceFinished((uint8_t)TRACE_GET_TASK_NUMBER(pxTCB));\r
\r
/* This macro will create an event to indicate that a task has called a wait/delay function */\r
#undef trcKERNEL_HOOKS_TASK_DELAY\r
#define trcKERNEL_HOOKS_TASK_DELAY(SERVICE, pxTCB, xValue) \\r
- if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \\r
{ \\r
prvTraceStoreKernelCallWithNumericParamOnly(SERVICE, xValue); \\r
prvTraceSetTaskInstanceFinished((uint8_t)TRACE_GET_TASK_NUMBER(pxTCB)); \\r
/* This macro will create an event to indicate that a task has gotten its priority changed */\r
#undef trcKERNEL_HOOKS_TASK_PRIORITY_CHANGE\r
#define trcKERNEL_HOOKS_TASK_PRIORITY_CHANGE(SERVICE, pxTCB, uxNewPriority) \\r
- if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \\r
{ \\r
prvTraceStoreKernelCallWithParam(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), prvTraceGetPriorityProperty(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB)));\\r
prvTraceSetPriorityProperty(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), (uint8_t)uxNewPriority); \\r
/* This macro will create an event to indicate that the task has been resumed */\r
#undef trcKERNEL_HOOKS_TASK_RESUME\r
#define trcKERNEL_HOOKS_TASK_RESUME(SERVICE, pxTCB) \\r
- if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
- if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \\r
prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB));\r
\r
#undef trcKERNEL_HOOKS_TASK_RESUME_FROM_ISR\r
#define trcKERNEL_HOOKS_TASK_RESUME_FROM_ISR(SERVICE, pxTCB) \\r
- if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \\r
+ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \\r
prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB));\r
\r
#if !defined TRC_CFG_INCLUDE_READY_EVENTS || TRC_CFG_INCLUDE_READY_EVENTS == 1\r
#define vTraceSetRecorderDataBuffer(pRecorderData)\r
#endif\r
\r
+#define vTraceConsoleChannelPrintF(fmt, ...)\r
+\r
#ifndef TRC_ALLOC_CUSTOM_BUFFER\r
#define TRC_ALLOC_CUSTOM_BUFFER(bufname)\r
#endif\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.4\r
* Percepio AB, www.percepio.com\r
*\r
* trcConfig.h\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.4\r
* Percepio AB, www.percepio.com\r
*\r
* trcSnapshotConfig.h\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.4\r
* Percepio AB, www.percepio.com\r
*\r
* trcStreamingConfig.h\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.5\r
* Percepio AB, www.percepio.com\r
*\r
* trcStreamingPort.h\r
{ \r
if ((CoreDebug->DEMCR & CoreDebug_DEMCR_TRCENA_Msk) && // Trace enabled\r
(ITM->TCR & ITM_TCR_ITMENA_Msk) && // ITM enabled\r
- (ITM->TER & (1UL << 0))) // ITM Port #0 enabled\r
+ (ITM->TER & (1UL << TRC_CFG_ITM_PORT))) // ITM port enabled\r
{\r
while (ITM->PORT[TRC_CFG_ITM_PORT].u32 == 0); // Block until room in ITM FIFO - This stream port is always in "blocking mode", since intended for high-speed ITM!\r
ITM->PORT[TRC_CFG_ITM_PORT].u32 = data; // Write the data\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.5\r
* Percepio AB, www.percepio.com\r
*\r
* trcStreamingPort.h\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.5\r
* Percepio AB, www.percepio.com\r
*\r
* trcStreamingPort.c\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.5\r
* Percepio AB, www.percepio.com\r
*\r
* trcStreamingPort.h\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.5\r
* Percepio AB, www.percepio.com\r
*\r
* trcStreamingPort.h\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.5\r
* Percepio AB, www.percepio.com\r
*\r
* trcStreamingPort.c\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.5\r
* Percepio AB, www.percepio.com\r
*\r
* trcStreamingPort.h\r
-------------------------------------------------------------------------------\r
- Tracealyzer Recorder Library v4.1.0 for FreeRTOS\r
+ Tracealyzer Recorder Library for FreeRTOS\r
-------------------------------------------------------------------------------\r
\r
Tracealyzer is a sophisticated tool for tracing and visualization\r
\r
Tracealyzer supports FreeRTOS v7.3 and newer, including Amazon FreeRTOS.\r
\r
+-------------------------------------------------------------------------------\r
+Changes, v4.1.4 -> v4.1.5\r
+\r
+- Fixed a bug in the ITM stream port, that required Port 0 to be enabled.\r
+- Added missing include of stdio.h (needed by vTraceConsoleChannelPrintF).\r
+- Moved standard includes from trcRecorder.h into the .c files needing them.\r
+\r
+-------------------------------------------------------------------------------\r
+\r
+Changes, v4.1.2 -> v4.1.4\r
+\r
+- Fixed a compile error when certain FreeRTOS settings were used\r
+- Disabled filter support for FreeRTOS v7.3 since it uses "char" for object id\r
+\r
+-------------------------------------------------------------------------------\r
+\r
+Changes, v4.1.0 -> v4.1.2\r
+\r
+- Added vTraceConsoleChannelPrintF(...)\r
+\r
-------------------------------------------------------------------------------\r
\r
Changes, v4.0.3 -> v4.1.0\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.5\r
* Percepio AB, www.percepio.com\r
*\r
* trcKernelPort.c\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.5\r
* Percepio AB, www.percepio.com\r
*\r
* trcSnapshotRecorder.c\r
* The generic core of the trace recorder's snapshot mode.\r
*\r
* Terms of Use\r
- * This file is part of the trace recorder library (RECORDER), which is the \r
+ * This file is part of the trace recorder library (RECORDER), which is the\r
* intellectual property of Percepio AB (PERCEPIO) and provided under a\r
* license as follows.\r
* The RECORDER may be used free of charge for the purpose of recording data\r
* You may distribute the RECORDER in its original source code form, assuming\r
* this text (terms of use, disclaimer, copyright notice) is unchanged. You are\r
* allowed to distribute the RECORDER with minor modifications intended for\r
- * configuration or porting of the RECORDER, e.g., to allow using it on a \r
+ * configuration or porting of the RECORDER, e.g., to allow using it on a\r
* specific processor, processor family or with a specific communication\r
* interface. Any such modifications should be documented directly below\r
- * this comment block. \r
+ * this comment block.\r
*\r
* Disclaimer\r
* The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty\r
- * as to its use or performance. PERCEPIO does not and cannot warrant the \r
+ * as to its use or performance. PERCEPIO does not and cannot warrant the\r
* performance or results you may obtain by using the RECORDER or documentation.\r
* PERCEPIO make no warranties, express or implied, as to noninfringement of\r
* third party rights, merchantability, or fitness for any particular purpose.\r
\r
/*************** Private Functions *******************************************/\r
static void prvStrncpy(char* dst, const char* src, uint32_t maxLength);\r
-static uint8_t prvTraceGetObjectState(uint8_t objectclass, traceHandle id); \r
-static void prvTraceGetChecksum(const char *pname, uint8_t* pcrc, uint8_t* plength); \r
-static void* prvTraceNextFreeEventBufferSlot(void); \r
+static uint8_t prvTraceGetObjectState(uint8_t objectclass, traceHandle id);\r
+static void prvTraceGetChecksum(const char *pname, uint8_t* pcrc, uint8_t* plength);\r
+static void* prvTraceNextFreeEventBufferSlot(void);\r
static uint16_t prvTraceGetDTS(uint16_t param_maxDTS);\r
static traceString prvTraceOpenSymbol(const char* name, traceString userEventChannel);\r
static void prvTraceUpdateCounters(void);\r
void prvTraceIncreaseISRActive(void);\r
void prvTraceDecreaseISRActive(void);\r
#endif /*(TRC_CFG_INCLUDE_ISR_TRACING == 0)*/\r
- \r
+\r
#if (TRC_CFG_USE_16BIT_OBJECT_HANDLES == 1)\r
static uint8_t prvTraceGet8BitHandle(traceHandle handle);\r
#else\r
* Initializes and optionally starts the trace, depending on the start option.\r
* To use the trace recorder, the startup must call vTraceEnable before any RTOS\r
* calls are made (including "create" calls). Three start options are provided:\r
-* \r
-* TRC_START: Starts the tracing directly. In snapshot mode this allows for \r
+*\r
+* TRC_START: Starts the tracing directly. In snapshot mode this allows for\r
* starting the trace at any point in your code, assuming vTraceEnable(TRC_INIT)\r
* has been called in the startup.\r
* Can also be used for streaming without Tracealyzer control, e.g. to a local\r
* flash file system (assuming such a "stream port", see trcStreamingPort.h).\r
-* \r
+*\r
* TRC_INIT: Initializes the trace recorder, but does not start the tracing.\r
* In snapshot mode, this must be followed by a vTraceEnable(TRC_START) sometime\r
* later.\r
*\r
* Usage examples, in snapshot mode:\r
-* \r
+*\r
* Snapshot trace, from startup:\r
* <board init>\r
* vTraceEnable(TRC_START);\r
* <RTOS init>\r
* ...\r
* vTraceEnable(TRC_START); // e.g., in task context, at some relevant event\r
-* \r
+*\r
*\r
* Note: See other implementation of vTraceEnable in trcStreamingRecorder.c\r
******************************************************************************/\r
void vTraceEnable(int startOption)\r
{\r
prvTraceInitTraceData();\r
- \r
+\r
if (startOption == TRC_START)\r
{\r
vTraceStart();\r
else if (startOption != TRC_INIT)\r
{\r
prvTraceError("Unexpected argument to vTraceEnable (snapshot mode)");\r
- } \r
+ }\r
}\r
\r
/*******************************************************************************\r
TRACE_ASSERT(RecorderDataPtr != NULL, "Recorder not initialized. Use vTraceEnable() instead!", 0);\r
return 0;\r
}\r
- \r
+\r
if (RecorderDataPtr->recorderActive == 1)\r
return 1; /* Already running */\r
\r
* xTraceSetISRProperties\r
*\r
* Stores a name and priority level for an Interrupt Service Routine, to allow\r
- * for better visualization. Returns a traceHandle used by vTraceStoreISRBegin. \r
+ * for better visualization. Returns a traceHandle used by vTraceStoreISRBegin.\r
*\r
* Example:\r
* #define PRIO_ISR_TIMER1 3 // the hardware priority of the interrupt\r
******************************************************************************/\r
traceHandle xTraceSetISRProperties(const char* name, uint8_t priority)\r
{\r
- static traceHandle handle = 0; \r
+ static traceHandle handle = 0;\r
TRACE_ASSERT(RecorderDataPtr != NULL, "Recorder not initialized, call vTraceEnable() first!", (traceHandle)0);\r
TRACE_ASSERT(handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[TRACE_CLASS_ISR], "xTraceSetISRProperties: Invalid value for handle", 0);\r
TRACE_ASSERT(name != NULL, "xTraceSetISRProperties: name == NULL", 0);\r
\r
prvTraceSetObjectName(TRACE_CLASS_ISR, handle, name);\r
prvTraceSetPriorityProperty(TRACE_CLASS_ISR, handle, priority);\r
- \r
+\r
return handle;\r
}\r
\r
{\r
/*************************************************************************\r
* This occurs if an ISR calls a trace function, preempting a previous\r
- * trace call that is being processed in a different ISR or task. \r
+ * trace call that is being processed in a different ISR or task.\r
* If this occurs, there is probably a problem in the definition of the\r
* recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and\r
* TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt\r
return;\r
}\r
trcCRITICAL_SECTION_BEGIN();\r
- \r
+\r
if (RecorderDataPtr->recorderActive && handle_of_last_logged_task)\r
{\r
uint16_t dts4;\r
- \r
- TRACE_ASSERT(handle != 0, "vTraceStoreISRBegin: Invalid ISR handle (NULL)", TRC_UNUSED); \r
+\r
+ TRACE_ASSERT(handle != 0, "vTraceStoreISRBegin: Invalid ISR handle (NULL)", TRC_UNUSED);\r
TRACE_ASSERT(handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[TRACE_CLASS_ISR], "vTraceStoreISRBegin: Invalid ISR handle (> NISR)", TRC_UNUSED);\r
- \r
+\r
dts4 = (uint16_t)prvTraceGetDTS(0xFFFF);\r
\r
if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */\r
* Registers the end of an Interrupt Service Routine.\r
*\r
* The parameter pendingISR indicates if the interrupt has requested a\r
- * task-switch (= 1), e.g., by signaling a semaphore. Otherwise (= 0) the \r
+ * task-switch (= 1), e.g., by signaling a semaphore. Otherwise (= 0) the\r
* interrupt is assumed to return to the previous context.\r
*\r
* Example:\r
TSEvent* ts;\r
uint16_t dts5;\r
uint8_t hnd8 = 0, type = 0;\r
- \r
+\r
TRACE_ALLOC_CRITICAL_SECTION();\r
\r
if (! RecorderDataPtr->recorderActive || ! handle_of_last_logged_task)\r
{\r
/*************************************************************************\r
* This occurs if an ISR calls a trace function, preempting a previous\r
- * trace call that is being processed in a different ISR or task. \r
+ * trace call that is being processed in a different ISR or task.\r
* If this occurs, there is probably a problem in the definition of the\r
* recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and\r
* TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt\r
prvTraceError("vTraceStoreISREnd - recorder busy! See code comment.");\r
return;\r
}\r
- \r
+\r
if (nISRactive == 0)\r
{\r
prvTraceError("Unmatched call to vTraceStoreISREnd (nISRactive == 0, expected > 0)");\r
type = TS_ISR_RESUME;\r
hnd8 = prvTraceGet8BitHandle(isrstack[nISRactive - 1]); /* isrstack[nISRactive] is the handle of the ISR we're currently exiting. isrstack[nISRactive - 1] is the handle of the ISR that was executing previously. */\r
}\r
- else if ((isPendingContextSwitch == 0) || (prvTraceIsSchedulerSuspended())) \r
+ else if ((isPendingContextSwitch == 0) || (prvTraceIsSchedulerSuspended()))\r
{\r
/* Return to interrupted task, if no context switch will occur in between. */\r
type = TS_TASK_RESUME;\r
static void prvTraceCopyToDataBuffer(uint32_t* data, uint32_t count)\r
{\r
uint32_t slots;\r
- \r
+\r
TRACE_ASSERT(data != NULL,\r
"prvTraceCopyToDataBuffer: data == NULL.", TRC_UNUSED);\r
TRACE_ASSERT(count <= (TRC_CFG_SEPARATE_USER_EVENT_BUFFER_SIZE),\r
{\r
static uint32_t old_timestamp = 0;\r
uint32_t old_nextSlotToWrite = 0;\r
- \r
+\r
TRACE_ALLOC_CRITICAL_SECTION();\r
\r
TRACE_ASSERT((TRC_CFG_SEPARATE_USER_EVENT_BUFFER_SIZE) >= noOfSlots, "prvTraceUBHelper2: TRC_CFG_SEPARATE_USER_EVENT_BUFFER_SIZE is too small to handle this event.", TRC_UNUSED);\r
{\r
uint8_t i;\r
traceUBChannel retVal = 0;\r
- \r
+\r
TRACE_ALLOC_CRITICAL_SECTION();\r
\r
TRACE_ASSERT(formatStr != 0, "xTraceRegisterChannelFormat: formatStr == 0", (traceUBChannel)0);\r
void vTraceUBData(traceUBChannel channelPair, ...)\r
{\r
va_list vl;\r
- \r
+\r
TRACE_ASSERT(channelPair != 0, "vTraceUBData: Not a valid traceUBChannel!", TRC_UNUSED);\r
\r
va_start(vl, channelPair);\r
\r
#if ((!defined TRC_CFG_INCLUDE_READY_EVENTS) || (TRC_CFG_INCLUDE_READY_EVENTS == 1))\r
\r
-void prvTraceSetReadyEventsEnabled(int status) \r
+void prvTraceSetReadyEventsEnabled(int status)\r
{\r
readyEventsEnabled = status;\r
}\r
*\r
* This function stores a ready state for the task handle sent in as parameter.\r
******************************************************************************/\r
-void prvTraceStoreTaskReady(traceHandle handle) \r
+void prvTraceStoreTaskReady(traceHandle handle)\r
{\r
uint16_t dts3;\r
TREvent* tr;\r
placement of the trace macro. In that case, the events are ignored. */\r
return;\r
}\r
- \r
+\r
if (! readyEventsEnabled)\r
{\r
- /* When creating tasks, ready events are also created. If creating \r
- a "hidden" (not traced) task, we must therefore disable recording \r
+ /* When creating tasks, ready events are also created. If creating\r
+ a "hidden" (not traced) task, we must therefore disable recording\r
of ready events to avoid an undesired ready event... */\r
return;\r
}\r
{\r
/*************************************************************************\r
* This occurs if an ISR calls a trace function, preempting a previous\r
- * trace call that is being processed in a different ISR or task. \r
+ * trace call that is being processed in a different ISR or task.\r
* If this occurs, there is probably a problem in the definition of the\r
* recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and\r
* TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt\r
*\r
* This function stores a low power state.\r
******************************************************************************/\r
-void prvTraceStoreLowPower(uint32_t flag) \r
+void prvTraceStoreLowPower(uint32_t flag)\r
{\r
uint16_t dts;\r
LPEvent* lp;\r
{\r
/*************************************************************************\r
* This occurs if an ISR calls a trace function, preempting a previous\r
- * trace call that is being processed in a different ISR or task. \r
+ * trace call that is being processed in a different ISR or task.\r
* If this occurs, there is probably a problem in the definition of the\r
* recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and\r
* TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt\r
/* Occurs in vTraceInitTraceData, if using dynamic allocation. */\r
return;\r
}\r
- \r
+\r
if (signed_size < 0)\r
size = (uint32_t)(- signed_size);\r
else\r
size = (uint32_t)(signed_size);\r
\r
trcCRITICAL_SECTION_BEGIN();\r
- \r
+\r
heapMemUsage = heapMemUsage + (uint32_t)signed_size;\r
- \r
+\r
if (RecorderDataPtr->recorderActive)\r
{\r
dts1 = (uint8_t)prvTraceGetDTS(0xFF);\r
/* If the heap address range is within 16 MB, i.e., the upper 8 bits\r
of addresses are constant, this optimization avoids storing an extra\r
event record by ignoring the upper 8 bit of the address */\r
- addr_low = address & 0xFFFF; \r
+ addr_low = address & 0xFFFF;\r
addr_high = (address >> 16) & 0xFF;\r
#else\r
/* The whole 32 bit address is stored using a second event record\r
ma->addr_high = addr_high;\r
ma->type = (uint8_t) (ecode + 1); /* Note this! */\r
ms->type = (uint8_t) ecode;\r
- prvTraceUpdateCounters(); \r
+ prvTraceUpdateCounters();\r
RecorderDataPtr->heapMemUsage = heapMemUsage;\r
}\r
}\r
{\r
/*************************************************************************\r
* This occurs if an ISR calls a trace function, preempting a previous\r
- * trace call that is being processed in a different ISR or task. \r
+ * trace call that is being processed in a different ISR or task.\r
* If this occurs, there is probably a problem in the definition of the\r
* recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and\r
* TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt\r
{\r
/*************************************************************************\r
* This occurs if an ISR calls a trace function, preempting a previous\r
- * trace call that is being processed in a different ISR or task. \r
+ * trace call that is being processed in a different ISR or task.\r
* If this occurs, there is probably a problem in the definition of the\r
* recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and\r
* TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt\r
{\r
/*************************************************************************\r
* This occurs if an ISR calls a trace function, preempting a previous\r
- * trace call that is being processed in a different ISR or task. \r
+ * trace call that is being processed in a different ISR or task.\r
* If this occurs, there is probably a problem in the definition of the\r
* recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and\r
* TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt\r
******************************************************************************/\r
\r
/* A set of stacks that keeps track of available object handles for each class.\r
-The stacks are empty initially, meaning that allocation of new handles will be \r
+The stacks are empty initially, meaning that allocation of new handles will be\r
based on a counter (for each object class). Any delete operation will\r
return the handle to the corresponding stack, for reuse on the next allocate.*/\r
objectHandleStackType objectHandleStacks = { { 0 }, { 0 }, { 0 }, { 0 }, { 0 } };\r
\r
-/* Initial TRC_HWTC_COUNT value, for detecting if the time-stamping source is \r
-enabled. If using the OS periodic timer for time-stamping, this might not \r
+/* Initial TRC_HWTC_COUNT value, for detecting if the time-stamping source is\r
+enabled. If using the OS periodic timer for time-stamping, this might not\r
have been configured on the earliest events during the startup. */\r
uint32_t init_hwtc_count;\r
\r
/*******************************************************************************\r
* RecorderDataPtr\r
*\r
- * Pointer to the main data structure, when in snapshot mode. \r
+ * Pointer to the main data structure, when in snapshot mode.\r
******************************************************************************/\r
RecorderDataType* RecorderDataPtr = NULL;\r
\r
/* This version of the function dynamically allocates the trace data */\r
void prvTraceInitTraceData()\r
-{ \r
- \r
+{\r
+\r
if (RecorderDataPtr == NULL)\r
{\r
#if (TRC_CFG_RECORDER_BUFFER_ALLOCATION == TRC_RECORDER_BUFFER_ALLOCATION_STATIC)\r
return;\r
}\r
}\r
- \r
+\r
init_hwtc_count = TRC_HWTC_COUNT;\r
- \r
+\r
(void)memset(RecorderDataPtr, 0, sizeof(RecorderDataType));\r
- \r
+\r
RecorderDataPtr->version = TRACE_KERNEL_VERSION;\r
RecorderDataPtr->minor_version = TRACE_MINOR_VERSION;\r
RecorderDataPtr->irq_priority_order = TRC_IRQ_PRIORITY_ORDER;\r
/* Kernel specific initialization of the objectHandleStacks variable */\r
vTraceInitObjectHandleStack();\r
\r
- \r
- /* Finally, the 12-byte "start markers" are initialized, allowing for \r
- Tracealyzer to find the trace data in a larger RAM dump. \r
- \r
+\r
+ /* Finally, the 12-byte "start markers" are initialized, allowing for\r
+ Tracealyzer to find the trace data in a larger RAM dump.\r
+\r
The start and end markers must be unique, but without proper precautions there\r
might be a risk of accidental duplicates of the start/end markers, e.g., due to\r
compiler optimizations.\r
- \r
- The below initialization of the start marker is therefore made in reverse order \r
- and the fields are volatile to ensure this assignment order. This to avoid any \r
+\r
+ The below initialization of the start marker is therefore made in reverse order\r
+ and the fields are volatile to ensure this assignment order. This to avoid any\r
chance of accidental duplicates of this elsewhere in memory.\r
- \r
+\r
Moreover, the fields are set byte-by-byte to avoid endian issues.*/\r
- \r
+\r
RecorderDataPtr->startmarker11 = 0xF4;\r
RecorderDataPtr->startmarker10 = 0xF3;\r
RecorderDataPtr->startmarker9 = 0xF2;\r
RecorderDataPtr->startmarker4 = 0x71;\r
RecorderDataPtr->startmarker3 = 0x04;\r
RecorderDataPtr->startmarker2 = 0x03;\r
- RecorderDataPtr->startmarker1 = 0x02; \r
- RecorderDataPtr->startmarker0 = 0x01; \r
+ RecorderDataPtr->startmarker1 = 0x02;\r
+ RecorderDataPtr->startmarker0 = 0x01;\r
\r
if (traceErrorMessage != NULL)\r
{\r
}\r
\r
\r
- \r
+\r
#ifdef TRC_PORT_SPECIFIC_INIT\r
TRC_PORT_SPECIFIC_INIT();\r
#endif\r
\r
uint16_t uiIndexOfObject(traceHandle objecthandle, uint8_t objectclass)\r
{\r
- TRACE_ASSERT(objectclass < TRACE_NCLASSES, \r
+ TRACE_ASSERT(objectclass < TRACE_NCLASSES,\r
"uiIndexOfObject: Invalid value for objectclass", 0);\r
- TRACE_ASSERT(objecthandle > 0 && objecthandle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass], \r
+ TRACE_ASSERT(objecthandle > 0 && objecthandle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass],\r
"uiIndexOfObject: Invalid value for objecthandle", 0);\r
\r
- if ((objectclass < TRACE_NCLASSES) && (objecthandle > 0) && \r
+ if ((objectclass < TRACE_NCLASSES) && (objecthandle > 0) &&\r
(objecthandle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass]))\r
{\r
- return (uint16_t)(RecorderDataPtr->ObjectPropertyTable.StartIndexOfClass[objectclass] + \r
+ return (uint16_t)(RecorderDataPtr->ObjectPropertyTable.StartIndexOfClass[objectclass] +\r
(RecorderDataPtr->ObjectPropertyTable.TotalPropertyBytesPerClass[objectclass] * (objecthandle-1)));\r
}\r
\r
TRACE_ALLOC_CRITICAL_SECTION();\r
\r
TRACE_ASSERT(RecorderDataPtr != NULL, "Recorder not initialized, call vTraceEnable() first!", (traceHandle)0);\r
- \r
- TRACE_ASSERT(objectclass < TRACE_NCLASSES, \r
+\r
+ TRACE_ASSERT(objectclass < TRACE_NCLASSES,\r
"prvTraceGetObjectHandle: Invalid value for objectclass", (traceHandle)0);\r
\r
trcCRITICAL_SECTION_BEGIN();\r
{\r
int indexOfHandle;\r
\r
- TRACE_ASSERT(objectclass < TRACE_NCLASSES, \r
+ TRACE_ASSERT(objectclass < TRACE_NCLASSES,\r
"prvTraceFreeObjectHandle: Invalid value for objectclass", TRC_UNUSED);\r
- TRACE_ASSERT(handle > 0 && handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass], \r
+ TRACE_ASSERT(handle > 0 && handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass],\r
"prvTraceFreeObjectHandle: Invalid value for handle", TRC_UNUSED);\r
\r
/* Check that there is room to push the handle on the stack */\r
uint8_t len;\r
uint8_t crc;\r
TRACE_ALLOC_CRITICAL_SECTION();\r
- \r
+\r
len = 0;\r
crc = 0;\r
- \r
+\r
TRACE_ASSERT(name != NULL, "prvTraceOpenSymbol: name == NULL", (traceString)0);\r
\r
prvTraceGetChecksum(name, &crc, &len);\r
unsigned int i = 0;\r
unsigned int e = 0;\r
\r
- TRACE_ASSERT(nofEntriesToCheck != 0, \r
+ TRACE_ASSERT(nofEntriesToCheck != 0,\r
"prvCheckDataToBeOverwrittenForMultiEntryEvents: nofEntriesToCheck == 0", TRC_UNUSED);\r
\r
while (i < nofEntriesToCheck)\r
* Updates the index of the event buffer.\r
******************************************************************************/\r
void prvTraceUpdateCounters(void)\r
-{ \r
+{\r
if (RecorderDataPtr->recorderActive == 0)\r
{\r
return;\r
}\r
- \r
+\r
RecorderDataPtr->numEvents++;\r
\r
RecorderDataPtr->nextFreeIndex++;\r
\r
TRACE_ASSERT(param_maxDTS == 0xFF || param_maxDTS == 0xFFFF, "prvTraceGetDTS: Invalid value for param_maxDTS", 0);\r
\r
- \r
+\r
if (RecorderDataPtr->frequency == 0)\r
- { \r
+ {\r
if (timestampFrequency != 0)\r
{\r
/* If to override default TRC_HWTC_FREQ_HZ value with value set by vTraceSetFrequency */\r
RecorderDataPtr->frequency = timestampFrequency / (TRC_HWTC_DIVISOR);\r
- } \r
+ }\r
else if (init_hwtc_count != (TRC_HWTC_COUNT))\r
{\r
- /* If using default value and timer has been started. \r
+ /* If using default value and timer has been started.\r
Note: If the default frequency value set here would be incorrect, e.g.,\r
- if the timer has actually not been configured yet, override this \r
+ if the timer has actually not been configured yet, override this\r
with vTraceSetFrequency.\r
*/\r
- RecorderDataPtr->frequency = (TRC_HWTC_FREQ_HZ) / (TRC_HWTC_DIVISOR); \r
+ RecorderDataPtr->frequency = (TRC_HWTC_FREQ_HZ) / (TRC_HWTC_DIVISOR);\r
}\r
/* If no override (vTraceSetFrequency) and timer inactive -> no action */\r
}\r
- \r
+\r
/**************************************************************************\r
* The below statements read the timestamp from the timer port module.\r
* If necessary, whole seconds are extracted using division while the rest\r
* comes from the modulo operation.\r
**************************************************************************/\r
- \r
- prvTracePortGetTimeStamp(×tamp); \r
- \r
+\r
+ prvTracePortGetTimeStamp(×tamp);\r
+\r
/***************************************************************************\r
* Since dts is unsigned the result will be correct even if timestamp has\r
* wrapped around.\r
\r
#if (TRC_CFG_USE_16BIT_OBJECT_HANDLES == 1)\r
\r
-static void prvTraceStoreXID(traceHandle handle); \r
+static void prvTraceStoreXID(traceHandle handle);\r
\r
/******************************************************************************\r
* prvTraceStoreXID\r
*\r
* Stores an XID (eXtended IDentifier) event.\r
* This is used if an object/task handle is larger than 255.\r
- * The parameter "handle" is the full (16 bit) handle, assumed to be 256 or \r
+ * The parameter "handle" is the full (16 bit) handle, assumed to be 256 or\r
* larger. Handles below 256 should not use this function.\r
*\r
* NOTE: this function MUST be called from within a critical section.\r
xid->type = XID;\r
\r
/* This function is (only) used when traceHandle is 16 bit... */\r
- xid->xps_16 = handle; \r
+ xid->xps_16 = handle;\r
\r
prvTraceUpdateCounters();\r
}\r
static uint8_t prvTraceGet8BitHandle(traceHandle handle)\r
{\r
if (handle > 255)\r
- { \r
+ {\r
prvTraceStoreXID(handle);\r
- /* The full handle (16 bit) is stored in the XID event. \r
+ /* The full handle (16 bit) is stored in the XID event.\r
This code (255) is used instead of zero (which is an error code).*/\r
- return 255; \r
+ return 255;\r
}\r
return (uint8_t)(handle & 0xFF);\r
}\r
if (TRC_REG_DEMCR == 0)\r
{\r
/* This function is called on Cortex-M3, M4 and M7 devices to initialize\r
- the DWT unit, assumed present. The DWT cycle counter is used for timestamping. \r
- \r
+ the DWT unit, assumed present. The DWT cycle counter is used for timestamping.\r
+\r
If the below error is produced, the DWT unit does not seem to be available.\r
- \r
+\r
In that case, define the macro TRC_CFG_ARM_CM_USE_SYSTICK in your build\r
- to use SysTick timestamping instead, or define your own timestamping by \r
+ to use SysTick timestamping instead, or define your own timestamping by\r
setting TRC_CFG_HARDWARE_PORT to TRC_HARDWARE_PORT_APPLICATION_DEFINED\r
and make the necessary definitions, as explained in trcHardwarePort.h.*/\r
- \r
+\r
prvTraceError("DWT unit not available, see code comment.");\r
break;\r
}\r
if (TRC_REG_DWT_CTRL & TRC_DWT_CTRL_NOCYCCNT)\r
{\r
/* This function is called on Cortex-M3, M4 and M7 devices to initialize\r
- the DWT unit, assumed present. The DWT cycle counter is used for timestamping. \r
- \r
+ the DWT unit, assumed present. The DWT cycle counter is used for timestamping.\r
+\r
If the below error is produced, the cycle counter does not seem to be available.\r
- \r
+\r
In that case, define the macro TRC_CFG_ARM_CM_USE_SYSTICK in your build\r
- to use SysTick timestamping instead, or define your own timestamping by \r
+ to use SysTick timestamping instead, or define your own timestamping by\r
setting TRC_CFG_HARDWARE_PORT to TRC_HARDWARE_PORT_APPLICATION_DEFINED\r
and make the necessary definitions, as explained in trcHardwarePort.h.*/\r
\r
}\r
/* Store the previous value */\r
last_traceTickCount = traceTickCount;\r
- \r
+\r
#else /*(TRC_HWTC_TYPE == TRC_OS_TIMER_INCR || TRC_HWTC_TYPE == TRC_OS_TIMER_DECR)*/\r
- \r
+\r
/* Timestamping is based on a free running timer */\r
/* This part handles free running clocks that can be scaled down to avoid too large DTS values.\r
Without this, the scaled timestamp will incorrectly wrap at (2^32 / TRC_HWTC_DIVISOR) ticks.\r
The scaled timestamp returned from this function is supposed to go from 0 -> 2^32, which in real time would represent (0 -> 2^32 * TRC_HWTC_DIVISOR) ticks. */\r
- \r
+\r
/* First we see how long time has passed since the last timestamp call, and we also add the ticks that was lost when we scaled down the last time. */\r
diff = (hwtc_count - last_hwtc_count) + last_hwtc_rest;\r
- \r
+\r
/* Scale down the diff */\r
diff_scaled = diff / (TRC_HWTC_DIVISOR);\r
- \r
+\r
/* Find out how many ticks were lost when scaling down, so we can add them the next time */\r
last_hwtc_rest = diff % (TRC_HWTC_DIVISOR);\r
\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.5\r
* Percepio AB, www.percepio.com\r
*\r
* trcStreamingRecorder.c\r
\r
#if (TRC_USE_TRACEALYZER_RECORDER == 1)\r
\r
+#include <stdio.h>\r
+#include <stdarg.h>\r
+\r
typedef struct{\r
uint16_t EventID;\r
uint16_t EventCount;\r
/* The number of events stored. Used as event sequence number. */\r
static uint32_t eventCounter = 0;\r
\r
-/* The user event channel for recorder warnings, defined in trcKernelPort.c */\r
-extern char* trcWarningChannel;\r
-\r
/* Remembers if an earlier ISR in a sequence of adjacent ISRs has triggered a task switch.\r
In that case, vTraceStoreISREnd does not store a return to the previously executing task. */\r
int32_t isPendingContextSwitch = 0;\r
prvTraceStoreSimpleStringEventHelper(chn, str);\r
}\r
\r
+\r
+/*******************************************************************************\r
+* vTraceConsoleChannelPrintF\r
+*\r
+* Wrapper for vTracePrint, using the default channel. Can be used as a drop-in\r
+* replacement for printf and similar functions, e.g. in a debug logging macro.\r
+*\r
+* Example:\r
+*\r
+* // Old: #define LogString debug_console_printf\r
+*\r
+* // New, log to Tracealyzer instead:\r
+* #define LogString vTraceConsoleChannelPrintF\r
+* ...\r
+* LogString("My value is: %d", myValue);\r
+******************************************************************************/\r
+void vTraceConsoleChannelPrintF(const char* fmt, ...)\r
+{\r
+ va_list vl;\r
+ char tempBuf[60];\r
+ static traceString consoleChannel = NULL;\r
+\r
+ if (consoleChannel == NULL)\r
+ consoleChannel = xTraceRegisterString("Debug Console");\r
+\r
+ va_start(vl, fmt);\r
+ vsnprintf(tempBuf, 60, fmt, vl);\r
+ vTracePrint(consoleChannel, tempBuf);\r
+ va_end(vl);\r
+}\r
+\r
/******************************************************************************\r
* vTracePrintF\r
*\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v3.1.2\r
+ * Trace Recorder Library for Tracealyzer v4.1.4\r
* Percepio AB, www.percepio.com\r
*\r
* trcConfig.h\r
*\r
* Tabs are used for indent in this file (1 tab = 4 spaces)\r
*\r
- * Copyright Percepio AB, 2016.\r
+ * Copyright Percepio AB, 2018.\r
* www.percepio.com\r
******************************************************************************/\r
\r
* trace recorder library with an older version of FreeRTOS).\r
*\r
* TRC_FREERTOS_VERSION_7_3 If using FreeRTOS v7.3.x\r
- * TRC_FREERTOS_VERSION_7_4 If using FreeRTOS v7.4.x \r
+ * TRC_FREERTOS_VERSION_7_4 If using FreeRTOS v7.4.x\r
* TRC_FREERTOS_VERSION_7_5_OR_7_6 If using FreeRTOS v7.5.0 - v7.6.0\r
* TRC_FREERTOS_VERSION_8_X If using FreeRTOS v8.X.X\r
* TRC_FREERTOS_VERSION_9_0_0 If using FreeRTOS v9.0.0\r
*\r
* Macro which should be defined as either zero (0) or one (1).\r
*\r
- * If this is zero (0), all code related to User Events is excluded in order \r
+ * If this is zero (0), all code related to User Events is excluded in order\r
* to reduce code size. Any attempts of storing User Events are then silently\r
* ignored.\r
*\r
- * User Events are application-generated events, like "printf" but for the \r
- * trace log, generated using vTracePrint and vTracePrintF. \r
- * The formatting is done on host-side, by Tracealyzer. User Events are \r
+ * User Events are application-generated events, like "printf" but for the\r
+ * trace log, generated using vTracePrint and vTracePrintF.\r
+ * The formatting is done on host-side, by Tracealyzer. User Events are\r
* therefore much faster than a console printf and can often be used\r
* in timing critical code without problems.\r
*\r
*\r
* Macro which should be defined as either zero (0) or one (1).\r
*\r
- * If this is zero (0), the trace will exclude any "pending function call" \r
+ * If this is zero (0), the trace will exclude any "pending function call"\r
* events, such as xTimerPendFunctionCall().\r
*\r
* Default value is 0 since dependent on timers.c\r
/*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v3.1.2\r
+ * Trace Recorder Library for Tracealyzer v4.1.4\r
* Percepio AB, www.percepio.com\r
*\r
* trcSnapshotConfig.h\r
*\r
* Tabs are used for indent in this file (1 tab = 4 spaces)\r
*\r
- * Copyright Percepio AB, 2017.\r
+ * Copyright Percepio AB, 2018.\r
* www.percepio.com\r
******************************************************************************/\r
\r
#define TRC_CFG_NMUTEX 90\r
#define TRC_CFG_NTIMER 250\r
#define TRC_CFG_NEVENTGROUP 90\r
-#define TRC_CFG_NSTREAMBUFFER 5\r
-#define TRC_CFG_NMESSAGEBUFFER 5\r
+#define TRC_CFG_NSTREAMBUFFER 50\r
+#define TRC_CFG_NMESSAGEBUFFER 50\r
\r
\r
/******************************************************************************\r
*\r
* 1 tab == 4 spaces!\r
*/\r
-\r
-\r
#ifndef FREERTOS_CONFIG_H\r
#define FREERTOS_CONFIG_H\r
\r
\r
/* Allows tests of trying to allocate more than the heap has free. */\r
#define configUSE_MALLOC_FAILED_HOOK 0\r
+\r
+ /* To test builds that remove the static qualifier for debug builds. */\r
+ #define portREMOVE_STATIC_QUALIFIER\r
#else\r
/* It is a good idea to define configASSERT() while developing. configASSERT()\r
uses the same semantics as the standard C assert() macro. Don't define\r
* reference the subject timer in calls to other software timer API functions\r
* (for example, xTimerStart(), xTimerReset(), etc.).\r
*/\r
-struct TimerDef_t;\r
-typedef struct TimerDef_t * TimerHandle_t;\r
+struct tmrTimerControl;\r
+typedef struct tmrTimerControl * TimerHandle_t;\r
\r
/*\r
* Defines the prototype to which timer callback functions must conform.\r
accessed from a critical section. */\r
PRIVILEGED_DATA static volatile UBaseType_t uxSchedulerSuspended = ( UBaseType_t ) pdFALSE;\r
\r
+#if ( configGENERATE_RUN_TIME_STATS == 1 )\r
+\r
+ PRIVILEGED_DATA static uint32_t ulTaskSwitchedInTime = 0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */\r
+ PRIVILEGED_DATA static uint32_t ulTotalRunTime = 0UL; /*< Holds the total amount of execution time as defined by the run time counter clock. */\r
+\r
+#endif\r
+\r
/*lint -restore */\r
\r
/*-----------------------------------------------------------*/\r
\r
#if ( configGENERATE_RUN_TIME_STATS == 1 )\r
{\r
- PRIVILEGED_DATA static uint32_t ulTaskSwitchedInTime = 0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */\r
- PRIVILEGED_DATA static uint32_t ulTotalRunTime = 0UL; /*< Holds the total amount of execution time as defined by the run time counter clock. */\r
-\r
#ifdef portALT_GET_RUN_TIME_COUNTER_VALUE\r
portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalRunTime );\r
#else\r
#endif\r
\r
/* The definition of the timers themselves. */\r
-typedef struct TimerDef_t\r
+typedef struct tmrTimerControl\r
{\r
const char *pcTimerName; /*<< Text name. This is not used by the kernel, it is included simply to make debugging easier. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
ListItem_t xTimerListItem; /*<< Standard linked list item as used by all kernel features for event management. */\r