FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [April 2006 Threads] Dump tcb infp?Posted by John W. on April 30, 2006 Hello Richard,
Is there a way to dump all task control block info? It's pretty easy to find pxCurrentTCB - but what about for all of the tasks that are running in the system?
Thanks! John W.
RE: Dump tcb infp?Posted by Nobody/Anonymous on April 30, 2006 Have you seen function vTaskList in tasks.c?
If you look through the ready lists, pxDelayedTaskList, pxOverflowDelayedTaskList, xTasksWaitingTermination and xSuspendedTaskList then you have every task in the system. The problem is how to do this without having interrupts suspended for the process.
I have a uart task that sends this information on the rs232 when I enter ? in terminal.
RE: Dump tcb info?Posted by John W. on April 30, 2006 Yes, I have seen that.
I'm asking for the task control blocks of each task - what you're doing would bring my system to a crawl. I can barely run vTaskList() with a periodic update without making my system almost halt.
My question is:
Can you dump tcb (task control block) info. for each task in the system? (without the exhaustive list search?)
Regards, John
RE: Dump tcb infp?Posted by Richard on May 1, 2006 There is no single point of reference that will give you all the TCB's in a system. A TCB will always be referenced from exactly one of the 'state' lists (blocked list, suspended list, etc), so the only way of finding all of them is to go through all the queues as per vTaskList(). You then have a problem if the scheduler is still running while you do it as the list contents is very dynamic.
You could allocate an array of pointers to TCB's, then each time you call xTaskCreate, place a reference to the created TCB in the next array index. This would give you a simple static way of accessing each that could still be accessed with the scheduler running. You would have to be careful when deleting a task however to ensure the array position pointing to that tasks TCB was marked as empty (set to null?).
Actually, this mechanism could be implemented at the application level if you wanted, rather than in the kernel code. You would just need to keep tabs of all the task handles returned by the handle parameter of the call to xTaskCreate().
Regards.
RE: Dump tcb infp?Posted by John W. on May 1, 2006 OK Richard,
I'll try your suggestions.
Thanks, John W.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|