From 79a66c6df17816fd5558d83b916db5dbf54991df Mon Sep 17 00:00:00 2001 From: Rick Date: Tue, 24 Dec 2024 17:48:13 +0800 Subject: [PATCH 1/2] Add an example of human readable table generated by vTaskListTasks() to task.h --- include/task.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/task.h b/include/task.h index 0414eb9e241..ccd194dcb6f 100644 --- a/include/task.h +++ b/include/task.h @@ -2199,9 +2199,16 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; * Lists all the current tasks, along with their current state and stack * usage high water mark. * - * Tasks are reported as blocked ('B'), ready ('R'), deleted ('D') or + * Tasks are reported as running ('X'), blocked ('B'), ready ('R'), deleted ('D') or * suspended ('S'). * + * The example of a human readable table generated by vTaskListTasks() + * Task Name State Priority HighWaterMark Task ID + * Task A X 2 67 2 + * Task B R 1 67 3 + * IDLE R 0 67 5 + * Tmr Svc B 6 137 6 + * * PLEASE NOTE: * * This function is provided for convenience only, and is used by many of the From 4e4ef0e8bb708f2b0dcb4b2dca222624cd3c2413 Mon Sep 17 00:00:00 2001 From: Gaurav Aggarwal Date: Tue, 24 Dec 2024 11:03:09 +0000 Subject: [PATCH 2/2] Code review suggestions Signed-off-by: Gaurav Aggarwal --- include/task.h | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/include/task.h b/include/task.h index ccd194dcb6f..a25740e3bbd 100644 --- a/include/task.h +++ b/include/task.h @@ -2199,15 +2199,8 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; * Lists all the current tasks, along with their current state and stack * usage high water mark. * - * Tasks are reported as running ('X'), blocked ('B'), ready ('R'), deleted ('D') or - * suspended ('S'). - * - * The example of a human readable table generated by vTaskListTasks() - * Task Name State Priority HighWaterMark Task ID - * Task A X 2 67 2 - * Task B R 1 67 3 - * IDLE R 0 67 5 - * Tmr Svc B 6 137 6 + * Tasks are reported as running ('X'), blocked ('B'), ready ('R'), deleted ('D') + * or suspended ('S'). * * PLEASE NOTE: * @@ -2215,8 +2208,16 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; * demo applications. Do not consider it to be part of the scheduler. * * vTaskListTasks() calls uxTaskGetSystemState(), then formats part of the - * uxTaskGetSystemState() output into a human readable table that displays task: - * names, states, priority, stack usage and task number. + * uxTaskGetSystemState() output into a human readable table that displays task + * information in the following format: + * Task Name, Task State, Task Priority, Task Stack High Watermak, Task Number. + * + * The following is a sample output: + * Task A X 2 67 2 + * Task B R 1 67 3 + * IDLE R 0 67 5 + * Tmr Svc B 6 137 6 + * * Stack usage specified as the number of unused StackType_t words stack can hold * on top of stack - not the number of bytes. * @@ -2267,8 +2268,8 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; * Lists all the current tasks, along with their current state and stack * usage high water mark. * - * Tasks are reported as blocked ('B'), ready ('R'), deleted ('D') or - * suspended ('S'). + * Tasks are reported as running ('X'), blocked ('B'), ready ('R'), deleted ('D') + * or suspended ('S'). * * PLEASE NOTE: * @@ -2276,8 +2277,16 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; * demo applications. Do not consider it to be part of the scheduler. * * vTaskList() calls uxTaskGetSystemState(), then formats part of the - * uxTaskGetSystemState() output into a human readable table that displays task: - * names, states, priority, stack usage and task number. + * uxTaskGetSystemState() output into a human readable table that displays task + * information in the following format: + * Task Name, Task State, Task Priority, Task Stack High Watermak, Task Number. + * + * The following is a sample output: + * Task A X 2 67 2 + * Task B R 1 67 3 + * IDLE R 0 67 5 + * Tmr Svc B 6 137 6 + * * Stack usage specified as the number of unused StackType_t words stack can hold * on top of stack - not the number of bytes. *