On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTKernel-32
RTKernel-32 Programming Manual
RTKernel-32 Reference Manual
Module RTKernel-32
RTKernel-32 Configuration
Function RTKernelInit
Task Management
Enquiring Tasks
Function RTKCurrentTaskHandle
Function RTKGetTaskState
Function RTKGetTaskPrio
Function RTKGetTaskStack
Function RTKGetMinStack
Function RTKTaskInfo
Function RTKClearStatistic
Function RTKLoadSymbols
Function RTKStackDump
Function RTKFirstTask
Function RTKNextTask
Time
Semaphores
Mailboxes
Message Passing
Interrupt Handling
Memory Pools
Kernel Tracer
Spinlocks
Miscellaneous RTKernel-32 Operations
Module FineTime
Module Clock
Module Timer
Module RTCom
Module RTKeybrd
Module RTTextIO
Module CPUMoni
Module RTProf
RTFiles-32
RTIP-32
RTPEG-32
RTUSB-32
|
Function RTKTaskInfo
RTKTaskInfo can write a list of all currently existing tasks to a string:
void RTKTaskInfo(char * Buffer, unsigned BufferSize, unsigned long ListFlags);
ParametersBufferPoints to the string to store the list in.
BufferSizeSpecifies the size of the buffer. RTKTaskInfo will write no more than BufferSize characters to *Buffer.
ListFlagsA sum of individual list flags. Each list flag will produce a specific column in the task list. Some of the list flags are only available in RTKernel-32's Debug Version. If they are used in the Standard Version, only a dash is displayed in the corresponding columns.
Please try the commands 'TASKS1' and 'TASKS2' in program RTKDemo for examples.
The available list flags are:
Value |
Meaning |
LF_TASK_HANDLE |
Heading: Handle. The task's handle in hexadecimal notation. |
LF_TASK_NAME |
Heading: Name. The name of the task passed to RTKCreateThread. |
LF_BASE_PRIO |
Heading: BPrio. The task's base priority defined by RTKCreateThread. The base priority can be modified at run-time using RTKSetPriority. |
LF_TASK_PRIO |
Heading: Prio. The task's execution priority. Due to priority inheritance, the execution priority of a task can temporarily be higher than the base priority. |
LF_TASK_STATE |
Heading: State. The task's state. |
LF_REL_DELAY |
Heading: R.Del. For tasks in a timed kernel operation, this is the number of ticks the task must wait until the timeout expires. |
LF_ABS_DELAY |
Heading: A.Del. For tasks in a timed kernel operation, this is the absolute time when the timeout expires. |
LF_FREE_STACK |
Heading: FStck. The current free stack of the task. If RTKernel-32 cannot determine the stack limits, only a dash is displayed (also refer to section Function RTKGetTaskStack). |
LF_MIN_STACK |
Heading: MStck (MinFreeStack). Number of bytes in the task's stack space that have never been used by the task. If RTKernel-32 cannot determine the stack limits, only a dash is displayed (also refer to section Function RTKGetMinStack). |
LF_COPROCESSOR |
Heading: 80387. Shows whether RTKernel-32 maintains a floating point context for the task. |
LF_TASK_SWITCHES |
Heading: Scheds. Number of task switches to the respective task. |
LF_CPU_TIME |
Heading: CTime. CPU time usage of the respective task in seconds. This column is only available in the Debug Version or when flag RF_TCPUTIME is set in RTKConfig.Flags. |
LF_REL_CPU_TIME |
Heading: CT%. Percentage of available CPU time allocated to the respective task. This column is only available in the Debug Version or when flag RF_TCPUTIME is set in RTKConfig.Flags. |
LF_WAITING_AT_POS |
Heading: CodePos. Address where the respective task will resume when activated by the kernel. If the task was interrupted by an interrupt, this address cannot be determined in most cases and only a dash is displayed. If the program uses a source code position driver and has loaded a symbol table, the name and line number of the respective source file are displayed instead of a hex address. For more information, please refer to Function RTKLoadSymbols. This column is only available in the Debug Version. |
LF_WAITING_AT_OBJ |
Heading: WaitingAt. The object the task is waiting at. Depending on the task's state, this can be another task, a semaphore, a mailbox, or no object. |
LF_RESOURCES |
Heading: Resources. Displays a list of all resource or mutex semaphores currently held by the respective task. This information can be useful in discovering deadlocks when resource management is implemented using resource or mutex semaphores. |
LF_CMASK |
Heading: CMASK. Displays the CPU mask on which the thread may run. The CPU mask can be changed with function RTKSetCPUMask. |
LF_LIST_ALL |
LF_LIST_ALL is the sum of all available list flags. |
CPU time usage and the number of task switches are accumulated since program startup or the last call to RTKClearStatistic.
The width of the list's up to 16 columns is determined by the respective column headings. These are stored in array RTKListTitles and may be modified by the application at run-time to obtain a different list layout. If, for example, you find column LF_CPU_TIME too narrow, you can create a column of width 10 and a right-justified heading using this assignment:
RTKListTitles[11] = " CPU Time";
RTKTaskInfo is intended primarily for debugging purposes and contains no protection from tasks being added/deleted while it executes. While the likelihood is extremely small, RTKTaskInfo can fail if a task is delete while RTKTaskInfo executes.
Function RTKGetMinStack
Function RTKClearStatistic
|