| 3268 | #if ( configUSE_TRACE_FACILITY == 1 ) |
| 3269 | |
| 3270 | UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray, |
| 3271 | const UBaseType_t uxArraySize, |
| 3272 | uint32_t * const pulTotalRunTime ) |
| 3273 | { |
| 3274 | UBaseType_t uxTask = 0, uxQueue = configMAX_PRIORITIES; |
| 3275 | |
| 3276 | vTaskSuspendAll(); |
| 3277 | { |
| 3278 | /* Is there a space in the array for each task in the system? */ |
| 3279 | if( uxArraySize >= uxCurrentNumberOfTasks ) |
| 3280 | { |
| 3281 | /* Fill in an TaskStatus_t structure with information on each |
| 3282 | * task in the Ready state. */ |
| 3283 | do |
| 3284 | { |
| 3285 | uxQueue--; |
| 3286 | uxTask += prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), &( pxReadyTasksLists[ uxQueue ] ), eReady ); |
| 3287 | } while( uxQueue > ( UBaseType_t ) tskIDLE_PRIORITY ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */ |
| 3288 | |
| 3289 | /* Fill in an TaskStatus_t structure with information on each |
| 3290 | * task in the Blocked state. */ |
| 3291 | uxTask += prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), ( List_t * ) pxDelayedTaskList, eBlocked ); |
| 3292 | uxTask += prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), ( List_t * ) pxOverflowDelayedTaskList, eBlocked ); |
| 3293 | |
| 3294 | #if ( INCLUDE_vTaskDelete == 1 ) |
| 3295 | { |
| 3296 | /* Fill in an TaskStatus_t structure with information on |
| 3297 | * each task that has been deleted but not yet cleaned up. */ |
| 3298 | uxTask += prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), &xTasksWaitingTermination, eDeleted ); |
| 3299 | } |
| 3300 | #endif |
| 3301 | |
| 3302 | #if ( INCLUDE_vTaskSuspend == 1 ) |
| 3303 | { |
| 3304 | /* Fill in an TaskStatus_t structure with information on |
| 3305 | * each task in the Suspended state. */ |
| 3306 | uxTask += prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), &xSuspendedTaskList, eSuspended ); |
| 3307 | } |
| 3308 | #endif |
| 3309 | |
| 3310 | #if ( configGENERATE_RUN_TIME_STATS == 1 ) |
| 3311 | { |
| 3312 | if( pulTotalRunTime != NULL ) |
| 3313 | { |
| 3314 | #ifdef portALT_GET_RUN_TIME_COUNTER_VALUE |
| 3315 | portALT_GET_RUN_TIME_COUNTER_VALUE( ( *pulTotalRunTime ) ); |
| 3316 | #else |
| 3317 | *pulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE(); |
| 3318 | #endif |
| 3319 | } |
| 3320 | } |
| 3321 | #else /* if ( configGENERATE_RUN_TIME_STATS == 1 ) */ |
| 3322 | { |
| 3323 | if( pulTotalRunTime != NULL ) |
| 3324 | { |
| 3325 | *pulTotalRunTime = 0; |
| 3326 | } |
| 3327 | } |
no test coverage detected