diff --git a/components/app_trace/sys_view/Sample/OS/SEGGER_SYSVIEW_FreeRTOS.h b/components/app_trace/sys_view/Sample/OS/SEGGER_SYSVIEW_FreeRTOS.h index 47624de258..aba3bd3ea3 100644 --- a/components/app_trace/sys_view/Sample/OS/SEGGER_SYSVIEW_FreeRTOS.h +++ b/components/app_trace/sys_view/Sample/OS/SEGGER_SYSVIEW_FreeRTOS.h @@ -209,7 +209,7 @@ Notes: #define apiID_VEVENTGROUPDELETE (72u) #define apiID_UXEVENTGROUPGETNUMBER (73u) -#define traceTASK_NOTIFY_TAKE() SEGGER_SYSVIEW_RecordU32x2(apiFastID_OFFSET + apiID_ULTASKNOTIFYTAKE, xClearCountOnExit, xTicksToWait) +#define traceTASK_NOTIFY_TAKE( uxIndexToWait ) SEGGER_SYSVIEW_RecordU32x2(apiFastID_OFFSET + apiID_ULTASKNOTIFYTAKE, xClearCountOnExit, xTicksToWait) #define traceTASK_DELAY() SEGGER_SYSVIEW_RecordU32(apiFastID_OFFSET + apiID_VTASKDELAY, xTicksToDelay) #define traceTASK_DELAY_UNTIL() SEGGER_SYSVIEW_RecordVoid(apiFastID_OFFSET + apiID_VTASKDELAYUNTIL) #define traceTASK_DELETE( pxTCB ) if (pxTCB != NULL) { \ @@ -217,16 +217,16 @@ Notes: SEGGER_SYSVIEW_ShrinkId((U32)pxTCB)); \ SYSVIEW_DeleteTask((U32)pxTCB); \ } -#define traceTASK_NOTIFY_GIVE_FROM_ISR() SEGGER_SYSVIEW_RecordU32x2(apiFastID_OFFSET + apiID_VTASKNOTIFYGIVEFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), (U32)pxHigherPriorityTaskWoken) +#define traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify ) SEGGER_SYSVIEW_RecordU32x2(apiFastID_OFFSET + apiID_VTASKNOTIFYGIVEFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), (U32)pxHigherPriorityTaskWoken) #define traceTASK_PRIORITY_INHERIT( pxTCB, uxPriority ) SEGGER_SYSVIEW_RecordU32(apiFastID_OFFSET + apiID_VTASKPRIORITYINHERIT, (U32)pxMutexHolder) #define traceTASK_RESUME( pxTCB ) SEGGER_SYSVIEW_RecordU32(apiFastID_OFFSET + apiID_VTASKRESUME, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB)) #define traceINCREASE_TICK_COUNT( xTicksToJump ) SEGGER_SYSVIEW_RecordU32(apiFastID_OFFSET + apiID_VTASKSTEPTICK, xTicksToJump) #define traceTASK_SUSPEND( pxTCB ) SEGGER_SYSVIEW_RecordU32(apiFastID_OFFSET + apiID_VTASKSUSPEND, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB)) #define traceTASK_PRIORITY_DISINHERIT( pxTCB, uxBasePriority ) SEGGER_SYSVIEW_RecordU32(apiFastID_OFFSET + apiID_XTASKPRIORITYDISINHERIT, (U32)pxMutexHolder) #define traceTASK_RESUME_FROM_ISR( pxTCB ) SEGGER_SYSVIEW_RecordU32(apiFastID_OFFSET + apiID_XTASKRESUMEFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB)) -#define traceTASK_NOTIFY() SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XTASKGENERICNOTIFY, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), ulValue, eAction, (U32)pulPreviousNotificationValue) -#define traceTASK_NOTIFY_FROM_ISR() SYSVIEW_RecordU32x5(apiFastID_OFFSET + apiID_XTASKGENERICNOTIFYFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), ulValue, eAction, (U32)pulPreviousNotificationValue, (U32)pxHigherPriorityTaskWoken) -#define traceTASK_NOTIFY_WAIT() SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XTASKNOTIFYWAIT, ulBitsToClearOnEntry, ulBitsToClearOnExit, (U32)pulNotificationValue, xTicksToWait) +#define traceTASK_NOTIFY( uxIndexToNotify ) SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XTASKGENERICNOTIFY, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), ulValue, eAction, (U32)pulPreviousNotificationValue) +#define traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify ) SYSVIEW_RecordU32x5(apiFastID_OFFSET + apiID_XTASKGENERICNOTIFYFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), ulValue, eAction, (U32)pulPreviousNotificationValue, (U32)pxHigherPriorityTaskWoken) +#define traceTASK_NOTIFY_WAIT( uxIndexToWait ) SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XTASKNOTIFYWAIT, ulBitsToClearOnEntry, ulBitsToClearOnExit, (U32)pulNotificationValue, xTicksToWait) #define traceQUEUE_CREATE( pxNewQueue ) SEGGER_SYSVIEW_RecordU32x3(apiFastID_OFFSET + apiID_XQUEUEGENERICCREATE, uxQueueLength, uxItemSize, ucQueueType) #define traceQUEUE_DELETE( pxQueue ) SEGGER_SYSVIEW_RecordU32(apiFastID_OFFSET + apiID_VQUEUEDELETE, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue)) diff --git a/components/freertos/include/freertos/FreeRTOS.h b/components/freertos/include/freertos/FreeRTOS.h index 20e0d9e22a..15ecf745e4 100644 --- a/components/freertos/include/freertos/FreeRTOS.h +++ b/components/freertos/include/freertos/FreeRTOS.h @@ -278,6 +278,10 @@ #define portMEMORY_BARRIER() #endif +#ifndef portSOFTWARE_BARRIER + #define portSOFTWARE_BARRIER() +#endif + /* The timers module relies on xTaskGetSchedulerState(). */ #if configUSE_TIMERS == 1 @@ -483,9 +487,15 @@ #define traceCREATE_COUNTING_SEMAPHORE_FAILED() #endif +#ifndef traceQUEUE_SET_SEND + #define traceQUEUE_SET_SEND traceQUEUE_SEND +#endif + +#ifdef ESP_PLATFORM #ifndef traceQUEUE_SEMAPHORE_RECEIVE #define traceQUEUE_SEMAPHORE_RECEIVE( pxQueue ) #endif +#endif // ESP_PLATFORM #ifndef traceQUEUE_SEND #define traceQUEUE_SEND( pxQueue ) @@ -539,6 +549,7 @@ #define traceQUEUE_DELETE( pxQueue ) #endif +#ifdef ESP_PLATFORM #ifndef traceQUEUE_GIVE_FROM_ISR #define traceQUEUE_GIVE_FROM_ISR( pxQueue ) #endif @@ -546,6 +557,7 @@ #ifndef traceQUEUE_GIVE_FROM_ISR_FAILED #define traceQUEUE_GIVE_FROM_ISR_FAILED( pxQueue ) #endif +#endif // ESP_PLATFORM #ifndef traceTASK_CREATE #define traceTASK_CREATE( pxNewTCB ) @@ -672,31 +684,31 @@ #endif #ifndef traceTASK_NOTIFY_TAKE_BLOCK - #define traceTASK_NOTIFY_TAKE_BLOCK() + #define traceTASK_NOTIFY_TAKE_BLOCK( uxIndexToWait ) #endif #ifndef traceTASK_NOTIFY_TAKE - #define traceTASK_NOTIFY_TAKE() + #define traceTASK_NOTIFY_TAKE( uxIndexToWait ) #endif #ifndef traceTASK_NOTIFY_WAIT_BLOCK - #define traceTASK_NOTIFY_WAIT_BLOCK() + #define traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWait ) #endif #ifndef traceTASK_NOTIFY_WAIT - #define traceTASK_NOTIFY_WAIT() + #define traceTASK_NOTIFY_WAIT( uxIndexToWait ) #endif #ifndef traceTASK_NOTIFY - #define traceTASK_NOTIFY() + #define traceTASK_NOTIFY( uxIndexToNotify ) #endif #ifndef traceTASK_NOTIFY_FROM_ISR - #define traceTASK_NOTIFY_FROM_ISR() + #define traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify ) #endif #ifndef traceTASK_NOTIFY_GIVE_FROM_ISR - #define traceTASK_NOTIFY_GIVE_FROM_ISR() + #define traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify ) #endif #ifndef traceSTREAM_BUFFER_CREATE_FAILED @@ -751,6 +763,7 @@ #define traceSTREAM_BUFFER_RECEIVE_FROM_ISR( xStreamBuffer, xReceivedLength ) #endif +#ifdef ESP_PLATFORM #ifndef traceISR_EXIT_TO_SCHEDULER #define traceISR_EXIT_TO_SCHEDULER() #endif @@ -762,6 +775,7 @@ #ifndef traceISR_ENTER #define traceISR_ENTER(_n_) #endif +#endif // ESP_PLATFORM #ifndef configGENERATE_RUN_TIME_STATS #define configGENERATE_RUN_TIME_STATS 0 diff --git a/components/freertos/tasks.c b/components/freertos/tasks.c index d395ed0726..3ce9f9d33a 100644 --- a/components/freertos/tasks.c +++ b/components/freertos/tasks.c @@ -5349,7 +5349,7 @@ TickType_t uxTaskResetEventItemValue( void ) if( xTicksToWait > ( TickType_t ) 0 ) { prvAddCurrentTaskToDelayedList( xPortGetCoreID(), xTicksToWait ); - traceTASK_NOTIFY_TAKE_BLOCK(); + traceTASK_NOTIFY_TAKE_BLOCK( uxIndexToWait ); /* All ports are written to allow a yield in a critical * section (some will yield immediately, others wait until the @@ -5371,7 +5371,7 @@ TickType_t uxTaskResetEventItemValue( void ) taskENTER_CRITICAL(); { - traceTASK_NOTIFY_TAKE(); + traceTASK_NOTIFY_TAKE( uxIndexToWait ); ulReturn = pxCurrentTCB[xPortGetCoreID()]->ulNotifiedValue[ uxIndexToWait ]; if( ulReturn != 0UL ) @@ -5439,7 +5439,7 @@ TickType_t uxTaskResetEventItemValue( void ) if( xTicksToWait > ( TickType_t ) 0 ) { prvAddCurrentTaskToDelayedList( xPortGetCoreID(), xTicksToWait); - traceTASK_NOTIFY_WAIT_BLOCK(); + traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWait ); /* All ports are written to allow a yield in a critical * section (some will yield immediately, others wait until the @@ -5461,7 +5461,7 @@ TickType_t uxTaskResetEventItemValue( void ) taskENTER_CRITICAL(); { - traceTASK_NOTIFY_WAIT(); + traceTASK_NOTIFY_WAIT( uxIndexToWait ); if( pulNotificationValue != NULL ) { @@ -5568,7 +5568,7 @@ TickType_t uxTaskResetEventItemValue( void ) break; } - traceTASK_NOTIFY(); + traceTASK_NOTIFY( uxIndexToNotify ); /* If the task is in the blocked state specifically to wait for a * notification then unblock it now. */ @@ -5713,7 +5713,7 @@ TickType_t uxTaskResetEventItemValue( void ) break; } - traceTASK_NOTIFY_FROM_ISR(); + traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify ); /* If the task is in the blocked state specifically to wait for a * notification then unblock it now. */ @@ -5803,7 +5803,7 @@ TickType_t uxTaskResetEventItemValue( void ) * semaphore. */ ( pxTCB->ulNotifiedValue[ uxIndexToNotify ] )++; - traceTASK_NOTIFY_GIVE_FROM_ISR(); + traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify ); /* If the task is in the blocked state specifically to wait for a * notification then unblock it now. */