Added: display xCoreID in vTaskList

Merges https://github.com/espressif/esp-idf/pull/2064
This commit is contained in:
Dave McNaughton 2018-06-14 20:37:52 +10:00 committed by bot
parent ea452920bb
commit 0fb1945482
3 changed files with 14 additions and 0 deletions

View File

@ -305,6 +305,14 @@ config FREERTOS_USE_STATS_FORMATTING_FUNCTIONS
FreeRTOS. This will allow the usage of stats formatting functions such
as vTaskList().
config FREERTOS_VTASKLIST_INCLUDE_COREID
bool "Enable display of xCoreID in vTaskList"
depends on FREERTOS_USE_STATS_FORMATTING_FUNCTIONS
default n
help
If enabled, this will include an extra column when vTaskList is called
to display the CoreID the task is pinned to (0,1) or -1 if not pinned.
config FREERTOS_GENERATE_RUN_TIME_STATS
bool "Enable FreeRTOS to collect run time stats"
default n

View File

@ -181,6 +181,7 @@ typedef struct xTASK_STATUS
uint32_t ulRunTimeCounter; /*!< The total run time allocated to the task so far, as defined by the run time stats clock. See http://www.freertos.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */
StackType_t *pxStackBase; /*!< Points to the lowest address of the task's stack area. */
uint32_t usStackHighWaterMark; /*!< The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */
BaseType_t xCoreID; /*!< Core this task is pinned to */
} TaskStatus_t;
/**

View File

@ -3784,6 +3784,7 @@ BaseType_t xTaskGetAffinity( TaskHandle_t xTask )
pxTaskStatusArray[ uxTask ].xTaskNumber = pxNextTCB->uxTCBNumber;
pxTaskStatusArray[ uxTask ].eCurrentState = eState;
pxTaskStatusArray[ uxTask ].uxCurrentPriority = pxNextTCB->uxPriority;
pxTaskStatusArray[ uxTask ].xCoreID = pxNextTCB->xCoreID;
#if ( INCLUDE_vTaskSuspend == 1 )
{
@ -4449,7 +4450,11 @@ For ESP32 FreeRTOS, vTaskExitCritical implements both portEXIT_CRITICAL and port
pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );
/* Write the rest of the string. */
#ifdef CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID
sprintf( pcWriteBuffer, "\t%c\t%u\t%u\t%u\t%hd\r\n", cStatus, ( unsigned int ) pxTaskStatusArray[ x ].uxCurrentPriority, ( unsigned int ) pxTaskStatusArray[ x ].usStackHighWaterMark, ( unsigned int ) pxTaskStatusArray[ x ].xTaskNumber, ( int ) pxTaskStatusArray[ x ].xCoreID );
#else
sprintf( pcWriteBuffer, "\t%c\t%u\t%u\t%u\r\n", cStatus, ( unsigned int ) pxTaskStatusArray[ x ].uxCurrentPriority, ( unsigned int ) pxTaskStatusArray[ x ].usStackHighWaterMark, ( unsigned int ) pxTaskStatusArray[ x ].xTaskNumber );
#endif
pcWriteBuffer += strlen( pcWriteBuffer );
}