Update trace recorder code to the latest.

Some minor changes to enable the configREMOVE_STATIC_QUALIFIER constant to be used by those debuggers that cannot cope with statics being used.
This commit is contained in:
Richard Barry 2018-09-06 03:23:03 +00:00
parent 21a8ff35dd
commit be9c0730c3
25 changed files with 370 additions and 270 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcHardwarePort.h * trcHardwarePort.h

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* Terms of Use * Terms of Use
@ -357,8 +357,14 @@ void prvTraceSetStreamBufferNumberHigh16(void* handle, uint16_t value);
#define TRACE_GET_STREAMBUFFER_FILTER(pxObject) prvTraceGetStreamBufferNumberHigh16((void*)pxObject) #define TRACE_GET_STREAMBUFFER_FILTER(pxObject) prvTraceGetStreamBufferNumberHigh16((void*)pxObject)
#define TRACE_SET_STREAMBUFFER_FILTER(pxObject, group) prvTraceSetStreamBufferNumberHigh16((void*)pxObject, group) #define TRACE_SET_STREAMBUFFER_FILTER(pxObject, group) prvTraceSetStreamBufferNumberHigh16((void*)pxObject, group)
/* We can only support filtering if FreeRTOS is at least v7.4 */
#if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_4)
#define TRACE_GET_OBJECT_FILTER(CLASS, pxObject) TRACE_GET_##CLASS##_FILTER(pxObject) #define TRACE_GET_OBJECT_FILTER(CLASS, pxObject) TRACE_GET_##CLASS##_FILTER(pxObject)
#define TRACE_SET_OBJECT_FILTER(CLASS, pxObject, group) TRACE_SET_##CLASS##_FILTER(pxObject, group) #define TRACE_SET_OBJECT_FILTER(CLASS, pxObject, group) TRACE_SET_##CLASS##_FILTER(pxObject, group)
#else /* (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_4) */
#define TRACE_GET_OBJECT_FILTER(CLASS, pxObject) 1
#define TRACE_SET_OBJECT_FILTER(CLASS, pxObject, group)
#endif /* (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_4) */
/******************************************************************************/ /******************************************************************************/
/*** Definitions for Snapshot mode ********************************************/ /*** Definitions for Snapshot mode ********************************************/
@ -1262,7 +1268,7 @@ extern void vTraceStoreMemMangEvent(uint32_t ecode, uint32_t address, int32_t si
#undef traceTASK_NOTIFY_WAIT #undef traceTASK_NOTIFY_WAIT
#if (TRC_CFG_FREERTOS_VERSION < TRC_FREERTOS_VERSION_9_0_0) #if (TRC_CFG_FREERTOS_VERSION < TRC_FREERTOS_VERSION_9_0_0)
#define traceTASK_NOTIFY_WAIT() \ #define traceTASK_NOTIFY_WAIT() \
if (TRACE_GET_TASK_FILTER(pxCurrentTCB) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxCurrentTCB) & CurrentFilterMask) \
{ \ { \
if (pxCurrentTCB->eNotifyState == eNotified) \ if (pxCurrentTCB->eNotifyState == eNotified) \
prvTraceStoreKernelCallWithParam(TRACE_TASK_NOTIFY_WAIT, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxCurrentTCB), xTicksToWait); \ prvTraceStoreKernelCallWithParam(TRACE_TASK_NOTIFY_WAIT, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxCurrentTCB), xTicksToWait); \
@ -1271,7 +1277,7 @@ extern void vTraceStoreMemMangEvent(uint32_t ecode, uint32_t address, int32_t si
} }
#else /* TRC_CFG_FREERTOS_VERSION < TRC_FREERTOS_VERSION_9_0_0 */ #else /* TRC_CFG_FREERTOS_VERSION < TRC_FREERTOS_VERSION_9_0_0 */
#define traceTASK_NOTIFY_WAIT() \ #define traceTASK_NOTIFY_WAIT() \
if (TRACE_GET_TASK_FILTER(pxCurrentTCB) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxCurrentTCB) & CurrentFilterMask) \
{ \ { \
if (pxCurrentTCB->ucNotifyState == taskNOTIFICATION_RECEIVED) \ if (pxCurrentTCB->ucNotifyState == taskNOTIFICATION_RECEIVED) \
prvTraceStoreKernelCallWithParam(TRACE_TASK_NOTIFY_WAIT, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxCurrentTCB), xTicksToWait); \ prvTraceStoreKernelCallWithParam(TRACE_TASK_NOTIFY_WAIT, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxCurrentTCB), xTicksToWait); \
@ -1282,24 +1288,24 @@ extern void vTraceStoreMemMangEvent(uint32_t ecode, uint32_t address, int32_t si
#undef traceTASK_NOTIFY_WAIT_BLOCK #undef traceTASK_NOTIFY_WAIT_BLOCK
#define traceTASK_NOTIFY_WAIT_BLOCK() \ #define traceTASK_NOTIFY_WAIT_BLOCK() \
if (TRACE_GET_TASK_FILTER(pxCurrentTCB) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxCurrentTCB) & CurrentFilterMask) \
prvTraceStoreKernelCallWithParam(TRACE_TASK_NOTIFY_WAIT_TRCBLOCK, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxCurrentTCB), xTicksToWait); \ prvTraceStoreKernelCallWithParam(TRACE_TASK_NOTIFY_WAIT_TRCBLOCK, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxCurrentTCB), xTicksToWait); \
trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED(); trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED();
#undef traceTASK_NOTIFY #undef traceTASK_NOTIFY
#define traceTASK_NOTIFY() \ #define traceTASK_NOTIFY() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(xTaskToNotify) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, xTaskToNotify) & CurrentFilterMask) \
prvTraceStoreKernelCall(TRACE_TASK_NOTIFY, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(xTaskToNotify)); prvTraceStoreKernelCall(TRACE_TASK_NOTIFY, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(xTaskToNotify));
#undef traceTASK_NOTIFY_FROM_ISR #undef traceTASK_NOTIFY_FROM_ISR
#define traceTASK_NOTIFY_FROM_ISR() \ #define traceTASK_NOTIFY_FROM_ISR() \
if (TRACE_GET_TASK_FILTER(xTaskToNotify) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, xTaskToNotify) & CurrentFilterMask) \
prvTraceStoreKernelCall(TRACE_TASK_NOTIFY_FROM_ISR, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(xTaskToNotify)); prvTraceStoreKernelCall(TRACE_TASK_NOTIFY_FROM_ISR, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(xTaskToNotify));
#undef traceTASK_NOTIFY_GIVE_FROM_ISR #undef traceTASK_NOTIFY_GIVE_FROM_ISR
#define traceTASK_NOTIFY_GIVE_FROM_ISR() \ #define traceTASK_NOTIFY_GIVE_FROM_ISR() \
if (TRACE_GET_TASK_FILTER(xTaskToNotify) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, xTaskToNotify) & CurrentFilterMask) \
prvTraceStoreKernelCall(TRACE_TASK_NOTIFY_GIVE_FROM_ISR, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(xTaskToNotify)); prvTraceStoreKernelCall(TRACE_TASK_NOTIFY_GIVE_FROM_ISR, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(xTaskToNotify));
#if (TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS == 1) #if (TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS == 1)
@ -1311,12 +1317,10 @@ extern void vTraceStoreMemMangEvent(uint32_t ecode, uint32_t address, int32_t si
#undef traceSTREAM_BUFFER_CREATE_FAILED #undef traceSTREAM_BUFFER_CREATE_FAILED
#define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer ) \ #define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer ) \
trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_NUMERIC_PARAM_ONLY(TRACE_GET_CLASS_EVENT_CODE(CREATE_OBJ, TRCFAILED, STREAMBUFFER, xIsMessageBuffer), 0); trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_NUMERIC_PARAM_ONLY(TRACE_GET_CLASS_EVENT_CODE(CREATE_OBJ, TRCFAILED, STREAMBUFFER, xIsMessageBuffer), 0);
#if 0 /*_RB_ Not defined anywhere*/
#undef traceSTREAM_BUFFER_CREATE_STATIC_FAILED #undef traceSTREAM_BUFFER_CREATE_STATIC_FAILED
#define traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xIsMessageBuffer ) \ #define traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xIsMessageBuffer ) \
traceSTREAM_BUFFER_CREATE_TRCFAILED( xIsMessageBuffer ) traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer )
#endif
#undef traceSTREAM_BUFFER_DELETE #undef traceSTREAM_BUFFER_DELETE
#define traceSTREAM_BUFFER_DELETE( xStreamBuffer ) \ #define traceSTREAM_BUFFER_DELETE( xStreamBuffer ) \
@ -1639,7 +1643,7 @@ uint32_t prvIsNewTCB(void* pNewTCB);
/* Called on each task-switch */ /* Called on each task-switch */
#undef traceTASK_SWITCHED_IN #undef traceTASK_SWITCHED_IN
#define traceTASK_SWITCHED_IN() \ #define traceTASK_SWITCHED_IN() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
{ \ { \
if (prvIsNewTCB(pxCurrentTCB)) \ if (prvIsNewTCB(pxCurrentTCB)) \
{ \ { \
@ -1651,7 +1655,7 @@ uint32_t prvIsNewTCB(void* pNewTCB);
#if (TRC_CFG_INCLUDE_READY_EVENTS == 1) #if (TRC_CFG_INCLUDE_READY_EVENTS == 1)
#undef traceMOVED_TASK_TO_READY_STATE #undef traceMOVED_TASK_TO_READY_STATE
#define traceMOVED_TASK_TO_READY_STATE( pxTCB ) \ #define traceMOVED_TASK_TO_READY_STATE( pxTCB ) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
prvTraceStoreEvent1(PSF_EVENT_TASK_READY, (uint32_t)pxTCB); prvTraceStoreEvent1(PSF_EVENT_TASK_READY, (uint32_t)pxTCB);
#endif #endif
@ -1663,9 +1667,9 @@ uint32_t prvIsNewTCB(void* pNewTCB);
prvTraceSaveSymbol(pxNewTCB, pxNewTCB->pcTaskName); \ prvTraceSaveSymbol(pxNewTCB, pxNewTCB->pcTaskName); \
prvTraceSaveObjectData(pxNewTCB, pxNewTCB->uxPriority); \ prvTraceSaveObjectData(pxNewTCB, pxNewTCB->uxPriority); \
prvTraceStoreStringEvent(1, PSF_EVENT_OBJ_NAME, pxNewTCB->pcTaskName, pxNewTCB); \ prvTraceStoreStringEvent(1, PSF_EVENT_OBJ_NAME, pxNewTCB->pcTaskName, pxNewTCB); \
TRACE_SET_TASK_FILTER(pxNewTCB, CurrentFilterGroup); \ TRACE_SET_OBJECT_FILTER(TASK, pxNewTCB, CurrentFilterGroup); \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxNewTCB) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxNewTCB) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_TASK_CREATE, (uint32_t)pxNewTCB, pxNewTCB->uxPriority); \ prvTraceStoreEvent2(PSF_EVENT_TASK_CREATE, (uint32_t)pxNewTCB, pxNewTCB->uxPriority); \
} }
#else /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */ #else /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */
@ -1675,9 +1679,9 @@ uint32_t prvIsNewTCB(void* pNewTCB);
prvTraceSaveSymbol(pxNewTCB, (const char*)pcName); \ prvTraceSaveSymbol(pxNewTCB, (const char*)pcName); \
prvTraceSaveObjectData(pxNewTCB, uxPriority); \ prvTraceSaveObjectData(pxNewTCB, uxPriority); \
prvTraceStoreStringEvent(1, PSF_EVENT_OBJ_NAME, (const char*)pcName, pxNewTCB); \ prvTraceStoreStringEvent(1, PSF_EVENT_OBJ_NAME, (const char*)pcName, pxNewTCB); \
TRACE_SET_TASK_FILTER(pxNewTCB, CurrentFilterGroup); \ TRACE_SET_OBJECT_FILTER(TASK, pxNewTCB, CurrentFilterGroup); \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxNewTCB) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxNewTCB) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_TASK_CREATE, (uint32_t)pxNewTCB, uxPriority); \ prvTraceStoreEvent2(PSF_EVENT_TASK_CREATE, (uint32_t)pxNewTCB, uxPriority); \
} }
#endif /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */ #endif /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */
@ -1685,14 +1689,14 @@ uint32_t prvIsNewTCB(void* pNewTCB);
/* Called in vTaskCreate, if it fails (typically if the stack can not be allocated) */ /* Called in vTaskCreate, if it fails (typically if the stack can not be allocated) */
#undef traceTASK_CREATE_FAILED #undef traceTASK_CREATE_FAILED
#define traceTASK_CREATE_FAILED() \ #define traceTASK_CREATE_FAILED() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent0(PSF_EVENT_TASK_CREATE_FAILED); prvTraceStoreEvent0(PSF_EVENT_TASK_CREATE_FAILED);
/* Called on vTaskDelete */ /* Called on vTaskDelete */
#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. #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.
#define traceTASK_DELETE( pxTaskToDelete ) \ #define traceTASK_DELETE( pxTaskToDelete ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxTaskToDelete) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTaskToDelete) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_TASK_DELETE, (uint32_t)pxTaskToDelete, (pxTaskToDelete != NULL) ? (pxTaskToDelete->uxPriority) : 0); \ prvTraceStoreEvent2(PSF_EVENT_TASK_DELETE, (uint32_t)pxTaskToDelete, (pxTaskToDelete != NULL) ? (pxTaskToDelete->uxPriority) : 0); \
prvTraceDeleteSymbol(pxTaskToDelete); \ prvTraceDeleteSymbol(pxTaskToDelete); \
prvTraceDeleteObjectData(pxTaskToDelete); prvTraceDeleteObjectData(pxTaskToDelete);
@ -1718,25 +1722,25 @@ uint32_t prvIsNewTCB(void* pNewTCB);
/* Called on vTaskSuspend */ /* Called on vTaskSuspend */
#undef traceTASK_SUSPEND #undef traceTASK_SUSPEND
#define traceTASK_SUSPEND( pxTaskToSuspend ) \ #define traceTASK_SUSPEND( pxTaskToSuspend ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxTaskToSuspend) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTaskToSuspend) & CurrentFilterMask) \
prvTraceStoreEvent1(PSF_EVENT_TASK_SUSPEND, (uint32_t)pxTaskToSuspend); prvTraceStoreEvent1(PSF_EVENT_TASK_SUSPEND, (uint32_t)pxTaskToSuspend);
/* Called on vTaskDelay - note the use of FreeRTOS variable xTicksToDelay */ /* Called on vTaskDelay - note the use of FreeRTOS variable xTicksToDelay */
#undef traceTASK_DELAY #undef traceTASK_DELAY
#define traceTASK_DELAY() \ #define traceTASK_DELAY() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent1(PSF_EVENT_TASK_DELAY, xTicksToDelay); prvTraceStoreEvent1(PSF_EVENT_TASK_DELAY, xTicksToDelay);
/* Called on vTaskDelayUntil - note the use of FreeRTOS variable xTimeToWake */ /* Called on vTaskDelayUntil - note the use of FreeRTOS variable xTimeToWake */
#undef traceTASK_DELAY_UNTIL #undef traceTASK_DELAY_UNTIL
#if TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 #if TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0
#define traceTASK_DELAY_UNTIL(xTimeToWake) \ #define traceTASK_DELAY_UNTIL(xTimeToWake) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent1(PSF_EVENT_TASK_DELAY_UNTIL, (uint32_t)xTimeToWake); prvTraceStoreEvent1(PSF_EVENT_TASK_DELAY_UNTIL, (uint32_t)xTimeToWake);
#else /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */ #else /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */
#define traceTASK_DELAY_UNTIL() \ #define traceTASK_DELAY_UNTIL() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent1(PSF_EVENT_TASK_DELAY_UNTIL, (uint32_t)xTimeToWake); prvTraceStoreEvent1(PSF_EVENT_TASK_DELAY_UNTIL, (uint32_t)xTimeToWake);
#endif /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */ #endif /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */
@ -1756,7 +1760,7 @@ uint32_t prvIsNewTCB(void* pNewTCB);
#undef traceQUEUE_CREATE #undef traceQUEUE_CREATE
#define traceQUEUE_CREATE( pxNewQueue )\ #define traceQUEUE_CREATE( pxNewQueue )\
TRACE_SET_OBJECT_FILTER(QUEUE, pxNewQueue, CurrentFilterGroup); \ TRACE_SET_OBJECT_FILTER(QUEUE, pxNewQueue, CurrentFilterGroup); \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
{ \ { \
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxNewQueue) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, pxNewQueue) & CurrentFilterMask) \
{ \ { \
@ -1788,7 +1792,7 @@ uint32_t prvIsNewTCB(void* pNewTCB);
/* Called in xQueueCreate, if the queue creation fails */ /* Called in xQueueCreate, if the queue creation fails */
#undef traceQUEUE_CREATE_FAILED #undef traceQUEUE_CREATE_FAILED
#define traceQUEUE_CREATE_FAILED( queueType ) \ #define traceQUEUE_CREATE_FAILED( queueType ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
{ \ { \
switch (queueType) \ switch (queueType) \
{ \ { \
@ -1804,7 +1808,7 @@ uint32_t prvIsNewTCB(void* pNewTCB);
#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. #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.
#define traceQUEUE_DELETE( pxQueue ) \ #define traceQUEUE_DELETE( pxQueue ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
{ \ { \
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \
{ \ { \
@ -1831,25 +1835,25 @@ uint32_t prvIsNewTCB(void* pNewTCB);
#if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_8_X) #if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_8_X)
#define traceCREATE_COUNTING_SEMAPHORE() \ #define traceCREATE_COUNTING_SEMAPHORE() \
TRACE_SET_OBJECT_FILTER(QUEUE, xHandle, CurrentFilterGroup); \ TRACE_SET_OBJECT_FILTER(QUEUE, xHandle, CurrentFilterGroup); \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(QUEUE, xHandle) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, xHandle) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE, (uint32_t)xHandle, uxMaxCount) prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE, (uint32_t)xHandle, uxMaxCount)
#elif (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_5_OR_7_6) #elif (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_5_OR_7_6)
#define traceCREATE_COUNTING_SEMAPHORE() \ #define traceCREATE_COUNTING_SEMAPHORE() \
TRACE_SET_OBJECT_FILTER(QUEUE, xHandle, CurrentFilterGroup); \ TRACE_SET_OBJECT_FILTER(QUEUE, xHandle, CurrentFilterGroup); \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(QUEUE, xHandle) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, xHandle) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE, (uint32_t)xHandle, uxInitialCount); prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE, (uint32_t)xHandle, uxInitialCount);
#elif (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_4) #elif (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_4)
#define traceCREATE_COUNTING_SEMAPHORE() \ #define traceCREATE_COUNTING_SEMAPHORE() \
TRACE_SET_OBJECT_FILTER(QUEUE, xHandle, CurrentFilterGroup); \ TRACE_SET_OBJECT_FILTER(QUEUE, xHandle, CurrentFilterGroup); \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(QUEUE, xHandle) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, xHandle) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE, (uint32_t)xHandle, uxCountValue); prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE, (uint32_t)xHandle, uxCountValue);
#else #else
#define traceCREATE_COUNTING_SEMAPHORE() \ #define traceCREATE_COUNTING_SEMAPHORE() \
TRACE_SET_OBJECT_FILTER(QUEUE, pxHandle, CurrentFilterGroup); \ TRACE_SET_OBJECT_FILTER(QUEUE, pxHandle, CurrentFilterGroup); \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxHandle) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, pxHandle) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE, (uint32_t)pxHandle, uxCountValue); prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE, (uint32_t)pxHandle, uxCountValue);
#endif /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_8_X */ #endif /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_8_X */
@ -1857,19 +1861,19 @@ uint32_t prvIsNewTCB(void* pNewTCB);
#undef traceCREATE_COUNTING_SEMAPHORE_FAILED #undef traceCREATE_COUNTING_SEMAPHORE_FAILED
#if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_8_X) #if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_8_X)
#define traceCREATE_COUNTING_SEMAPHORE_FAILED() \ #define traceCREATE_COUNTING_SEMAPHORE_FAILED() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE_FAILED, 0, uxMaxCount); prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE_FAILED, 0, uxMaxCount);
#elif (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_5_OR_7_6) #elif (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_5_OR_7_6)
#define traceCREATE_COUNTING_SEMAPHORE_FAILED() \ #define traceCREATE_COUNTING_SEMAPHORE_FAILED() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE_FAILED, 0, uxInitialCount); prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE_FAILED, 0, uxInitialCount);
#elif (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_4) #elif (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_7_4)
#define traceCREATE_COUNTING_SEMAPHORE_FAILED() \ #define traceCREATE_COUNTING_SEMAPHORE_FAILED() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE_FAILED, 0, uxCountValue); prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE_FAILED, 0, uxCountValue);
#else #else
#define traceCREATE_COUNTING_SEMAPHORE_FAILED() \ #define traceCREATE_COUNTING_SEMAPHORE_FAILED() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE_FAILED, 0, uxCountValue); prvTraceStoreEvent2(PSF_EVENT_SEMAPHORE_COUNTING_CREATE_FAILED, 0, uxCountValue);
#endif /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_8_X */ #endif /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_8_X */
@ -1880,7 +1884,7 @@ uint32_t prvIsNewTCB(void* pNewTCB);
#undef traceCREATE_MUTEX #undef traceCREATE_MUTEX
#define traceCREATE_MUTEX( pxNewQueue ) \ #define traceCREATE_MUTEX( pxNewQueue ) \
TRACE_SET_OBJECT_FILTER(QUEUE, pxNewQueue, CurrentFilterGroup); \ TRACE_SET_OBJECT_FILTER(QUEUE, pxNewQueue, CurrentFilterGroup); \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
{ \ { \
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxNewQueue) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, pxNewQueue) & CurrentFilterMask) \
{ \ { \
@ -1899,14 +1903,14 @@ uint32_t prvIsNewTCB(void* pNewTCB);
/* Called in xQueueCreateMutex when the operation fails (when memory allocation fails) */ /* Called in xQueueCreateMutex when the operation fails (when memory allocation fails) */
#undef traceCREATE_MUTEX_FAILED #undef traceCREATE_MUTEX_FAILED
#define traceCREATE_MUTEX_FAILED() \ #define traceCREATE_MUTEX_FAILED() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent1(PSF_EVENT_MUTEX_CREATE_FAILED, 0); prvTraceStoreEvent1(PSF_EVENT_MUTEX_CREATE_FAILED, 0);
#endif /* (TRC_CFG_FREERTOS_VERSION < TRC_FREERTOS_VERSION_9_0_0) */ #endif /* (TRC_CFG_FREERTOS_VERSION < TRC_FREERTOS_VERSION_9_0_0) */
/* Called when a message is sent to a queue */ /* CS IS NEW ! */ /* Called when a message is sent to a queue */ /* CS IS NEW ! */
#undef traceQUEUE_SEND #undef traceQUEUE_SEND
#define traceQUEUE_SEND( pxQueue ) \ #define traceQUEUE_SEND( pxQueue ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \
switch (pxQueue->ucQueueType) \ switch (pxQueue->ucQueueType) \
{ \ { \
@ -1926,7 +1930,7 @@ uint32_t prvIsNewTCB(void* pNewTCB);
/* Called when a message failed to be sent to a queue (timeout) */ /* Called when a message failed to be sent to a queue (timeout) */
#undef traceQUEUE_SEND_FAILED #undef traceQUEUE_SEND_FAILED
#define traceQUEUE_SEND_FAILED( pxQueue ) \ #define traceQUEUE_SEND_FAILED( pxQueue ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \
switch (pxQueue->ucQueueType) \ switch (pxQueue->ucQueueType) \
{ \ { \
@ -1946,7 +1950,7 @@ uint32_t prvIsNewTCB(void* pNewTCB);
/* Called when the task is blocked due to a send operation on a full queue */ /* Called when the task is blocked due to a send operation on a full queue */
#undef traceBLOCKING_ON_QUEUE_SEND #undef traceBLOCKING_ON_QUEUE_SEND
#define traceBLOCKING_ON_QUEUE_SEND( pxQueue ) \ #define traceBLOCKING_ON_QUEUE_SEND( pxQueue ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \
switch (pxQueue->ucQueueType) \ switch (pxQueue->ucQueueType) \
{ \ { \
@ -2018,7 +2022,7 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
/* Called when a message is received from a queue */ /* Called when a message is received from a queue */
#undef traceQUEUE_RECEIVE #undef traceQUEUE_RECEIVE
#define traceQUEUE_RECEIVE( pxQueue ) \ #define traceQUEUE_RECEIVE( pxQueue ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \
switch (pxQueue->ucQueueType) \ switch (pxQueue->ucQueueType) \
{ \ { \
@ -2047,7 +2051,7 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
/* Called when a receive operation on a queue fails (timeout) */ /* Called when a receive operation on a queue fails (timeout) */
#undef traceQUEUE_RECEIVE_FAILED #undef traceQUEUE_RECEIVE_FAILED
#define traceQUEUE_RECEIVE_FAILED( pxQueue ) \ #define traceQUEUE_RECEIVE_FAILED( pxQueue ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \
switch (pxQueue->ucQueueType) \ switch (pxQueue->ucQueueType) \
{ \ { \
@ -2067,7 +2071,7 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
/* Called when the task is blocked due to a receive operation on an empty queue */ /* Called when the task is blocked due to a receive operation on an empty queue */
#undef traceBLOCKING_ON_QUEUE_RECEIVE #undef traceBLOCKING_ON_QUEUE_RECEIVE
#define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue ) \ #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \
switch (pxQueue->ucQueueType) \ switch (pxQueue->ucQueueType) \
{ \ { \
@ -2088,7 +2092,7 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
/* Called when a peek operation on a queue fails (timeout) */ /* Called when a peek operation on a queue fails (timeout) */
#undef traceQUEUE_PEEK_FAILED #undef traceQUEUE_PEEK_FAILED
#define traceQUEUE_PEEK_FAILED( pxQueue ) \ #define traceQUEUE_PEEK_FAILED( pxQueue ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \
switch (pxQueue->ucQueueType) \ switch (pxQueue->ucQueueType) \
{ \ { \
@ -2108,7 +2112,7 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
/* Called when the task is blocked due to a peek operation on an empty queue */ /* Called when the task is blocked due to a peek operation on an empty queue */
#undef traceBLOCKING_ON_QUEUE_PEEK #undef traceBLOCKING_ON_QUEUE_PEEK
#define traceBLOCKING_ON_QUEUE_PEEK( pxQueue ) \ #define traceBLOCKING_ON_QUEUE_PEEK( pxQueue ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \
switch (pxQueue->ucQueueType) \ switch (pxQueue->ucQueueType) \
{ \ { \
@ -2160,7 +2164,7 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
/* Called on xQueuePeek */ /* Called on xQueuePeek */
#undef traceQUEUE_PEEK #undef traceQUEUE_PEEK
#define traceQUEUE_PEEK( pxQueue ) \ #define traceQUEUE_PEEK( pxQueue ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(QUEUE, pxQueue) & CurrentFilterMask) \
switch (pxQueue->ucQueueType) \ switch (pxQueue->ucQueueType) \
{ \ { \
@ -2181,47 +2185,47 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
#undef traceTASK_PRIORITY_SET #undef traceTASK_PRIORITY_SET
#define traceTASK_PRIORITY_SET( pxTask, uxNewPriority ) \ #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority ) \
prvTraceSaveObjectData(pxTask, uxNewPriority); \ prvTraceSaveObjectData(pxTask, uxNewPriority); \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxTask) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTask) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_TASK_PRIORITY, (uint32_t)pxTask, uxNewPriority); prvTraceStoreEvent2(PSF_EVENT_TASK_PRIORITY, (uint32_t)pxTask, uxNewPriority);
/* Called in vTaskPriorityInherit, which is called by Mutex operations */ /* Called in vTaskPriorityInherit, which is called by Mutex operations */
#undef traceTASK_PRIORITY_INHERIT #undef traceTASK_PRIORITY_INHERIT
#define traceTASK_PRIORITY_INHERIT( pxTask, uxNewPriority ) \ #define traceTASK_PRIORITY_INHERIT( pxTask, uxNewPriority ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxTask) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTask) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_TASK_PRIO_INHERIT, (uint32_t)pxTask, uxNewPriority); prvTraceStoreEvent2(PSF_EVENT_TASK_PRIO_INHERIT, (uint32_t)pxTask, uxNewPriority);
/* Called in vTaskPriorityDisinherit, which is called by Mutex operations */ /* Called in vTaskPriorityDisinherit, which is called by Mutex operations */
#undef traceTASK_PRIORITY_DISINHERIT #undef traceTASK_PRIORITY_DISINHERIT
#define traceTASK_PRIORITY_DISINHERIT( pxTask, uxNewPriority ) \ #define traceTASK_PRIORITY_DISINHERIT( pxTask, uxNewPriority ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxTask) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTask) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_TASK_PRIO_DISINHERIT, (uint32_t)pxTask, uxNewPriority); prvTraceStoreEvent2(PSF_EVENT_TASK_PRIO_DISINHERIT, (uint32_t)pxTask, uxNewPriority);
/* Called in vTaskResume */ /* Called in vTaskResume */
#undef traceTASK_RESUME #undef traceTASK_RESUME
#define traceTASK_RESUME( pxTaskToResume ) \ #define traceTASK_RESUME( pxTaskToResume ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxTaskToResume) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTaskToResume) & CurrentFilterMask) \
prvTraceStoreEvent1(PSF_EVENT_TASK_RESUME, (uint32_t)pxTaskToResume); prvTraceStoreEvent1(PSF_EVENT_TASK_RESUME, (uint32_t)pxTaskToResume);
/* Called in vTaskResumeFromISR */ /* Called in vTaskResumeFromISR */
#undef traceTASK_RESUME_FROM_ISR #undef traceTASK_RESUME_FROM_ISR
#define traceTASK_RESUME_FROM_ISR( pxTaskToResume ) \ #define traceTASK_RESUME_FROM_ISR( pxTaskToResume ) \
if (TRACE_GET_TASK_FILTER(pxTaskToResume) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTaskToResume) & CurrentFilterMask) \
prvTraceStoreEvent1(PSF_EVENT_TASK_RESUME_FROMISR, (uint32_t)pxTaskToResume); prvTraceStoreEvent1(PSF_EVENT_TASK_RESUME_FROMISR, (uint32_t)pxTaskToResume);
#if (TRC_CFG_INCLUDE_MEMMANG_EVENTS == 1) #if (TRC_CFG_INCLUDE_MEMMANG_EVENTS == 1)
#undef traceMALLOC #undef traceMALLOC
#define traceMALLOC( pvAddress, uiSize ) \ #define traceMALLOC( pvAddress, uiSize ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_MALLOC, (uint32_t)pvAddress, uiSize); prvTraceStoreEvent2(PSF_EVENT_MALLOC, (uint32_t)pvAddress, uiSize);
#undef traceFREE #undef traceFREE
#define traceFREE( pvAddress, uiSize ) \ #define traceFREE( pvAddress, uiSize ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_FREE, (uint32_t)pvAddress, (uint32_t)(0 - uiSize)); /* "0 -" instead of just "-" to get rid of a warning... */ prvTraceStoreEvent2(PSF_EVENT_FREE, (uint32_t)pvAddress, (uint32_t)(0 - uiSize)); /* "0 -" instead of just "-" to get rid of a warning... */
#endif /* (TRC_CFG_INCLUDE_MEMMANG_EVENTS == 1) */ #endif /* (TRC_CFG_INCLUDE_MEMMANG_EVENTS == 1) */
@ -2234,13 +2238,13 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
TRACE_SET_OBJECT_FILTER(TIMER, tmr, CurrentFilterGroup); \ TRACE_SET_OBJECT_FILTER(TIMER, tmr, CurrentFilterGroup); \
prvTraceSaveSymbol(tmr, tmr->pcTimerName); \ prvTraceSaveSymbol(tmr, tmr->pcTimerName); \
prvTraceStoreStringEvent(1, PSF_EVENT_OBJ_NAME, tmr->pcTimerName, tmr); \ prvTraceStoreStringEvent(1, PSF_EVENT_OBJ_NAME, tmr->pcTimerName, tmr); \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TIMER, tmr) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TIMER, tmr) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_TIMER_CREATE, (uint32_t)tmr, tmr->xTimerPeriodInTicks); prvTraceStoreEvent2(PSF_EVENT_TIMER_CREATE, (uint32_t)tmr, tmr->xTimerPeriodInTicks);
#undef traceTIMER_CREATE_FAILED #undef traceTIMER_CREATE_FAILED
#define traceTIMER_CREATE_FAILED() \ #define traceTIMER_CREATE_FAILED() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent0(PSF_EVENT_TIMER_CREATE_FAILED); prvTraceStoreEvent0(PSF_EVENT_TIMER_CREATE_FAILED);
#if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_8_X) #if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_8_X)
@ -2267,7 +2271,7 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
/* Note that xCommandID can never be tmrCOMMAND_EXECUTE_CALLBACK (-1) since the trace macro is not called in that case */ /* Note that xCommandID can never be tmrCOMMAND_EXECUTE_CALLBACK (-1) since the trace macro is not called in that case */
#undef traceTIMER_COMMAND_SEND #undef traceTIMER_COMMAND_SEND
#define traceTIMER_COMMAND_SEND(tmr, xCommandID, xOptionalValue, xReturn) \ #define traceTIMER_COMMAND_SEND(tmr, xCommandID, xOptionalValue, xReturn) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TIMER, tmr) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TIMER, tmr) & CurrentFilterMask) \
switch(xCommandID) \ switch(xCommandID) \
{ \ { \
@ -2288,7 +2292,7 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
#undef traceTIMER_EXPIRED #undef traceTIMER_EXPIRED
#define traceTIMER_EXPIRED(tmr) \ #define traceTIMER_EXPIRED(tmr) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(TIMER, tmr) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TIMER, tmr) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_TIMER_EXPIRED, (uint32_t)tmr->pxCallbackFunction, (uint32_t)tmr->pvTimerID); prvTraceStoreEvent2(PSF_EVENT_TIMER_EXPIRED, (uint32_t)tmr->pxCallbackFunction, (uint32_t)tmr->pvTimerID);
@ -2312,49 +2316,49 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
#undef traceEVENT_GROUP_CREATE #undef traceEVENT_GROUP_CREATE
#define traceEVENT_GROUP_CREATE(eg) \ #define traceEVENT_GROUP_CREATE(eg) \
TRACE_SET_OBJECT_FILTER(EVENTGROUP, eg, CurrentFilterGroup); \ TRACE_SET_OBJECT_FILTER(EVENTGROUP, eg, CurrentFilterGroup); \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \
prvTraceStoreEvent1(PSF_EVENT_EVENTGROUP_CREATE, (uint32_t)eg); prvTraceStoreEvent1(PSF_EVENT_EVENTGROUP_CREATE, (uint32_t)eg);
#undef traceEVENT_GROUP_DELETE #undef traceEVENT_GROUP_DELETE
#define traceEVENT_GROUP_DELETE(eg) \ #define traceEVENT_GROUP_DELETE(eg) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \
prvTraceStoreEvent1(PSF_EVENT_EVENTGROUP_DELETE, (uint32_t)eg); \ prvTraceStoreEvent1(PSF_EVENT_EVENTGROUP_DELETE, (uint32_t)eg); \
prvTraceDeleteSymbol(eg); prvTraceDeleteSymbol(eg);
#undef traceEVENT_GROUP_CREATE_FAILED #undef traceEVENT_GROUP_CREATE_FAILED
#define traceEVENT_GROUP_CREATE_FAILED() \ #define traceEVENT_GROUP_CREATE_FAILED() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent0(PSF_EVENT_EVENTGROUP_CREATE_FAILED); prvTraceStoreEvent0(PSF_EVENT_EVENTGROUP_CREATE_FAILED);
#undef traceEVENT_GROUP_SYNC_BLOCK #undef traceEVENT_GROUP_SYNC_BLOCK
#define traceEVENT_GROUP_SYNC_BLOCK(eg, bitsToSet, bitsToWaitFor) \ #define traceEVENT_GROUP_SYNC_BLOCK(eg, bitsToSet, bitsToWaitFor) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_EVENTGROUP_SYNC_BLOCK, (uint32_t)eg, bitsToWaitFor); prvTraceStoreEvent2(PSF_EVENT_EVENTGROUP_SYNC_BLOCK, (uint32_t)eg, bitsToWaitFor);
#undef traceEVENT_GROUP_SYNC_END #undef traceEVENT_GROUP_SYNC_END
#define traceEVENT_GROUP_SYNC_END(eg, bitsToSet, bitsToWaitFor, wasTimeout) \ #define traceEVENT_GROUP_SYNC_END(eg, bitsToSet, bitsToWaitFor, wasTimeout) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \
prvTraceStoreEvent2((wasTimeout != pdTRUE) ? PSF_EVENT_EVENTGROUP_SYNC : PSF_EVENT_EVENTGROUP_SYNC_FAILED, (uint32_t)eg, bitsToWaitFor); prvTraceStoreEvent2((wasTimeout != pdTRUE) ? PSF_EVENT_EVENTGROUP_SYNC : PSF_EVENT_EVENTGROUP_SYNC_FAILED, (uint32_t)eg, bitsToWaitFor);
#undef traceEVENT_GROUP_WAIT_BITS_BLOCK #undef traceEVENT_GROUP_WAIT_BITS_BLOCK
#define traceEVENT_GROUP_WAIT_BITS_BLOCK(eg, bitsToWaitFor) \ #define traceEVENT_GROUP_WAIT_BITS_BLOCK(eg, bitsToWaitFor) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_EVENTGROUP_WAITBITS_BLOCK, (uint32_t)eg, bitsToWaitFor); prvTraceStoreEvent2(PSF_EVENT_EVENTGROUP_WAITBITS_BLOCK, (uint32_t)eg, bitsToWaitFor);
#undef traceEVENT_GROUP_WAIT_BITS_END #undef traceEVENT_GROUP_WAIT_BITS_END
#define traceEVENT_GROUP_WAIT_BITS_END(eg, bitsToWaitFor, wasTimeout) \ #define traceEVENT_GROUP_WAIT_BITS_END(eg, bitsToWaitFor, wasTimeout) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \
prvTraceStoreEvent2((wasTimeout != pdTRUE) ? PSF_EVENT_EVENTGROUP_WAITBITS : PSF_EVENT_EVENTGROUP_WAITBITS_FAILED, (uint32_t)eg, bitsToWaitFor); prvTraceStoreEvent2((wasTimeout != pdTRUE) ? PSF_EVENT_EVENTGROUP_WAITBITS : PSF_EVENT_EVENTGROUP_WAITBITS_FAILED, (uint32_t)eg, bitsToWaitFor);
#undef traceEVENT_GROUP_CLEAR_BITS #undef traceEVENT_GROUP_CLEAR_BITS
#define traceEVENT_GROUP_CLEAR_BITS(eg, bitsToClear) \ #define traceEVENT_GROUP_CLEAR_BITS(eg, bitsToClear) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_EVENTGROUP_CLEARBITS, (uint32_t)eg, bitsToClear); prvTraceStoreEvent2(PSF_EVENT_EVENTGROUP_CLEARBITS, (uint32_t)eg, bitsToClear);
@ -2365,7 +2369,7 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
#undef traceEVENT_GROUP_SET_BITS #undef traceEVENT_GROUP_SET_BITS
#define traceEVENT_GROUP_SET_BITS(eg, bitsToSet) \ #define traceEVENT_GROUP_SET_BITS(eg, bitsToSet) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(EVENTGROUP, eg) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_EVENTGROUP_SETBITS, (uint32_t)eg, bitsToSet); prvTraceStoreEvent2(PSF_EVENT_EVENTGROUP_SETBITS, (uint32_t)eg, bitsToSet);
@ -2379,14 +2383,14 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
#undef traceTASK_NOTIFY_TAKE #undef traceTASK_NOTIFY_TAKE
#if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0) #if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0)
#define traceTASK_NOTIFY_TAKE() \ #define traceTASK_NOTIFY_TAKE() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \
if (pxCurrentTCB->ucNotifyState == taskNOTIFICATION_RECEIVED) \ if (pxCurrentTCB->ucNotifyState == taskNOTIFICATION_RECEIVED) \
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_TAKE, (uint32_t)pxCurrentTCB, xTicksToWait); \ prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_TAKE, (uint32_t)pxCurrentTCB, xTicksToWait); \
else \ else \
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_TAKE_FAILED, (uint32_t)pxCurrentTCB, xTicksToWait);} prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_TAKE_FAILED, (uint32_t)pxCurrentTCB, xTicksToWait);}
#else /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */ #else /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */
#define traceTASK_NOTIFY_TAKE() \ #define traceTASK_NOTIFY_TAKE() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \
if (pxCurrentTCB->eNotifyState == eNotified) \ if (pxCurrentTCB->eNotifyState == eNotified) \
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_TAKE, (uint32_t)pxCurrentTCB, xTicksToWait); \ prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_TAKE, (uint32_t)pxCurrentTCB, xTicksToWait); \
else \ else \
@ -2395,20 +2399,20 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
#undef traceTASK_NOTIFY_TAKE_BLOCK #undef traceTASK_NOTIFY_TAKE_BLOCK
#define traceTASK_NOTIFY_TAKE_BLOCK() \ #define traceTASK_NOTIFY_TAKE_BLOCK() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_TAKE_BLOCK, (uint32_t)pxCurrentTCB, xTicksToWait); prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_TAKE_BLOCK, (uint32_t)pxCurrentTCB, xTicksToWait);
#undef traceTASK_NOTIFY_WAIT #undef traceTASK_NOTIFY_WAIT
#if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0) #if (TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0)
#define traceTASK_NOTIFY_WAIT() \ #define traceTASK_NOTIFY_WAIT() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \
if (pxCurrentTCB->ucNotifyState == taskNOTIFICATION_RECEIVED) \ if (pxCurrentTCB->ucNotifyState == taskNOTIFICATION_RECEIVED) \
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_WAIT, (uint32_t)pxCurrentTCB, xTicksToWait); \ prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_WAIT, (uint32_t)pxCurrentTCB, xTicksToWait); \
else \ else \
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_WAIT_FAILED, (uint32_t)pxCurrentTCB, xTicksToWait);} prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_WAIT_FAILED, (uint32_t)pxCurrentTCB, xTicksToWait);}
#else /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */ #else /* TRC_CFG_FREERTOS_VERSION >= TRC_FREERTOS_VERSION_9_0_0 */
#define traceTASK_NOTIFY_WAIT() \ #define traceTASK_NOTIFY_WAIT() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask){ \
if (pxCurrentTCB->eNotifyState == eNotified) \ if (pxCurrentTCB->eNotifyState == eNotified) \
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_WAIT, (uint32_t)pxCurrentTCB, xTicksToWait); \ prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_WAIT, (uint32_t)pxCurrentTCB, xTicksToWait); \
else \ else \
@ -2417,23 +2421,23 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
#undef traceTASK_NOTIFY_WAIT_BLOCK #undef traceTASK_NOTIFY_WAIT_BLOCK
#define traceTASK_NOTIFY_WAIT_BLOCK() \ #define traceTASK_NOTIFY_WAIT_BLOCK() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_WAIT_BLOCK, (uint32_t)pxCurrentTCB, xTicksToWait); prvTraceStoreEvent2(PSF_EVENT_TASK_NOTIFY_WAIT_BLOCK, (uint32_t)pxCurrentTCB, xTicksToWait);
#undef traceTASK_NOTIFY #undef traceTASK_NOTIFY
#define traceTASK_NOTIFY() \ #define traceTASK_NOTIFY() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(xTaskToNotify) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, xTaskToNotify) & CurrentFilterMask) \
prvTraceStoreEvent1(PSF_EVENT_TASK_NOTIFY, (uint32_t)xTaskToNotify); prvTraceStoreEvent1(PSF_EVENT_TASK_NOTIFY, (uint32_t)xTaskToNotify);
#undef traceTASK_NOTIFY_FROM_ISR #undef traceTASK_NOTIFY_FROM_ISR
#define traceTASK_NOTIFY_FROM_ISR() \ #define traceTASK_NOTIFY_FROM_ISR() \
if (TRACE_GET_TASK_FILTER(xTaskToNotify) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, xTaskToNotify) & CurrentFilterMask) \
prvTraceStoreEvent1(PSF_EVENT_TASK_NOTIFY_FROM_ISR, (uint32_t)xTaskToNotify); prvTraceStoreEvent1(PSF_EVENT_TASK_NOTIFY_FROM_ISR, (uint32_t)xTaskToNotify);
#undef traceTASK_NOTIFY_GIVE_FROM_ISR #undef traceTASK_NOTIFY_GIVE_FROM_ISR
#define traceTASK_NOTIFY_GIVE_FROM_ISR() \ #define traceTASK_NOTIFY_GIVE_FROM_ISR() \
if (TRACE_GET_TASK_FILTER(xTaskToNotify) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, xTaskToNotify) & CurrentFilterMask) \
prvTraceStoreEvent1(PSF_EVENT_TASK_NOTIFY_GIVE_FROM_ISR, (uint32_t)xTaskToNotify); prvTraceStoreEvent1(PSF_EVENT_TASK_NOTIFY_GIVE_FROM_ISR, (uint32_t)xTaskToNotify);
#undef traceQUEUE_REGISTRY_ADD #undef traceQUEUE_REGISTRY_ADD
@ -2446,13 +2450,13 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
#undef traceSTREAM_BUFFER_CREATE #undef traceSTREAM_BUFFER_CREATE
#define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer ) \ #define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer ) \
TRACE_SET_OBJECT_FILTER(STREAMBUFFER, pxStreamBuffer, CurrentFilterGroup); \ TRACE_SET_OBJECT_FILTER(STREAMBUFFER, pxStreamBuffer, CurrentFilterGroup); \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, pxStreamBuffer) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, pxStreamBuffer) & CurrentFilterMask) \
prvTraceStoreEvent2(xIsMessageBuffer == 1 ? PSF_EVENT_MESSAGEBUFFER_CREATE : PSF_EVENT_STREAMBUFFER_CREATE, (uint32_t)pxStreamBuffer, xBufferSizeBytes); prvTraceStoreEvent2(xIsMessageBuffer == 1 ? PSF_EVENT_MESSAGEBUFFER_CREATE : PSF_EVENT_STREAMBUFFER_CREATE, (uint32_t)pxStreamBuffer, xBufferSizeBytes);
#undef traceSTREAM_BUFFER_CREATE_FAILED #undef traceSTREAM_BUFFER_CREATE_FAILED
#define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer ) \ #define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreEvent2(xIsMessageBuffer == 1 ? PSF_EVENT_MESSAGEBUFFER_CREATE_FAILED : PSF_EVENT_STREAMBUFFER_CREATE_FAILED, 0 , xBufferSizeBytes); prvTraceStoreEvent2(xIsMessageBuffer == 1 ? PSF_EVENT_MESSAGEBUFFER_CREATE_FAILED : PSF_EVENT_STREAMBUFFER_CREATE_FAILED, 0 , xBufferSizeBytes);
#undef traceSTREAM_BUFFER_CREATE_STATIC_FAILED #undef traceSTREAM_BUFFER_CREATE_STATIC_FAILED
@ -2461,50 +2465,50 @@ BaseType_t MyWrapper(__a, __b, const BaseType_t xCopyPosition)
#undef traceSTREAM_BUFFER_DELETE #undef traceSTREAM_BUFFER_DELETE
#define traceSTREAM_BUFFER_DELETE( xStreamBuffer ) \ #define traceSTREAM_BUFFER_DELETE( xStreamBuffer ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, pxStreamBuffer) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, pxStreamBuffer) & CurrentFilterMask) \
prvTraceStoreEvent2(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_DELETE : PSF_EVENT_STREAMBUFFER_DELETE, (uint32_t)xStreamBuffer, prvBytesInBuffer(xStreamBuffer)); \ prvTraceStoreEvent2(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_DELETE : PSF_EVENT_STREAMBUFFER_DELETE, (uint32_t)xStreamBuffer, prvBytesInBuffer(xStreamBuffer)); \
prvTraceDeleteSymbol(xStreamBuffer); prvTraceDeleteSymbol(xStreamBuffer);
#undef traceSTREAM_BUFFER_RESET #undef traceSTREAM_BUFFER_RESET
#define traceSTREAM_BUFFER_RESET( xStreamBuffer ) \ #define traceSTREAM_BUFFER_RESET( xStreamBuffer ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \
prvTraceStoreEvent2(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_RESET : PSF_EVENT_STREAMBUFFER_RESET, (uint32_t)xStreamBuffer, 0); prvTraceStoreEvent2(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_RESET : PSF_EVENT_STREAMBUFFER_RESET, (uint32_t)xStreamBuffer, 0);
#undef traceSTREAM_BUFFER_SEND #undef traceSTREAM_BUFFER_SEND
#define traceSTREAM_BUFFER_SEND( xStreamBuffer, xReturn ) \ #define traceSTREAM_BUFFER_SEND( xStreamBuffer, xReturn ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \
prvTraceStoreEvent2(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_SEND : PSF_EVENT_STREAMBUFFER_SEND, (uint32_t)xStreamBuffer, prvBytesInBuffer(xStreamBuffer)); prvTraceStoreEvent2(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_SEND : PSF_EVENT_STREAMBUFFER_SEND, (uint32_t)xStreamBuffer, prvBytesInBuffer(xStreamBuffer));
#undef traceBLOCKING_ON_STREAM_BUFFER_SEND #undef traceBLOCKING_ON_STREAM_BUFFER_SEND
#define traceBLOCKING_ON_STREAM_BUFFER_SEND( xStreamBuffer ) \ #define traceBLOCKING_ON_STREAM_BUFFER_SEND( xStreamBuffer ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \
prvTraceStoreEvent1(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_SEND_BLOCK : PSF_EVENT_STREAMBUFFER_SEND_BLOCK, (uint32_t)xStreamBuffer); prvTraceStoreEvent1(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_SEND_BLOCK : PSF_EVENT_STREAMBUFFER_SEND_BLOCK, (uint32_t)xStreamBuffer);
#undef traceSTREAM_BUFFER_SEND_FAILED #undef traceSTREAM_BUFFER_SEND_FAILED
#define traceSTREAM_BUFFER_SEND_FAILED( xStreamBuffer ) \ #define traceSTREAM_BUFFER_SEND_FAILED( xStreamBuffer ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \
prvTraceStoreEvent1(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_SEND_FAILED : PSF_EVENT_STREAMBUFFER_SEND_FAILED, (uint32_t)xStreamBuffer); prvTraceStoreEvent1(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_SEND_FAILED : PSF_EVENT_STREAMBUFFER_SEND_FAILED, (uint32_t)xStreamBuffer);
#undef traceSTREAM_BUFFER_RECEIVE #undef traceSTREAM_BUFFER_RECEIVE
#define traceSTREAM_BUFFER_RECEIVE( xStreamBuffer, xReceivedLength ) \ #define traceSTREAM_BUFFER_RECEIVE( xStreamBuffer, xReceivedLength ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \
prvTraceStoreEvent2(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_RECEIVE: PSF_EVENT_STREAMBUFFER_RECEIVE, (uint32_t)xStreamBuffer, prvBytesInBuffer(xStreamBuffer)); prvTraceStoreEvent2(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_RECEIVE: PSF_EVENT_STREAMBUFFER_RECEIVE, (uint32_t)xStreamBuffer, prvBytesInBuffer(xStreamBuffer));
#undef traceBLOCKING_ON_STREAM_BUFFER_RECEIVE #undef traceBLOCKING_ON_STREAM_BUFFER_RECEIVE
#define traceBLOCKING_ON_STREAM_BUFFER_RECEIVE( xStreamBuffer ) \ #define traceBLOCKING_ON_STREAM_BUFFER_RECEIVE( xStreamBuffer ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \
prvTraceStoreEvent1(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_RECEIVE_BLOCK: PSF_EVENT_STREAMBUFFER_RECEIVE_BLOCK, (uint32_t)xStreamBuffer); prvTraceStoreEvent1(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_RECEIVE_BLOCK: PSF_EVENT_STREAMBUFFER_RECEIVE_BLOCK, (uint32_t)xStreamBuffer);
#undef traceSTREAM_BUFFER_RECEIVE_FAILED #undef traceSTREAM_BUFFER_RECEIVE_FAILED
#define traceSTREAM_BUFFER_RECEIVE_FAILED( xStreamBuffer ) \ #define traceSTREAM_BUFFER_RECEIVE_FAILED( xStreamBuffer ) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(STREAMBUFFER, xStreamBuffer) & CurrentFilterMask) \
prvTraceStoreEvent1(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_RECEIVE_FAILED: PSF_EVENT_STREAMBUFFER_RECEIVE_FAILED, (uint32_t)xStreamBuffer); prvTraceStoreEvent1(prvGetStreamBufferType(xStreamBuffer) > 0 ? PSF_EVENT_MESSAGEBUFFER_RECEIVE_FAILED: PSF_EVENT_STREAMBUFFER_RECEIVE_FAILED, (uint32_t)xStreamBuffer);

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcPortDefines.h * trcPortDefines.h

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcRecorder.h * trcRecorder.h
@ -49,9 +49,9 @@
extern "C" { extern "C" {
#endif #endif
#include <stdarg.h>
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
#include "trcConfig.h" #include "trcConfig.h"
#include "trcPortDefines.h" #include "trcPortDefines.h"
@ -70,6 +70,9 @@ typedef uint8_t traceHandle;
#include "trcHardwarePort.h" #include "trcHardwarePort.h"
#include "trcKernelPort.h" #include "trcKernelPort.h"
// Not available in snapshot mode
#define vTraceConsoleChannelPrintF(fmt, ...)
#endif #endif
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) #if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
@ -85,6 +88,9 @@ typedef const void* traceHandle;
#if (TRC_USE_TRACEALYZER_RECORDER == 1) #if (TRC_USE_TRACEALYZER_RECORDER == 1)
/* The user event channel for recorder warnings, must be defined in trcKernelPort.c */
extern traceString trcWarningChannel;
#define TRACE_GET_LOW16(value) ((uint16_t)((value) & 0x0000FFFF)) #define TRACE_GET_LOW16(value) ((uint16_t)((value) & 0x0000FFFF))
#define TRACE_GET_HIGH16(value) ((uint16_t)(((value) >> 16) & 0x0000FFFF)) #define TRACE_GET_HIGH16(value) ((uint16_t)(((value) >> 16) & 0x0000FFFF))
#define TRACE_SET_LOW16(current, value) (((current) & 0xFFFF0000) | (value)) #define TRACE_SET_LOW16(current, value) (((current) & 0xFFFF0000) | (value))
@ -237,6 +243,26 @@ void vTracePrint(traceString chn, const char* str);
#define vTracePrint(chn, ...) (void)chn #define vTracePrint(chn, ...) (void)chn
#endif #endif
/*******************************************************************************
* vTraceConsoleChannelPrintF
*
* Wrapper for vTracePrint, using the default channel. Can be used as a drop-in
* replacement for printf and similar functions, e.g. in a debug logging macro.
*
* Example:
*
* // Old: #define LogString debug_console_printf
*
* // New, log to Tracealyzer instead:
* #define LogString vTraceConsoleChannelPrintF
* ...
* LogString("My value is: %d", myValue);
******************************************************************************/
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
void vTraceConsoleChannelPrintF(const char* fmt, ...);
#endif
/******************************************************************************* /*******************************************************************************
* xTraceRegisterString * xTraceRegisterString
* *
@ -626,19 +652,19 @@ void vTraceClear(void);
/* This macro will create a task in the object table */ /* This macro will create a task in the object table */
#undef trcKERNEL_HOOKS_TASK_CREATE #undef trcKERNEL_HOOKS_TASK_CREATE
#define trcKERNEL_HOOKS_TASK_CREATE(SERVICE, CLASS, pxTCB) \ #define trcKERNEL_HOOKS_TASK_CREATE(SERVICE, CLASS, pxTCB) \
TRACE_SET_TASK_NUMBER(pxTCB); \ TRACE_SET_OBJECT_NUMBER(TASK, pxTCB); \
TRACE_SET_TASK_FILTER(pxTCB, CurrentFilterGroup); \ TRACE_SET_OBJECT_FILTER(TASK, pxTCB, CurrentFilterGroup); \
prvTraceSetObjectName(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_GET_TASK_NAME(pxTCB)); \ prvTraceSetObjectName(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_GET_TASK_NAME(pxTCB)); \
prvTraceSetPriorityProperty(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_GET_TASK_PRIORITY(pxTCB)); \ prvTraceSetPriorityProperty(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_GET_TASK_PRIORITY(pxTCB)); \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB)); prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB));
/* This macro will remove the task and store it in the event buffer */ /* This macro will remove the task and store it in the event buffer */
#undef trcKERNEL_HOOKS_TASK_DELETE #undef trcKERNEL_HOOKS_TASK_DELETE
#define trcKERNEL_HOOKS_TASK_DELETE(SERVICE, SERVICE_NAME, SERVICE_PROP, pxTCB) \ #define trcKERNEL_HOOKS_TASK_DELETE(SERVICE, SERVICE_NAME, SERVICE_PROP, pxTCB) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB)); \ prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB)); \
prvTraceStoreObjectNameOnCloseEvent(SERVICE_NAME, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_CLASS_TASK); \ prvTraceStoreObjectNameOnCloseEvent(SERVICE_NAME, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_CLASS_TASK); \
prvTraceStoreObjectPropertiesOnCloseEvent(SERVICE_PROP, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_CLASS_TASK); \ prvTraceStoreObjectPropertiesOnCloseEvent(SERVICE_PROP, TRACE_GET_TASK_NUMBER(pxTCB), TRACE_CLASS_TASK); \
@ -653,7 +679,7 @@ void vTraceClear(void);
TRACE_SET_OBJECT_NUMBER(CLASS, pxObject);\ TRACE_SET_OBJECT_NUMBER(CLASS, pxObject);\
TRACE_SET_OBJECT_FILTER(CLASS, pxObject, CurrentFilterGroup); \ TRACE_SET_OBJECT_FILTER(CLASS, pxObject, CurrentFilterGroup); \
prvMarkObjectAsUsed(TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject));\ prvMarkObjectAsUsed(TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject));\
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject)); \ prvTraceStoreKernelCall(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject)); \
prvTraceSetObjectState(TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject), 0); prvTraceSetObjectState(TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject), 0);
@ -661,7 +687,7 @@ void vTraceClear(void);
/* This macro will remove the object and store it in the event buffer */ /* This macro will remove the object and store it in the event buffer */
#undef trcKERNEL_HOOKS_OBJECT_DELETE #undef trcKERNEL_HOOKS_OBJECT_DELETE
#define trcKERNEL_HOOKS_OBJECT_DELETE(SERVICE, SERVICE_NAME, SERVICE_PROP, CLASS, pxObject) \ #define trcKERNEL_HOOKS_OBJECT_DELETE(SERVICE, SERVICE_NAME, SERVICE_PROP, CLASS, pxObject) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject)); \ prvTraceStoreKernelCall(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject)); \
prvTraceStoreObjectNameOnCloseEvent(SERVICE_NAME, TRACE_GET_OBJECT_NUMBER(CLASS, pxObject), TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject)); \ prvTraceStoreObjectNameOnCloseEvent(SERVICE_NAME, TRACE_GET_OBJECT_NUMBER(CLASS, pxObject), TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject)); \
@ -671,21 +697,33 @@ void vTraceClear(void);
/* This macro will create a call to a kernel service with a certain result, with an object as parameter */ /* This macro will create a call to a kernel service with a certain result, with an object as parameter */
#undef trcKERNEL_HOOKS_KERNEL_SERVICE #undef trcKERNEL_HOOKS_KERNEL_SERVICE
#define trcKERNEL_HOOKS_KERNEL_SERVICE(SERVICE, CLASS, pxObject) \ #define trcKERNEL_HOOKS_KERNEL_SERVICE(SERVICE, CLASS, pxObject) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject)); prvTraceStoreKernelCall(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject));
/* This macro will create a call to a kernel service with a certain result, with a null object as parameter */
#undef trcKERNEL_HOOKS_KERNEL_SERVICE_NULL_OBJECT
#define trcKERNEL_HOOKS_KERNEL_SERVICE_NULL_OBJECT(SERVICE, TRACECLASS) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACECLASS, 0);
/* This macro will create a call to a kernel service with a certain result, with an object as parameter */ /* This macro will create a call to a kernel service with a certain result, with an object as parameter */
#undef trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_PARAM #undef trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_PARAM
#define trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_PARAM(SERVICE, CLASS, pxObject, param) \ #define trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_PARAM(SERVICE, CLASS, pxObject, param) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(CLASS, pxObject) & CurrentFilterMask) \
prvTraceStoreKernelCallWithParam(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject), (uint32_t)param); prvTraceStoreKernelCallWithParam(SERVICE, TRACE_GET_OBJECT_TRACE_CLASS(CLASS, pxObject), TRACE_GET_OBJECT_NUMBER(CLASS, pxObject), (uint32_t)param);
/* This macro will create a call to a kernel service with a certain result, with a null object and other value as parameter */
#undef trcKERNEL_HOOKS_KERNEL_SERVICE_NULL_OBJECT_WITH_PARAM
#define trcKERNEL_HOOKS_KERNEL_SERVICE_NULL_OBJECT_WITH_PARAM(SERVICE, TRACECLASS, param) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreKernelCallWithParam(SERVICE, TRACECLASS, 0, param);
/* This macro will create a call to a kernel service with a certain result, with an object as parameter */ /* This macro will create a call to a kernel service with a certain result, with an object as parameter */
#undef trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_NUMERIC_PARAM_ONLY #undef trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_NUMERIC_PARAM_ONLY
#define trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_NUMERIC_PARAM_ONLY(SERVICE, param) \ #define trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_NUMERIC_PARAM_ONLY(SERVICE, param) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceStoreKernelCallWithNumericParamOnly(SERVICE, (uint32_t)param); prvTraceStoreKernelCallWithNumericParamOnly(SERVICE, (uint32_t)param);
/* This macro will create a call to a kernel service with a certain result, with an object as parameter */ /* This macro will create a call to a kernel service with a certain result, with an object as parameter */
@ -713,14 +751,14 @@ void vTraceClear(void);
/* This macro will flag a certain task as a finished instance */ /* This macro will flag a certain task as a finished instance */
#undef trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED #undef trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED
#define trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED() \ #define trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED() \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
prvTraceSetTaskInstanceFinished(TRACE_GET_TASK_NUMBER(TRACE_GET_CURRENT_TASK())); prvTraceSetTaskInstanceFinished(TRACE_GET_TASK_NUMBER(TRACE_GET_CURRENT_TASK()));
#if (TRC_CFG_INCLUDE_READY_EVENTS == 1) #if (TRC_CFG_INCLUDE_READY_EVENTS == 1)
/* This macro will create an event to indicate that a task became Ready */ /* This macro will create an event to indicate that a task became Ready */
#undef trcKERNEL_HOOKS_MOVED_TASK_TO_READY_STATE #undef trcKERNEL_HOOKS_MOVED_TASK_TO_READY_STATE
#define trcKERNEL_HOOKS_MOVED_TASK_TO_READY_STATE(pxTCB) \ #define trcKERNEL_HOOKS_MOVED_TASK_TO_READY_STATE(pxTCB) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
prvTraceStoreTaskReady(TRACE_GET_TASK_NUMBER(pxTCB)); prvTraceStoreTaskReady(TRACE_GET_TASK_NUMBER(pxTCB));
#else /*(TRC_CFG_INCLUDE_READY_EVENTS == 1)*/ #else /*(TRC_CFG_INCLUDE_READY_EVENTS == 1)*/
#undef trcKERNEL_HOOKS_MOVED_TASK_TO_READY_STATE #undef trcKERNEL_HOOKS_MOVED_TASK_TO_READY_STATE
@ -749,21 +787,21 @@ void vTraceClear(void);
/* This macro will create a task switch event to the currently executing task */ /* This macro will create a task switch event to the currently executing task */
#undef trcKERNEL_HOOKS_TASK_SWITCH #undef trcKERNEL_HOOKS_TASK_SWITCH
#define trcKERNEL_HOOKS_TASK_SWITCH( pxTCB ) \ #define trcKERNEL_HOOKS_TASK_SWITCH( pxTCB ) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
prvTraceStoreTaskswitch(TRACE_GET_TASK_NUMBER(pxTCB)); prvTraceStoreTaskswitch(TRACE_GET_TASK_NUMBER(pxTCB));
/* This macro will create an event to indicate that the task has been suspended */ /* This macro will create an event to indicate that the task has been suspended */
#undef trcKERNEL_HOOKS_TASK_SUSPEND #undef trcKERNEL_HOOKS_TASK_SUSPEND
#define trcKERNEL_HOOKS_TASK_SUSPEND(SERVICE, pxTCB) \ #define trcKERNEL_HOOKS_TASK_SUSPEND(SERVICE, pxTCB) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB)); \ prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB)); \
prvTraceSetTaskInstanceFinished((uint8_t)TRACE_GET_TASK_NUMBER(pxTCB)); prvTraceSetTaskInstanceFinished((uint8_t)TRACE_GET_TASK_NUMBER(pxTCB));
/* This macro will create an event to indicate that a task has called a wait/delay function */ /* This macro will create an event to indicate that a task has called a wait/delay function */
#undef trcKERNEL_HOOKS_TASK_DELAY #undef trcKERNEL_HOOKS_TASK_DELAY
#define trcKERNEL_HOOKS_TASK_DELAY(SERVICE, pxTCB, xValue) \ #define trcKERNEL_HOOKS_TASK_DELAY(SERVICE, pxTCB, xValue) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
{ \ { \
prvTraceStoreKernelCallWithNumericParamOnly(SERVICE, xValue); \ prvTraceStoreKernelCallWithNumericParamOnly(SERVICE, xValue); \
prvTraceSetTaskInstanceFinished((uint8_t)TRACE_GET_TASK_NUMBER(pxTCB)); \ prvTraceSetTaskInstanceFinished((uint8_t)TRACE_GET_TASK_NUMBER(pxTCB)); \
@ -772,7 +810,7 @@ void vTraceClear(void);
/* This macro will create an event to indicate that a task has gotten its priority changed */ /* This macro will create an event to indicate that a task has gotten its priority changed */
#undef trcKERNEL_HOOKS_TASK_PRIORITY_CHANGE #undef trcKERNEL_HOOKS_TASK_PRIORITY_CHANGE
#define trcKERNEL_HOOKS_TASK_PRIORITY_CHANGE(SERVICE, pxTCB, uxNewPriority) \ #define trcKERNEL_HOOKS_TASK_PRIORITY_CHANGE(SERVICE, pxTCB, uxNewPriority) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
{ \ { \
prvTraceStoreKernelCallWithParam(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), prvTraceGetPriorityProperty(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB)));\ prvTraceStoreKernelCallWithParam(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), prvTraceGetPriorityProperty(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB)));\
prvTraceSetPriorityProperty(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), (uint8_t)uxNewPriority); \ prvTraceSetPriorityProperty(TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB), (uint8_t)uxNewPriority); \
@ -781,13 +819,13 @@ void vTraceClear(void);
/* This macro will create an event to indicate that the task has been resumed */ /* This macro will create an event to indicate that the task has been resumed */
#undef trcKERNEL_HOOKS_TASK_RESUME #undef trcKERNEL_HOOKS_TASK_RESUME
#define trcKERNEL_HOOKS_TASK_RESUME(SERVICE, pxTCB) \ #define trcKERNEL_HOOKS_TASK_RESUME(SERVICE, pxTCB) \
if (TRACE_GET_TASK_FILTER(TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, TRACE_GET_CURRENT_TASK()) & CurrentFilterMask) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB)); prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB));
#undef trcKERNEL_HOOKS_TASK_RESUME_FROM_ISR #undef trcKERNEL_HOOKS_TASK_RESUME_FROM_ISR
#define trcKERNEL_HOOKS_TASK_RESUME_FROM_ISR(SERVICE, pxTCB) \ #define trcKERNEL_HOOKS_TASK_RESUME_FROM_ISR(SERVICE, pxTCB) \
if (TRACE_GET_TASK_FILTER(pxTCB) & CurrentFilterMask) \ if (TRACE_GET_OBJECT_FILTER(TASK, pxTCB) & CurrentFilterMask) \
prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB)); prvTraceStoreKernelCall(SERVICE, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxTCB));
#if !defined TRC_CFG_INCLUDE_READY_EVENTS || TRC_CFG_INCLUDE_READY_EVENTS == 1 #if !defined TRC_CFG_INCLUDE_READY_EVENTS || TRC_CFG_INCLUDE_READY_EVENTS == 1
@ -1732,6 +1770,8 @@ void prvProcessCommand(TracealyzerCommandType* cmd);
#define vTraceSetRecorderDataBuffer(pRecorderData) #define vTraceSetRecorderDataBuffer(pRecorderData)
#endif #endif
#define vTraceConsoleChannelPrintF(fmt, ...)
#ifndef TRC_ALLOC_CUSTOM_BUFFER #ifndef TRC_ALLOC_CUSTOM_BUFFER
#define TRC_ALLOC_CUSTOM_BUFFER(bufname) #define TRC_ALLOC_CUSTOM_BUFFER(bufname)
#endif #endif

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.4
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcConfig.h * trcConfig.h

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.4
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcSnapshotConfig.h * trcSnapshotConfig.h

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.4
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcStreamingConfig.h * trcStreamingConfig.h

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcStreamingPort.h * trcStreamingPort.h

View file

@ -40,7 +40,7 @@ static void itm_write_32(uint32_t data)
{ {
if ((CoreDebug->DEMCR & CoreDebug_DEMCR_TRCENA_Msk) && // Trace enabled if ((CoreDebug->DEMCR & CoreDebug_DEMCR_TRCENA_Msk) && // Trace enabled
(ITM->TCR & ITM_TCR_ITMENA_Msk) && // ITM enabled (ITM->TCR & ITM_TCR_ITMENA_Msk) && // ITM enabled
(ITM->TER & (1UL << 0))) // ITM Port #0 enabled (ITM->TER & (1UL << TRC_CFG_ITM_PORT))) // ITM port enabled
{ {
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! 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!
ITM->PORT[TRC_CFG_ITM_PORT].u32 = data; // Write the data ITM->PORT[TRC_CFG_ITM_PORT].u32 = data; // Write the data

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcStreamingPort.h * trcStreamingPort.h

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcStreamingPort.c * trcStreamingPort.c

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcStreamingPort.h * trcStreamingPort.h

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcStreamingPort.h * trcStreamingPort.h

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcStreamingPort.c * trcStreamingPort.c

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcStreamingPort.h * trcStreamingPort.h

View file

@ -1,5 +1,5 @@
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Tracealyzer Recorder Library v4.1.0 for FreeRTOS Tracealyzer Recorder Library for FreeRTOS
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Tracealyzer is a sophisticated tool for tracing and visualization Tracealyzer is a sophisticated tool for tracing and visualization
@ -22,6 +22,26 @@ In case you have any questions, don't hesitate to contact support@percepio.com
Tracealyzer supports FreeRTOS v7.3 and newer, including Amazon FreeRTOS. Tracealyzer supports FreeRTOS v7.3 and newer, including Amazon FreeRTOS.
-------------------------------------------------------------------------------
Changes, v4.1.4 -> v4.1.5
- Fixed a bug in the ITM stream port, that required Port 0 to be enabled.
- Added missing include of stdio.h (needed by vTraceConsoleChannelPrintF).
- Moved standard includes from trcRecorder.h into the .c files needing them.
-------------------------------------------------------------------------------
Changes, v4.1.2 -> v4.1.4
- Fixed a compile error when certain FreeRTOS settings were used
- Disabled filter support for FreeRTOS v7.3 since it uses "char" for object id
-------------------------------------------------------------------------------
Changes, v4.1.0 -> v4.1.2
- Added vTraceConsoleChannelPrintF(...)
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Changes, v4.0.3 -> v4.1.0 Changes, v4.0.3 -> v4.1.0

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcKernelPort.c * trcKernelPort.c

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcSnapshotRecorder.c * trcSnapshotRecorder.c
@ -7,7 +7,7 @@
* The generic core of the trace recorder's snapshot mode. * The generic core of the trace recorder's snapshot mode.
* *
* Terms of Use * Terms of Use
* This file is part of the trace recorder library (RECORDER), which is the * This file is part of the trace recorder library (RECORDER), which is the
* intellectual property of Percepio AB (PERCEPIO) and provided under a * intellectual property of Percepio AB (PERCEPIO) and provided under a
* license as follows. * license as follows.
* The RECORDER may be used free of charge for the purpose of recording data * The RECORDER may be used free of charge for the purpose of recording data
@ -16,14 +16,14 @@
* You may distribute the RECORDER in its original source code form, assuming * You may distribute the RECORDER in its original source code form, assuming
* this text (terms of use, disclaimer, copyright notice) is unchanged. You are * this text (terms of use, disclaimer, copyright notice) is unchanged. You are
* allowed to distribute the RECORDER with minor modifications intended for * allowed to distribute the RECORDER with minor modifications intended for
* configuration or porting of the RECORDER, e.g., to allow using it on a * configuration or porting of the RECORDER, e.g., to allow using it on a
* specific processor, processor family or with a specific communication * specific processor, processor family or with a specific communication
* interface. Any such modifications should be documented directly below * interface. Any such modifications should be documented directly below
* this comment block. * this comment block.
* *
* Disclaimer * Disclaimer
* The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty * The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty
* as to its use or performance. PERCEPIO does not and cannot warrant the * as to its use or performance. PERCEPIO does not and cannot warrant the
* performance or results you may obtain by using the RECORDER or documentation. * performance or results you may obtain by using the RECORDER or documentation.
* PERCEPIO make no warranties, express or implied, as to noninfringement of * PERCEPIO make no warranties, express or implied, as to noninfringement of
* third party rights, merchantability, or fitness for any particular purpose. * third party rights, merchantability, or fitness for any particular purpose.
@ -107,9 +107,9 @@ extern traceHandle handle_of_last_logged_task;
/*************** Private Functions *******************************************/ /*************** Private Functions *******************************************/
static void prvStrncpy(char* dst, const char* src, uint32_t maxLength); static void prvStrncpy(char* dst, const char* src, uint32_t maxLength);
static uint8_t prvTraceGetObjectState(uint8_t objectclass, traceHandle id); static uint8_t prvTraceGetObjectState(uint8_t objectclass, traceHandle id);
static void prvTraceGetChecksum(const char *pname, uint8_t* pcrc, uint8_t* plength); static void prvTraceGetChecksum(const char *pname, uint8_t* pcrc, uint8_t* plength);
static void* prvTraceNextFreeEventBufferSlot(void); static void* prvTraceNextFreeEventBufferSlot(void);
static uint16_t prvTraceGetDTS(uint16_t param_maxDTS); static uint16_t prvTraceGetDTS(uint16_t param_maxDTS);
static traceString prvTraceOpenSymbol(const char* name, traceString userEventChannel); static traceString prvTraceOpenSymbol(const char* name, traceString userEventChannel);
static void prvTraceUpdateCounters(void); static void prvTraceUpdateCounters(void);
@ -136,7 +136,7 @@ static traceString prvTraceLookupSymbolTableEntry(const char* name,
void prvTraceIncreaseISRActive(void); void prvTraceIncreaseISRActive(void);
void prvTraceDecreaseISRActive(void); void prvTraceDecreaseISRActive(void);
#endif /*(TRC_CFG_INCLUDE_ISR_TRACING == 0)*/ #endif /*(TRC_CFG_INCLUDE_ISR_TRACING == 0)*/
#if (TRC_CFG_USE_16BIT_OBJECT_HANDLES == 1) #if (TRC_CFG_USE_16BIT_OBJECT_HANDLES == 1)
static uint8_t prvTraceGet8BitHandle(traceHandle handle); static uint8_t prvTraceGet8BitHandle(traceHandle handle);
#else #else
@ -204,19 +204,19 @@ void prvTraceError(const char* msg);
* Initializes and optionally starts the trace, depending on the start option. * Initializes and optionally starts the trace, depending on the start option.
* To use the trace recorder, the startup must call vTraceEnable before any RTOS * To use the trace recorder, the startup must call vTraceEnable before any RTOS
* calls are made (including "create" calls). Three start options are provided: * calls are made (including "create" calls). Three start options are provided:
* *
* TRC_START: Starts the tracing directly. In snapshot mode this allows for * TRC_START: Starts the tracing directly. In snapshot mode this allows for
* starting the trace at any point in your code, assuming vTraceEnable(TRC_INIT) * starting the trace at any point in your code, assuming vTraceEnable(TRC_INIT)
* has been called in the startup. * has been called in the startup.
* Can also be used for streaming without Tracealyzer control, e.g. to a local * Can also be used for streaming without Tracealyzer control, e.g. to a local
* flash file system (assuming such a "stream port", see trcStreamingPort.h). * flash file system (assuming such a "stream port", see trcStreamingPort.h).
* *
* TRC_INIT: Initializes the trace recorder, but does not start the tracing. * TRC_INIT: Initializes the trace recorder, but does not start the tracing.
* In snapshot mode, this must be followed by a vTraceEnable(TRC_START) sometime * In snapshot mode, this must be followed by a vTraceEnable(TRC_START) sometime
* later. * later.
* *
* Usage examples, in snapshot mode: * Usage examples, in snapshot mode:
* *
* Snapshot trace, from startup: * Snapshot trace, from startup:
* <board init> * <board init>
* vTraceEnable(TRC_START); * vTraceEnable(TRC_START);
@ -228,14 +228,14 @@ void prvTraceError(const char* msg);
* <RTOS init> * <RTOS init>
* ... * ...
* vTraceEnable(TRC_START); // e.g., in task context, at some relevant event * vTraceEnable(TRC_START); // e.g., in task context, at some relevant event
* *
* *
* Note: See other implementation of vTraceEnable in trcStreamingRecorder.c * Note: See other implementation of vTraceEnable in trcStreamingRecorder.c
******************************************************************************/ ******************************************************************************/
void vTraceEnable(int startOption) void vTraceEnable(int startOption)
{ {
prvTraceInitTraceData(); prvTraceInitTraceData();
if (startOption == TRC_START) if (startOption == TRC_START)
{ {
vTraceStart(); vTraceStart();
@ -247,7 +247,7 @@ void vTraceEnable(int startOption)
else if (startOption != TRC_INIT) else if (startOption != TRC_INIT)
{ {
prvTraceError("Unexpected argument to vTraceEnable (snapshot mode)"); prvTraceError("Unexpected argument to vTraceEnable (snapshot mode)");
} }
} }
/******************************************************************************* /*******************************************************************************
@ -325,7 +325,7 @@ uint32_t uiTraceStart(void)
TRACE_ASSERT(RecorderDataPtr != NULL, "Recorder not initialized. Use vTraceEnable() instead!", 0); TRACE_ASSERT(RecorderDataPtr != NULL, "Recorder not initialized. Use vTraceEnable() instead!", 0);
return 0; return 0;
} }
if (RecorderDataPtr->recorderActive == 1) if (RecorderDataPtr->recorderActive == 1)
return 1; /* Already running */ return 1; /* Already running */
@ -553,7 +553,7 @@ void vTraceInstanceFinishedNow(void)
* xTraceSetISRProperties * xTraceSetISRProperties
* *
* Stores a name and priority level for an Interrupt Service Routine, to allow * Stores a name and priority level for an Interrupt Service Routine, to allow
* for better visualization. Returns a traceHandle used by vTraceStoreISRBegin. * for better visualization. Returns a traceHandle used by vTraceStoreISRBegin.
* *
* Example: * Example:
* #define PRIO_ISR_TIMER1 3 // the hardware priority of the interrupt * #define PRIO_ISR_TIMER1 3 // the hardware priority of the interrupt
@ -569,7 +569,7 @@ void vTraceInstanceFinishedNow(void)
******************************************************************************/ ******************************************************************************/
traceHandle xTraceSetISRProperties(const char* name, uint8_t priority) traceHandle xTraceSetISRProperties(const char* name, uint8_t priority)
{ {
static traceHandle handle = 0; static traceHandle handle = 0;
TRACE_ASSERT(RecorderDataPtr != NULL, "Recorder not initialized, call vTraceEnable() first!", (traceHandle)0); TRACE_ASSERT(RecorderDataPtr != NULL, "Recorder not initialized, call vTraceEnable() first!", (traceHandle)0);
TRACE_ASSERT(handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[TRACE_CLASS_ISR], "xTraceSetISRProperties: Invalid value for handle", 0); TRACE_ASSERT(handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[TRACE_CLASS_ISR], "xTraceSetISRProperties: Invalid value for handle", 0);
TRACE_ASSERT(name != NULL, "xTraceSetISRProperties: name == NULL", 0); TRACE_ASSERT(name != NULL, "xTraceSetISRProperties: name == NULL", 0);
@ -578,7 +578,7 @@ void vTraceInstanceFinishedNow(void)
prvTraceSetObjectName(TRACE_CLASS_ISR, handle, name); prvTraceSetObjectName(TRACE_CLASS_ISR, handle, name);
prvTraceSetPriorityProperty(TRACE_CLASS_ISR, handle, priority); prvTraceSetPriorityProperty(TRACE_CLASS_ISR, handle, priority);
return handle; return handle;
} }
@ -608,7 +608,7 @@ void vTraceStoreISRBegin(traceHandle handle)
{ {
/************************************************************************* /*************************************************************************
* This occurs if an ISR calls a trace function, preempting a previous * This occurs if an ISR calls a trace function, preempting a previous
* trace call that is being processed in a different ISR or task. * trace call that is being processed in a different ISR or task.
* If this occurs, there is probably a problem in the definition of the * If this occurs, there is probably a problem in the definition of the
* recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and * recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and
* TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt * TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt
@ -620,14 +620,14 @@ void vTraceStoreISRBegin(traceHandle handle)
return; return;
} }
trcCRITICAL_SECTION_BEGIN(); trcCRITICAL_SECTION_BEGIN();
if (RecorderDataPtr->recorderActive && handle_of_last_logged_task) if (RecorderDataPtr->recorderActive && handle_of_last_logged_task)
{ {
uint16_t dts4; uint16_t dts4;
TRACE_ASSERT(handle != 0, "vTraceStoreISRBegin: Invalid ISR handle (NULL)", TRC_UNUSED); TRACE_ASSERT(handle != 0, "vTraceStoreISRBegin: Invalid ISR handle (NULL)", TRC_UNUSED);
TRACE_ASSERT(handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[TRACE_CLASS_ISR], "vTraceStoreISRBegin: Invalid ISR handle (> NISR)", TRC_UNUSED); TRACE_ASSERT(handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[TRACE_CLASS_ISR], "vTraceStoreISRBegin: Invalid ISR handle (> NISR)", TRC_UNUSED);
dts4 = (uint16_t)prvTraceGetDTS(0xFFFF); dts4 = (uint16_t)prvTraceGetDTS(0xFFFF);
if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */ if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */
@ -663,7 +663,7 @@ void vTraceStoreISRBegin(traceHandle handle)
* Registers the end of an Interrupt Service Routine. * Registers the end of an Interrupt Service Routine.
* *
* The parameter pendingISR indicates if the interrupt has requested a * The parameter pendingISR indicates if the interrupt has requested a
* task-switch (= 1), e.g., by signaling a semaphore. Otherwise (= 0) the * task-switch (= 1), e.g., by signaling a semaphore. Otherwise (= 0) the
* interrupt is assumed to return to the previous context. * interrupt is assumed to return to the previous context.
* *
* Example: * Example:
@ -684,7 +684,7 @@ void vTraceStoreISREnd(int pendingISR)
TSEvent* ts; TSEvent* ts;
uint16_t dts5; uint16_t dts5;
uint8_t hnd8 = 0, type = 0; uint8_t hnd8 = 0, type = 0;
TRACE_ALLOC_CRITICAL_SECTION(); TRACE_ALLOC_CRITICAL_SECTION();
if (! RecorderDataPtr->recorderActive || ! handle_of_last_logged_task) if (! RecorderDataPtr->recorderActive || ! handle_of_last_logged_task)
@ -696,7 +696,7 @@ void vTraceStoreISREnd(int pendingISR)
{ {
/************************************************************************* /*************************************************************************
* This occurs if an ISR calls a trace function, preempting a previous * This occurs if an ISR calls a trace function, preempting a previous
* trace call that is being processed in a different ISR or task. * trace call that is being processed in a different ISR or task.
* If this occurs, there is probably a problem in the definition of the * If this occurs, there is probably a problem in the definition of the
* recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and * recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and
* TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt * TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt
@ -707,7 +707,7 @@ void vTraceStoreISREnd(int pendingISR)
prvTraceError("vTraceStoreISREnd - recorder busy! See code comment."); prvTraceError("vTraceStoreISREnd - recorder busy! See code comment.");
return; return;
} }
if (nISRactive == 0) if (nISRactive == 0)
{ {
prvTraceError("Unmatched call to vTraceStoreISREnd (nISRactive == 0, expected > 0)"); prvTraceError("Unmatched call to vTraceStoreISREnd (nISRactive == 0, expected > 0)");
@ -723,7 +723,7 @@ void vTraceStoreISREnd(int pendingISR)
type = TS_ISR_RESUME; type = TS_ISR_RESUME;
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. */ 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. */
} }
else if ((isPendingContextSwitch == 0) || (prvTraceIsSchedulerSuspended())) else if ((isPendingContextSwitch == 0) || (prvTraceIsSchedulerSuspended()))
{ {
/* Return to interrupted task, if no context switch will occur in between. */ /* Return to interrupted task, if no context switch will occur in between. */
type = TS_TASK_RESUME; type = TS_TASK_RESUME;
@ -1081,7 +1081,7 @@ static void prvTraceClearChannelBuffer(uint32_t count)
static void prvTraceCopyToDataBuffer(uint32_t* data, uint32_t count) static void prvTraceCopyToDataBuffer(uint32_t* data, uint32_t count)
{ {
uint32_t slots; uint32_t slots;
TRACE_ASSERT(data != NULL, TRACE_ASSERT(data != NULL,
"prvTraceCopyToDataBuffer: data == NULL.", TRC_UNUSED); "prvTraceCopyToDataBuffer: data == NULL.", TRC_UNUSED);
TRACE_ASSERT(count <= (TRC_CFG_SEPARATE_USER_EVENT_BUFFER_SIZE), TRACE_ASSERT(count <= (TRC_CFG_SEPARATE_USER_EVENT_BUFFER_SIZE),
@ -1137,7 +1137,7 @@ static void prvTraceUBHelper2(traceUBChannel channel, uint32_t* data, uint32_t n
{ {
static uint32_t old_timestamp = 0; static uint32_t old_timestamp = 0;
uint32_t old_nextSlotToWrite = 0; uint32_t old_nextSlotToWrite = 0;
TRACE_ALLOC_CRITICAL_SECTION(); TRACE_ALLOC_CRITICAL_SECTION();
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); 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);
@ -1189,7 +1189,7 @@ traceUBChannel xTraceRegisterUBChannel(traceString channel, traceString formatSt
{ {
uint8_t i; uint8_t i;
traceUBChannel retVal = 0; traceUBChannel retVal = 0;
TRACE_ALLOC_CRITICAL_SECTION(); TRACE_ALLOC_CRITICAL_SECTION();
TRACE_ASSERT(formatStr != 0, "xTraceRegisterChannelFormat: formatStr == 0", (traceUBChannel)0); TRACE_ASSERT(formatStr != 0, "xTraceRegisterChannelFormat: formatStr == 0", (traceUBChannel)0);
@ -1231,7 +1231,7 @@ traceUBChannel xTraceRegisterUBChannel(traceString channel, traceString formatSt
void vTraceUBData(traceUBChannel channelPair, ...) void vTraceUBData(traceUBChannel channelPair, ...)
{ {
va_list vl; va_list vl;
TRACE_ASSERT(channelPair != 0, "vTraceUBData: Not a valid traceUBChannel!", TRC_UNUSED); TRACE_ASSERT(channelPair != 0, "vTraceUBData: Not a valid traceUBChannel!", TRC_UNUSED);
va_start(vl, channelPair); va_start(vl, channelPair);
@ -1531,7 +1531,7 @@ traceString xTraceRegisterString(const char* label)
#if ((!defined TRC_CFG_INCLUDE_READY_EVENTS) || (TRC_CFG_INCLUDE_READY_EVENTS == 1)) #if ((!defined TRC_CFG_INCLUDE_READY_EVENTS) || (TRC_CFG_INCLUDE_READY_EVENTS == 1))
void prvTraceSetReadyEventsEnabled(int status) void prvTraceSetReadyEventsEnabled(int status)
{ {
readyEventsEnabled = status; readyEventsEnabled = status;
} }
@ -1541,7 +1541,7 @@ void prvTraceSetReadyEventsEnabled(int status)
* *
* This function stores a ready state for the task handle sent in as parameter. * This function stores a ready state for the task handle sent in as parameter.
******************************************************************************/ ******************************************************************************/
void prvTraceStoreTaskReady(traceHandle handle) void prvTraceStoreTaskReady(traceHandle handle)
{ {
uint16_t dts3; uint16_t dts3;
TREvent* tr; TREvent* tr;
@ -1555,11 +1555,11 @@ void prvTraceStoreTaskReady(traceHandle handle)
placement of the trace macro. In that case, the events are ignored. */ placement of the trace macro. In that case, the events are ignored. */
return; return;
} }
if (! readyEventsEnabled) if (! readyEventsEnabled)
{ {
/* When creating tasks, ready events are also created. If creating /* When creating tasks, ready events are also created. If creating
a "hidden" (not traced) task, we must therefore disable recording a "hidden" (not traced) task, we must therefore disable recording
of ready events to avoid an undesired ready event... */ of ready events to avoid an undesired ready event... */
return; return;
} }
@ -1570,7 +1570,7 @@ void prvTraceStoreTaskReady(traceHandle handle)
{ {
/************************************************************************* /*************************************************************************
* This occurs if an ISR calls a trace function, preempting a previous * This occurs if an ISR calls a trace function, preempting a previous
* trace call that is being processed in a different ISR or task. * trace call that is being processed in a different ISR or task.
* If this occurs, there is probably a problem in the definition of the * If this occurs, there is probably a problem in the definition of the
* recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and * recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and
* TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt * TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt
@ -1605,7 +1605,7 @@ void prvTraceStoreTaskReady(traceHandle handle)
* *
* This function stores a low power state. * This function stores a low power state.
******************************************************************************/ ******************************************************************************/
void prvTraceStoreLowPower(uint32_t flag) void prvTraceStoreLowPower(uint32_t flag)
{ {
uint16_t dts; uint16_t dts;
LPEvent* lp; LPEvent* lp;
@ -1617,7 +1617,7 @@ void prvTraceStoreLowPower(uint32_t flag)
{ {
/************************************************************************* /*************************************************************************
* This occurs if an ISR calls a trace function, preempting a previous * This occurs if an ISR calls a trace function, preempting a previous
* trace call that is being processed in a different ISR or task. * trace call that is being processed in a different ISR or task.
* If this occurs, there is probably a problem in the definition of the * If this occurs, there is probably a problem in the definition of the
* recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and * recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and
* TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt * TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt
@ -1671,16 +1671,16 @@ void vTraceStoreMemMangEvent(uint32_t ecode, uint32_t address, int32_t signed_si
/* Occurs in vTraceInitTraceData, if using dynamic allocation. */ /* Occurs in vTraceInitTraceData, if using dynamic allocation. */
return; return;
} }
if (signed_size < 0) if (signed_size < 0)
size = (uint32_t)(- signed_size); size = (uint32_t)(- signed_size);
else else
size = (uint32_t)(signed_size); size = (uint32_t)(signed_size);
trcCRITICAL_SECTION_BEGIN(); trcCRITICAL_SECTION_BEGIN();
heapMemUsage = heapMemUsage + (uint32_t)signed_size; heapMemUsage = heapMemUsage + (uint32_t)signed_size;
if (RecorderDataPtr->recorderActive) if (RecorderDataPtr->recorderActive)
{ {
dts1 = (uint8_t)prvTraceGetDTS(0xFF); dts1 = (uint8_t)prvTraceGetDTS(0xFF);
@ -1699,7 +1699,7 @@ void vTraceStoreMemMangEvent(uint32_t ecode, uint32_t address, int32_t signed_si
/* If the heap address range is within 16 MB, i.e., the upper 8 bits /* If the heap address range is within 16 MB, i.e., the upper 8 bits
of addresses are constant, this optimization avoids storing an extra of addresses are constant, this optimization avoids storing an extra
event record by ignoring the upper 8 bit of the address */ event record by ignoring the upper 8 bit of the address */
addr_low = address & 0xFFFF; addr_low = address & 0xFFFF;
addr_high = (address >> 16) & 0xFF; addr_high = (address >> 16) & 0xFF;
#else #else
/* The whole 32 bit address is stored using a second event record /* The whole 32 bit address is stored using a second event record
@ -1715,7 +1715,7 @@ void vTraceStoreMemMangEvent(uint32_t ecode, uint32_t address, int32_t signed_si
ma->addr_high = addr_high; ma->addr_high = addr_high;
ma->type = (uint8_t) (ecode + 1); /* Note this! */ ma->type = (uint8_t) (ecode + 1); /* Note this! */
ms->type = (uint8_t) ecode; ms->type = (uint8_t) ecode;
prvTraceUpdateCounters(); prvTraceUpdateCounters();
RecorderDataPtr->heapMemUsage = heapMemUsage; RecorderDataPtr->heapMemUsage = heapMemUsage;
} }
} }
@ -1747,7 +1747,7 @@ void prvTraceStoreKernelCall(uint32_t ecode, traceObjectClass objectClass, uint3
{ {
/************************************************************************* /*************************************************************************
* This occurs if an ISR calls a trace function, preempting a previous * This occurs if an ISR calls a trace function, preempting a previous
* trace call that is being processed in a different ISR or task. * trace call that is being processed in a different ISR or task.
* If this occurs, there is probably a problem in the definition of the * If this occurs, there is probably a problem in the definition of the
* recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and * recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and
* TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt * TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt
@ -1809,7 +1809,7 @@ void prvTraceStoreKernelCallWithParam(uint32_t evtcode,
{ {
/************************************************************************* /*************************************************************************
* This occurs if an ISR calls a trace function, preempting a previous * This occurs if an ISR calls a trace function, preempting a previous
* trace call that is being processed in a different ISR or task. * trace call that is being processed in a different ISR or task.
* If this occurs, there is probably a problem in the definition of the * If this occurs, there is probably a problem in the definition of the
* recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and * recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and
* TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt * TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt
@ -1899,7 +1899,7 @@ void prvTraceStoreKernelCallWithNumericParamOnly(uint32_t evtcode, uint32_t para
{ {
/************************************************************************* /*************************************************************************
* This occurs if an ISR calls a trace function, preempting a previous * This occurs if an ISR calls a trace function, preempting a previous
* trace call that is being processed in a different ISR or task. * trace call that is being processed in a different ISR or task.
* If this occurs, there is probably a problem in the definition of the * If this occurs, there is probably a problem in the definition of the
* recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and * recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and
* TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt * TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt
@ -2109,13 +2109,13 @@ void prvTraceSetTaskInstanceFinished(traceHandle handle)
******************************************************************************/ ******************************************************************************/
/* A set of stacks that keeps track of available object handles for each class. /* A set of stacks that keeps track of available object handles for each class.
The stacks are empty initially, meaning that allocation of new handles will be The stacks are empty initially, meaning that allocation of new handles will be
based on a counter (for each object class). Any delete operation will based on a counter (for each object class). Any delete operation will
return the handle to the corresponding stack, for reuse on the next allocate.*/ return the handle to the corresponding stack, for reuse on the next allocate.*/
objectHandleStackType objectHandleStacks = { { 0 }, { 0 }, { 0 }, { 0 }, { 0 } }; objectHandleStackType objectHandleStacks = { { 0 }, { 0 }, { 0 }, { 0 }, { 0 } };
/* Initial TRC_HWTC_COUNT value, for detecting if the time-stamping source is /* Initial TRC_HWTC_COUNT value, for detecting if the time-stamping source is
enabled. If using the OS periodic timer for time-stamping, this might not enabled. If using the OS periodic timer for time-stamping, this might not
have been configured on the earliest events during the startup. */ have been configured on the earliest events during the startup. */
uint32_t init_hwtc_count; uint32_t init_hwtc_count;
@ -2134,14 +2134,14 @@ RecorderDataType RecorderData;
/******************************************************************************* /*******************************************************************************
* RecorderDataPtr * RecorderDataPtr
* *
* Pointer to the main data structure, when in snapshot mode. * Pointer to the main data structure, when in snapshot mode.
******************************************************************************/ ******************************************************************************/
RecorderDataType* RecorderDataPtr = NULL; RecorderDataType* RecorderDataPtr = NULL;
/* This version of the function dynamically allocates the trace data */ /* This version of the function dynamically allocates the trace data */
void prvTraceInitTraceData() void prvTraceInitTraceData()
{ {
if (RecorderDataPtr == NULL) if (RecorderDataPtr == NULL)
{ {
#if (TRC_CFG_RECORDER_BUFFER_ALLOCATION == TRC_RECORDER_BUFFER_ALLOCATION_STATIC) #if (TRC_CFG_RECORDER_BUFFER_ALLOCATION == TRC_RECORDER_BUFFER_ALLOCATION_STATIC)
@ -2169,11 +2169,11 @@ void prvTraceInitTraceData()
return; return;
} }
} }
init_hwtc_count = TRC_HWTC_COUNT; init_hwtc_count = TRC_HWTC_COUNT;
(void)memset(RecorderDataPtr, 0, sizeof(RecorderDataType)); (void)memset(RecorderDataPtr, 0, sizeof(RecorderDataType));
RecorderDataPtr->version = TRACE_KERNEL_VERSION; RecorderDataPtr->version = TRACE_KERNEL_VERSION;
RecorderDataPtr->minor_version = TRACE_MINOR_VERSION; RecorderDataPtr->minor_version = TRACE_MINOR_VERSION;
RecorderDataPtr->irq_priority_order = TRC_IRQ_PRIORITY_ORDER; RecorderDataPtr->irq_priority_order = TRC_IRQ_PRIORITY_ORDER;
@ -2218,20 +2218,20 @@ void prvTraceInitTraceData()
/* Kernel specific initialization of the objectHandleStacks variable */ /* Kernel specific initialization of the objectHandleStacks variable */
vTraceInitObjectHandleStack(); vTraceInitObjectHandleStack();
/* Finally, the 12-byte "start markers" are initialized, allowing for /* Finally, the 12-byte "start markers" are initialized, allowing for
Tracealyzer to find the trace data in a larger RAM dump. Tracealyzer to find the trace data in a larger RAM dump.
The start and end markers must be unique, but without proper precautions there The start and end markers must be unique, but without proper precautions there
might be a risk of accidental duplicates of the start/end markers, e.g., due to might be a risk of accidental duplicates of the start/end markers, e.g., due to
compiler optimizations. compiler optimizations.
The below initialization of the start marker is therefore made in reverse order The below initialization of the start marker is therefore made in reverse order
and the fields are volatile to ensure this assignment order. This to avoid any and the fields are volatile to ensure this assignment order. This to avoid any
chance of accidental duplicates of this elsewhere in memory. chance of accidental duplicates of this elsewhere in memory.
Moreover, the fields are set byte-by-byte to avoid endian issues.*/ Moreover, the fields are set byte-by-byte to avoid endian issues.*/
RecorderDataPtr->startmarker11 = 0xF4; RecorderDataPtr->startmarker11 = 0xF4;
RecorderDataPtr->startmarker10 = 0xF3; RecorderDataPtr->startmarker10 = 0xF3;
RecorderDataPtr->startmarker9 = 0xF2; RecorderDataPtr->startmarker9 = 0xF2;
@ -2242,8 +2242,8 @@ void prvTraceInitTraceData()
RecorderDataPtr->startmarker4 = 0x71; RecorderDataPtr->startmarker4 = 0x71;
RecorderDataPtr->startmarker3 = 0x04; RecorderDataPtr->startmarker3 = 0x04;
RecorderDataPtr->startmarker2 = 0x03; RecorderDataPtr->startmarker2 = 0x03;
RecorderDataPtr->startmarker1 = 0x02; RecorderDataPtr->startmarker1 = 0x02;
RecorderDataPtr->startmarker0 = 0x01; RecorderDataPtr->startmarker0 = 0x01;
if (traceErrorMessage != NULL) if (traceErrorMessage != NULL)
{ {
@ -2254,7 +2254,7 @@ void prvTraceInitTraceData()
} }
#ifdef TRC_PORT_SPECIFIC_INIT #ifdef TRC_PORT_SPECIFIC_INIT
TRC_PORT_SPECIFIC_INIT(); TRC_PORT_SPECIFIC_INIT();
#endif #endif
@ -2280,15 +2280,15 @@ void* prvTraceNextFreeEventBufferSlot(void)
uint16_t uiIndexOfObject(traceHandle objecthandle, uint8_t objectclass) uint16_t uiIndexOfObject(traceHandle objecthandle, uint8_t objectclass)
{ {
TRACE_ASSERT(objectclass < TRACE_NCLASSES, TRACE_ASSERT(objectclass < TRACE_NCLASSES,
"uiIndexOfObject: Invalid value for objectclass", 0); "uiIndexOfObject: Invalid value for objectclass", 0);
TRACE_ASSERT(objecthandle > 0 && objecthandle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass], TRACE_ASSERT(objecthandle > 0 && objecthandle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass],
"uiIndexOfObject: Invalid value for objecthandle", 0); "uiIndexOfObject: Invalid value for objecthandle", 0);
if ((objectclass < TRACE_NCLASSES) && (objecthandle > 0) && if ((objectclass < TRACE_NCLASSES) && (objecthandle > 0) &&
(objecthandle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass])) (objecthandle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass]))
{ {
return (uint16_t)(RecorderDataPtr->ObjectPropertyTable.StartIndexOfClass[objectclass] + return (uint16_t)(RecorderDataPtr->ObjectPropertyTable.StartIndexOfClass[objectclass] +
(RecorderDataPtr->ObjectPropertyTable.TotalPropertyBytesPerClass[objectclass] * (objecthandle-1))); (RecorderDataPtr->ObjectPropertyTable.TotalPropertyBytesPerClass[objectclass] * (objecthandle-1)));
} }
@ -2304,8 +2304,8 @@ traceHandle prvTraceGetObjectHandle(traceObjectClass objectclass)
TRACE_ALLOC_CRITICAL_SECTION(); TRACE_ALLOC_CRITICAL_SECTION();
TRACE_ASSERT(RecorderDataPtr != NULL, "Recorder not initialized, call vTraceEnable() first!", (traceHandle)0); TRACE_ASSERT(RecorderDataPtr != NULL, "Recorder not initialized, call vTraceEnable() first!", (traceHandle)0);
TRACE_ASSERT(objectclass < TRACE_NCLASSES, TRACE_ASSERT(objectclass < TRACE_NCLASSES,
"prvTraceGetObjectHandle: Invalid value for objectclass", (traceHandle)0); "prvTraceGetObjectHandle: Invalid value for objectclass", (traceHandle)0);
trcCRITICAL_SECTION_BEGIN(); trcCRITICAL_SECTION_BEGIN();
@ -2352,9 +2352,9 @@ void prvTraceFreeObjectHandle(traceObjectClass objectclass, traceHandle handle)
{ {
int indexOfHandle; int indexOfHandle;
TRACE_ASSERT(objectclass < TRACE_NCLASSES, TRACE_ASSERT(objectclass < TRACE_NCLASSES,
"prvTraceFreeObjectHandle: Invalid value for objectclass", TRC_UNUSED); "prvTraceFreeObjectHandle: Invalid value for objectclass", TRC_UNUSED);
TRACE_ASSERT(handle > 0 && handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass], TRACE_ASSERT(handle > 0 && handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass],
"prvTraceFreeObjectHandle: Invalid value for handle", TRC_UNUSED); "prvTraceFreeObjectHandle: Invalid value for handle", TRC_UNUSED);
/* Check that there is room to push the handle on the stack */ /* Check that there is room to push the handle on the stack */
@ -2451,10 +2451,10 @@ traceString prvTraceOpenSymbol(const char* name, traceString userEventChannel)
uint8_t len; uint8_t len;
uint8_t crc; uint8_t crc;
TRACE_ALLOC_CRITICAL_SECTION(); TRACE_ALLOC_CRITICAL_SECTION();
len = 0; len = 0;
crc = 0; crc = 0;
TRACE_ASSERT(name != NULL, "prvTraceOpenSymbol: name == NULL", (traceString)0); TRACE_ASSERT(name != NULL, "prvTraceOpenSymbol: name == NULL", (traceString)0);
prvTraceGetChecksum(name, &crc, &len); prvTraceGetChecksum(name, &crc, &len);
@ -2557,7 +2557,7 @@ void prvCheckDataToBeOverwrittenForMultiEntryEvents(uint8_t nofEntriesToCheck)
unsigned int i = 0; unsigned int i = 0;
unsigned int e = 0; unsigned int e = 0;
TRACE_ASSERT(nofEntriesToCheck != 0, TRACE_ASSERT(nofEntriesToCheck != 0,
"prvCheckDataToBeOverwrittenForMultiEntryEvents: nofEntriesToCheck == 0", TRC_UNUSED); "prvCheckDataToBeOverwrittenForMultiEntryEvents: nofEntriesToCheck == 0", TRC_UNUSED);
while (i < nofEntriesToCheck) while (i < nofEntriesToCheck)
@ -2597,12 +2597,12 @@ void prvCheckDataToBeOverwrittenForMultiEntryEvents(uint8_t nofEntriesToCheck)
* Updates the index of the event buffer. * Updates the index of the event buffer.
******************************************************************************/ ******************************************************************************/
void prvTraceUpdateCounters(void) void prvTraceUpdateCounters(void)
{ {
if (RecorderDataPtr->recorderActive == 0) if (RecorderDataPtr->recorderActive == 0)
{ {
return; return;
} }
RecorderDataPtr->numEvents++; RecorderDataPtr->numEvents++;
RecorderDataPtr->nextFreeIndex++; RecorderDataPtr->nextFreeIndex++;
@ -2641,34 +2641,34 @@ uint16_t prvTraceGetDTS(uint16_t param_maxDTS)
TRACE_ASSERT(param_maxDTS == 0xFF || param_maxDTS == 0xFFFF, "prvTraceGetDTS: Invalid value for param_maxDTS", 0); TRACE_ASSERT(param_maxDTS == 0xFF || param_maxDTS == 0xFFFF, "prvTraceGetDTS: Invalid value for param_maxDTS", 0);
if (RecorderDataPtr->frequency == 0) if (RecorderDataPtr->frequency == 0)
{ {
if (timestampFrequency != 0) if (timestampFrequency != 0)
{ {
/* If to override default TRC_HWTC_FREQ_HZ value with value set by vTraceSetFrequency */ /* If to override default TRC_HWTC_FREQ_HZ value with value set by vTraceSetFrequency */
RecorderDataPtr->frequency = timestampFrequency / (TRC_HWTC_DIVISOR); RecorderDataPtr->frequency = timestampFrequency / (TRC_HWTC_DIVISOR);
} }
else if (init_hwtc_count != (TRC_HWTC_COUNT)) else if (init_hwtc_count != (TRC_HWTC_COUNT))
{ {
/* If using default value and timer has been started. /* If using default value and timer has been started.
Note: If the default frequency value set here would be incorrect, e.g., Note: If the default frequency value set here would be incorrect, e.g.,
if the timer has actually not been configured yet, override this if the timer has actually not been configured yet, override this
with vTraceSetFrequency. with vTraceSetFrequency.
*/ */
RecorderDataPtr->frequency = (TRC_HWTC_FREQ_HZ) / (TRC_HWTC_DIVISOR); RecorderDataPtr->frequency = (TRC_HWTC_FREQ_HZ) / (TRC_HWTC_DIVISOR);
} }
/* If no override (vTraceSetFrequency) and timer inactive -> no action */ /* If no override (vTraceSetFrequency) and timer inactive -> no action */
} }
/************************************************************************** /**************************************************************************
* The below statements read the timestamp from the timer port module. * The below statements read the timestamp from the timer port module.
* If necessary, whole seconds are extracted using division while the rest * If necessary, whole seconds are extracted using division while the rest
* comes from the modulo operation. * comes from the modulo operation.
**************************************************************************/ **************************************************************************/
prvTracePortGetTimeStamp(&timestamp); prvTracePortGetTimeStamp(&timestamp);
/*************************************************************************** /***************************************************************************
* Since dts is unsigned the result will be correct even if timestamp has * Since dts is unsigned the result will be correct even if timestamp has
* wrapped around. * wrapped around.
@ -2878,14 +2878,14 @@ void prvTraceGetChecksum(const char *pname, uint8_t* pcrc, uint8_t* plength)
#if (TRC_CFG_USE_16BIT_OBJECT_HANDLES == 1) #if (TRC_CFG_USE_16BIT_OBJECT_HANDLES == 1)
static void prvTraceStoreXID(traceHandle handle); static void prvTraceStoreXID(traceHandle handle);
/****************************************************************************** /******************************************************************************
* prvTraceStoreXID * prvTraceStoreXID
* *
* Stores an XID (eXtended IDentifier) event. * Stores an XID (eXtended IDentifier) event.
* This is used if an object/task handle is larger than 255. * This is used if an object/task handle is larger than 255.
* The parameter "handle" is the full (16 bit) handle, assumed to be 256 or * The parameter "handle" is the full (16 bit) handle, assumed to be 256 or
* larger. Handles below 256 should not use this function. * larger. Handles below 256 should not use this function.
* *
* NOTE: this function MUST be called from within a critical section. * NOTE: this function MUST be called from within a critical section.
@ -2903,7 +2903,7 @@ static void prvTraceStoreXID(traceHandle handle)
xid->type = XID; xid->type = XID;
/* This function is (only) used when traceHandle is 16 bit... */ /* This function is (only) used when traceHandle is 16 bit... */
xid->xps_16 = handle; xid->xps_16 = handle;
prvTraceUpdateCounters(); prvTraceUpdateCounters();
} }
@ -2912,11 +2912,11 @@ static void prvTraceStoreXID(traceHandle handle)
static uint8_t prvTraceGet8BitHandle(traceHandle handle) static uint8_t prvTraceGet8BitHandle(traceHandle handle)
{ {
if (handle > 255) if (handle > 255)
{ {
prvTraceStoreXID(handle); prvTraceStoreXID(handle);
/* The full handle (16 bit) is stored in the XID event. /* The full handle (16 bit) is stored in the XID event.
This code (255) is used instead of zero (which is an error code).*/ This code (255) is used instead of zero (which is an error code).*/
return 255; return 255;
} }
return (uint8_t)(handle & 0xFF); return (uint8_t)(handle & 0xFF);
} }
@ -2939,15 +2939,15 @@ void prvTraceInitCortexM()
if (TRC_REG_DEMCR == 0) if (TRC_REG_DEMCR == 0)
{ {
/* This function is called on Cortex-M3, M4 and M7 devices to initialize /* This function is called on Cortex-M3, M4 and M7 devices to initialize
the DWT unit, assumed present. The DWT cycle counter is used for timestamping. the DWT unit, assumed present. The DWT cycle counter is used for timestamping.
If the below error is produced, the DWT unit does not seem to be available. If the below error is produced, the DWT unit does not seem to be available.
In that case, define the macro TRC_CFG_ARM_CM_USE_SYSTICK in your build In that case, define the macro TRC_CFG_ARM_CM_USE_SYSTICK in your build
to use SysTick timestamping instead, or define your own timestamping by to use SysTick timestamping instead, or define your own timestamping by
setting TRC_CFG_HARDWARE_PORT to TRC_HARDWARE_PORT_APPLICATION_DEFINED setting TRC_CFG_HARDWARE_PORT to TRC_HARDWARE_PORT_APPLICATION_DEFINED
and make the necessary definitions, as explained in trcHardwarePort.h.*/ and make the necessary definitions, as explained in trcHardwarePort.h.*/
prvTraceError("DWT unit not available, see code comment."); prvTraceError("DWT unit not available, see code comment.");
break; break;
} }
@ -2956,12 +2956,12 @@ void prvTraceInitCortexM()
if (TRC_REG_DWT_CTRL & TRC_DWT_CTRL_NOCYCCNT) if (TRC_REG_DWT_CTRL & TRC_DWT_CTRL_NOCYCCNT)
{ {
/* This function is called on Cortex-M3, M4 and M7 devices to initialize /* This function is called on Cortex-M3, M4 and M7 devices to initialize
the DWT unit, assumed present. The DWT cycle counter is used for timestamping. the DWT unit, assumed present. The DWT cycle counter is used for timestamping.
If the below error is produced, the cycle counter does not seem to be available. If the below error is produced, the cycle counter does not seem to be available.
In that case, define the macro TRC_CFG_ARM_CM_USE_SYSTICK in your build In that case, define the macro TRC_CFG_ARM_CM_USE_SYSTICK in your build
to use SysTick timestamping instead, or define your own timestamping by to use SysTick timestamping instead, or define your own timestamping by
setting TRC_CFG_HARDWARE_PORT to TRC_HARDWARE_PORT_APPLICATION_DEFINED setting TRC_CFG_HARDWARE_PORT to TRC_HARDWARE_PORT_APPLICATION_DEFINED
and make the necessary definitions, as explained in trcHardwarePort.h.*/ and make the necessary definitions, as explained in trcHardwarePort.h.*/
@ -3071,20 +3071,20 @@ void prvTracePortGetTimeStamp(uint32_t *pTimestamp)
} }
/* Store the previous value */ /* Store the previous value */
last_traceTickCount = traceTickCount; last_traceTickCount = traceTickCount;
#else /*(TRC_HWTC_TYPE == TRC_OS_TIMER_INCR || TRC_HWTC_TYPE == TRC_OS_TIMER_DECR)*/ #else /*(TRC_HWTC_TYPE == TRC_OS_TIMER_INCR || TRC_HWTC_TYPE == TRC_OS_TIMER_DECR)*/
/* Timestamping is based on a free running timer */ /* Timestamping is based on a free running timer */
/* This part handles free running clocks that can be scaled down to avoid too large DTS values. /* This part handles free running clocks that can be scaled down to avoid too large DTS values.
Without this, the scaled timestamp will incorrectly wrap at (2^32 / TRC_HWTC_DIVISOR) ticks. Without this, the scaled timestamp will incorrectly wrap at (2^32 / TRC_HWTC_DIVISOR) ticks.
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. */ 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. */
/* 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. */ /* 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. */
diff = (hwtc_count - last_hwtc_count) + last_hwtc_rest; diff = (hwtc_count - last_hwtc_count) + last_hwtc_rest;
/* Scale down the diff */ /* Scale down the diff */
diff_scaled = diff / (TRC_HWTC_DIVISOR); diff_scaled = diff / (TRC_HWTC_DIVISOR);
/* Find out how many ticks were lost when scaling down, so we can add them the next time */ /* Find out how many ticks were lost when scaling down, so we can add them the next time */
last_hwtc_rest = diff % (TRC_HWTC_DIVISOR); last_hwtc_rest = diff % (TRC_HWTC_DIVISOR);

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v4.1.1 * Trace Recorder Library for Tracealyzer v4.1.5
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcStreamingRecorder.c * trcStreamingRecorder.c
@ -48,6 +48,9 @@
#if (TRC_USE_TRACEALYZER_RECORDER == 1) #if (TRC_USE_TRACEALYZER_RECORDER == 1)
#include <stdio.h>
#include <stdarg.h>
typedef struct{ typedef struct{
uint16_t EventID; uint16_t EventID;
uint16_t EventCount; uint16_t EventCount;
@ -174,9 +177,6 @@ static uint16_t FormatVersion = 0x0004;
/* The number of events stored. Used as event sequence number. */ /* The number of events stored. Used as event sequence number. */
static uint32_t eventCounter = 0; static uint32_t eventCounter = 0;
/* The user event channel for recorder warnings, defined in trcKernelPort.c */
extern char* trcWarningChannel;
/* Remembers if an earlier ISR in a sequence of adjacent ISRs has triggered a task switch. /* Remembers if an earlier ISR in a sequence of adjacent ISRs has triggered a task switch.
In that case, vTraceStoreISREnd does not store a return to the previously executing task. */ In that case, vTraceStoreISREnd does not store a return to the previously executing task. */
int32_t isPendingContextSwitch = 0; int32_t isPendingContextSwitch = 0;
@ -399,6 +399,37 @@ void vTracePrint(traceString chn, const char* str)
prvTraceStoreSimpleStringEventHelper(chn, str); prvTraceStoreSimpleStringEventHelper(chn, str);
} }
/*******************************************************************************
* vTraceConsoleChannelPrintF
*
* Wrapper for vTracePrint, using the default channel. Can be used as a drop-in
* replacement for printf and similar functions, e.g. in a debug logging macro.
*
* Example:
*
* // Old: #define LogString debug_console_printf
*
* // New, log to Tracealyzer instead:
* #define LogString vTraceConsoleChannelPrintF
* ...
* LogString("My value is: %d", myValue);
******************************************************************************/
void vTraceConsoleChannelPrintF(const char* fmt, ...)
{
va_list vl;
char tempBuf[60];
static traceString consoleChannel = NULL;
if (consoleChannel == NULL)
consoleChannel = xTraceRegisterString("Debug Console");
va_start(vl, fmt);
vsnprintf(tempBuf, 60, fmt, vl);
vTracePrint(consoleChannel, tempBuf);
va_end(vl);
}
/****************************************************************************** /******************************************************************************
* vTracePrintF * vTracePrintF
* *

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v3.1.2 * Trace Recorder Library for Tracealyzer v4.1.4
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcConfig.h * trcConfig.h
@ -41,7 +41,7 @@
* *
* Tabs are used for indent in this file (1 tab = 4 spaces) * Tabs are used for indent in this file (1 tab = 4 spaces)
* *
* Copyright Percepio AB, 2016. * Copyright Percepio AB, 2018.
* www.percepio.com * www.percepio.com
******************************************************************************/ ******************************************************************************/
@ -105,7 +105,7 @@ extern "C" {
* trace recorder library with an older version of FreeRTOS). * trace recorder library with an older version of FreeRTOS).
* *
* TRC_FREERTOS_VERSION_7_3 If using FreeRTOS v7.3.x * TRC_FREERTOS_VERSION_7_3 If using FreeRTOS v7.3.x
* TRC_FREERTOS_VERSION_7_4 If using FreeRTOS v7.4.x * TRC_FREERTOS_VERSION_7_4 If using FreeRTOS v7.4.x
* TRC_FREERTOS_VERSION_7_5_OR_7_6 If using FreeRTOS v7.5.0 - v7.6.0 * TRC_FREERTOS_VERSION_7_5_OR_7_6 If using FreeRTOS v7.5.0 - v7.6.0
* TRC_FREERTOS_VERSION_8_X If using FreeRTOS v8.X.X * TRC_FREERTOS_VERSION_8_X If using FreeRTOS v8.X.X
* TRC_FREERTOS_VERSION_9_0_0 If using FreeRTOS v9.0.0 * TRC_FREERTOS_VERSION_9_0_0 If using FreeRTOS v9.0.0
@ -144,13 +144,13 @@ extern "C" {
* *
* Macro which should be defined as either zero (0) or one (1). * Macro which should be defined as either zero (0) or one (1).
* *
* If this is zero (0), all code related to User Events is excluded in order * If this is zero (0), all code related to User Events is excluded in order
* to reduce code size. Any attempts of storing User Events are then silently * to reduce code size. Any attempts of storing User Events are then silently
* ignored. * ignored.
* *
* User Events are application-generated events, like "printf" but for the * User Events are application-generated events, like "printf" but for the
* trace log, generated using vTracePrint and vTracePrintF. * trace log, generated using vTracePrint and vTracePrintF.
* The formatting is done on host-side, by Tracealyzer. User Events are * The formatting is done on host-side, by Tracealyzer. User Events are
* therefore much faster than a console printf and can often be used * therefore much faster than a console printf and can often be used
* in timing critical code without problems. * in timing critical code without problems.
* *
@ -234,7 +234,7 @@ extern "C" {
* *
* Macro which should be defined as either zero (0) or one (1). * Macro which should be defined as either zero (0) or one (1).
* *
* If this is zero (0), the trace will exclude any "pending function call" * If this is zero (0), the trace will exclude any "pending function call"
* events, such as xTimerPendFunctionCall(). * events, such as xTimerPendFunctionCall().
* *
* Default value is 0 since dependent on timers.c * Default value is 0 since dependent on timers.c

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Trace Recorder Library for Tracealyzer v3.1.2 * Trace Recorder Library for Tracealyzer v4.1.4
* Percepio AB, www.percepio.com * Percepio AB, www.percepio.com
* *
* trcSnapshotConfig.h * trcSnapshotConfig.h
@ -39,7 +39,7 @@
* *
* Tabs are used for indent in this file (1 tab = 4 spaces) * Tabs are used for indent in this file (1 tab = 4 spaces)
* *
* Copyright Percepio AB, 2017. * Copyright Percepio AB, 2018.
* www.percepio.com * www.percepio.com
******************************************************************************/ ******************************************************************************/
@ -113,8 +113,8 @@
#define TRC_CFG_NMUTEX 90 #define TRC_CFG_NMUTEX 90
#define TRC_CFG_NTIMER 250 #define TRC_CFG_NTIMER 250
#define TRC_CFG_NEVENTGROUP 90 #define TRC_CFG_NEVENTGROUP 90
#define TRC_CFG_NSTREAMBUFFER 5 #define TRC_CFG_NSTREAMBUFFER 50
#define TRC_CFG_NMESSAGEBUFFER 5 #define TRC_CFG_NMESSAGEBUFFER 50
/****************************************************************************** /******************************************************************************

View file

@ -24,8 +24,6 @@
* *
* 1 tab == 4 spaces! * 1 tab == 4 spaces!
*/ */
#ifndef FREERTOS_CONFIG_H #ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H #define FREERTOS_CONFIG_H
@ -140,6 +138,9 @@ used with multiple project configurations. If it is
/* Allows tests of trying to allocate more than the heap has free. */ /* Allows tests of trying to allocate more than the heap has free. */
#define configUSE_MALLOC_FAILED_HOOK 0 #define configUSE_MALLOC_FAILED_HOOK 0
/* To test builds that remove the static qualifier for debug builds. */
#define portREMOVE_STATIC_QUALIFIER
#else #else
/* It is a good idea to define configASSERT() while developing. configASSERT() /* It is a good idea to define configASSERT() while developing. configASSERT()
uses the same semantics as the standard C assert() macro. Don't define uses the same semantics as the standard C assert() macro. Don't define

View file

@ -73,8 +73,8 @@ or interrupt version of the queue send function should be used. */
* reference the subject timer in calls to other software timer API functions * reference the subject timer in calls to other software timer API functions
* (for example, xTimerStart(), xTimerReset(), etc.). * (for example, xTimerStart(), xTimerReset(), etc.).
*/ */
struct TimerDef_t; struct tmrTimerControl;
typedef struct TimerDef_t * TimerHandle_t; typedef struct tmrTimerControl * TimerHandle_t;
/* /*
* Defines the prototype to which timer callback functions must conform. * Defines the prototype to which timer callback functions must conform.

View file

@ -399,6 +399,13 @@ when the scheduler is unsuspended. The pending ready list itself can only be
accessed from a critical section. */ accessed from a critical section. */
PRIVILEGED_DATA static volatile UBaseType_t uxSchedulerSuspended = ( UBaseType_t ) pdFALSE; PRIVILEGED_DATA static volatile UBaseType_t uxSchedulerSuspended = ( UBaseType_t ) pdFALSE;
#if ( configGENERATE_RUN_TIME_STATS == 1 )
PRIVILEGED_DATA static uint32_t ulTaskSwitchedInTime = 0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */
PRIVILEGED_DATA static uint32_t ulTotalRunTime = 0UL; /*< Holds the total amount of execution time as defined by the run time counter clock. */
#endif
/*lint -restore */ /*lint -restore */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -2900,9 +2907,6 @@ void vTaskSwitchContext( void )
#if ( configGENERATE_RUN_TIME_STATS == 1 ) #if ( configGENERATE_RUN_TIME_STATS == 1 )
{ {
PRIVILEGED_DATA static uint32_t ulTaskSwitchedInTime = 0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */
PRIVILEGED_DATA static uint32_t ulTotalRunTime = 0UL; /*< Holds the total amount of execution time as defined by the run time counter clock. */
#ifdef portALT_GET_RUN_TIME_COUNTER_VALUE #ifdef portALT_GET_RUN_TIME_COUNTER_VALUE
portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalRunTime ); portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalRunTime );
#else #else

View file

@ -65,7 +65,7 @@ defining trmTIMER_SERVICE_TASK_NAME in FreeRTOSConfig.h. */
#endif #endif
/* The definition of the timers themselves. */ /* The definition of the timers themselves. */
typedef struct TimerDef_t typedef struct tmrTimerControl
{ {
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. */ 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. */
ListItem_t xTimerListItem; /*<< Standard linked list item as used by all kernel features for event management. */ ListItem_t xTimerListItem; /*<< Standard linked list item as used by all kernel features for event management. */