Skip to content

Commit 4ef0bb6

Browse files
authored
vTaskListTasks prints core affinity mask (#850)
This commit updates vTaskListTasks so that it prints uxCoreAffinityMask if core affinity is enabled in configuration.
1 parent a8650b9 commit 4ef0bb6

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

tasks.c

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7225,13 +7225,24 @@ static void prvResetNextTaskUnblockTime( void )
72257225
if( uxConsumedBufferLength < ( uxBufferLength - 1 ) )
72267226
{
72277227
/* Write the rest of the string. */
7228-
iSnprintfReturnValue = snprintf( pcWriteBuffer,
7229-
uxBufferLength - uxConsumedBufferLength,
7230-
"\t%c\t%u\t%u\t%u\r\n",
7231-
cStatus,
7232-
( unsigned int ) pxTaskStatusArray[ x ].uxCurrentPriority,
7233-
( unsigned int ) pxTaskStatusArray[ x ].usStackHighWaterMark,
7234-
( 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. */
7228+
#if ( ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
7229+
iSnprintfReturnValue = snprintf( pcWriteBuffer,
7230+
uxBufferLength - uxConsumedBufferLength,
7231+
"\t%c\t%u\t%u\t%u\t0x%x\r\n",
7232+
cStatus,
7233+
( unsigned int ) pxTaskStatusArray[ x ].uxCurrentPriority,
7234+
( unsigned int ) pxTaskStatusArray[ x ].usStackHighWaterMark,
7235+
( unsigned int ) pxTaskStatusArray[ x ].xTaskNumber,
7236+
( unsigned int ) pxTaskStatusArray[ x ].uxCoreAffinityMask ); /*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. */
7237+
#else /* ( ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
7238+
iSnprintfReturnValue = snprintf( pcWriteBuffer,
7239+
uxBufferLength - uxConsumedBufferLength,
7240+
"\t%c\t%u\t%u\t%u\r\n",
7241+
cStatus,
7242+
( unsigned int ) pxTaskStatusArray[ x ].uxCurrentPriority,
7243+
( unsigned int ) pxTaskStatusArray[ x ].usStackHighWaterMark,
7244+
( 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. */
7245+
#endif /* ( ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
72357246
uxCharsWrittenBySnprintf = prvSnprintfReturnValueToCharsWritten( iSnprintfReturnValue, uxBufferLength - uxConsumedBufferLength );
72367247

72377248
uxConsumedBufferLength += uxCharsWrittenBySnprintf;

0 commit comments

Comments
 (0)