From 29b6b0ce0d91a8732315aa902671da065f7c9433 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 10 Nov 2020 10:07:39 +0800 Subject: [PATCH] freertos: Fix missing affinity info in vTaskList Show affinity info if CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID is set. Closes https://github.com/espressif/esp-idf/pull/6099 Closes https://github.com/espressif/esp-idf/issues/6097 Signed-off-by: Axel Lin Signed-off-by: Mahavir Jain --- components/freertos/tasks.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/freertos/tasks.c b/components/freertos/tasks.c index a34c264763..540927dbd4 100644 --- a/components/freertos/tasks.c +++ b/components/freertos/tasks.c @@ -4975,7 +4975,11 @@ TCB_t *pxTCB; pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName ); /* Write the rest of the string. */ +#if configTASKLIST_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 ); /*lint !e586 sprintf() allowed as this is compiled with many compilers and this is a utility function only - not part of the core kernel implementation. */ +#endif pcWriteBuffer += strlen( pcWriteBuffer ); /*lint !e9016 Pointer arithmetic ok on char pointers especially as in this case where it best denotes the intent of the code. */ }