mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-07 05:34:59 -05:00
Fix getting stats on the current running task running time via vTaskGetInfo. This is especially important if the current task is stuck
This commit is contained in:
parent
93e8199078
commit
7d8ab35485
1 changed files with 10 additions and 0 deletions
10
tasks.c
10
tasks.c
|
|
@ -6171,6 +6171,16 @@ static void prvCheckTasksWaitingTermination( void )
|
|||
#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
||||
{
|
||||
pxTaskStatus->ulRunTimeCounter = pxTCB->ulRunTimeCounter;
|
||||
if( pxTCB == pxCurrentTCB )
|
||||
{
|
||||
uint32_t ulCurrentTotalRunTime;
|
||||
#ifdef portALT_GET_RUN_TIME_COUNTER_VALUE
|
||||
portALT_GET_RUN_TIME_COUNTER_VALUE( ulCurrentTotalRunTime );
|
||||
#else
|
||||
ulCurrentTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE();
|
||||
#endif
|
||||
pxTaskStatus->ulRunTimeCounter += ( ulCurrentTotalRunTime - ulTaskSwitchedInTime );
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue