From b9b69873443d65ad39c024f5864ca55073cf361f Mon Sep 17 00:00:00 2001 From: Vasyl Gomonovych Date: Thu, 15 Oct 2020 15:12:32 +0200 Subject: [PATCH] Print task priority value in vTaskGetRunTimeStats() Show task priority for better understanding of task run time consumption --- include/task.h | 4 ++-- tasks.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/task.h b/include/task.h index c3d290bfe..8b8859a12 100644 --- a/include/task.h +++ b/include/task.h @@ -1741,8 +1741,8 @@ * * vTaskGetRunTimeStats() calls uxTaskGetSystemState(), then formats part of the * uxTaskGetSystemState() output into a human readable table that displays the - * amount of time each task has spent in the Running state in both absolute and - * percentage terms. + * task priority and amount of time each task has spent in the Running state + * in both absolute and percentage terms. * * vTaskGetRunTimeStats() has a dependency on the sprintf() C library function * that might bloat the code size, use a lot of stack, and provide different diff --git a/tasks.c b/tasks.c index 347fb78b8..8f497b503 100644 --- a/tasks.c +++ b/tasks.c @@ -4601,6 +4601,7 @@ static void prvResetNextTaskUnblockTime( void ) * spaces so it can be printed in tabular form more * easily. */ pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName ); + pcWriteBuffer += sprintf( pcWriteBuffer, "\t\t%u", ( unsigned int ) pxTaskStatusArray[ x ].uxBasePriority ); if( ulStatsAsPercentage > 0UL ) {