Add title for each column in the table from vTaskListTasks

The task table returned by vTaskListTasks is human readable.
But it misses a description for each column.
Add a title row for better human readability.
This commit is contained in:
Rick 2024-12-23 14:37:28 +08:00
parent f31787d35d
commit 8af2c13b83

14
tasks.c
View file

@ -141,7 +141,7 @@
#define tskREADY_CHAR ( 'R' )
#define tskDELETED_CHAR ( 'D' )
#define tskSUSPENDED_CHAR ( 'S' )
#define tskTITLE_STR "TaskName State Priority WaterMark TaskID"
/*
* Some kernel aware debuggers require the data the debugger needs access to be
* global, rather than file scope.
@ -7312,6 +7312,18 @@ static void prvResetNextTaskUnblockTime( void )
/* Generate the (binary) data. */
uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, NULL );
/* Create title for each column of task table */
if (uxArraySize > 0)
{
iSnprintfReturnValue = snprintf(pcWriteBuffer,
uxBufferLength - uxConsumedBufferLength,
"%s\r\n",
tskTITLE_STR);
uxCharsWrittenBySnprintf = prvSnprintfReturnValueToCharsWritten(iSnprintfReturnValue, uxBufferLength - uxConsumedBufferLength);
uxConsumedBufferLength += uxCharsWrittenBySnprintf;
pcWriteBuffer += uxCharsWrittenBySnprintf;
}
/* Create a human readable table from the binary data. */
for( x = 0; x < uxArraySize; x++ )
{