📄 taskshow.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/taskShow.html - generated by refgen from taskShow.c --> <title> taskShow </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual : Libraries</i></a></p></blockquote><h1>taskShow</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>taskShow</strong> - task show routines </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./taskShow.html#taskShowInit">taskShowInit</a></i>( )</b> - initialize the task show routine facility<br><b><i><a href="./taskShow.html#taskInfoGet">taskInfoGet</a></i>( )</b> - get information about a task<br><b><i><a href="./taskShow.html#taskShow">taskShow</a></i>( )</b> - display task information from TCBs<br><b><i><a href="./taskShow.html#taskRegsShow">taskRegsShow</a></i>( )</b> - display the contents of a task's registers<br><b><i><a href="./taskShow.html#taskStatusString">taskStatusString</a></i>( )</b> - get a task's status as a string<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides routines to show task-related information,such as register values, task status, etc.<p>The <b><i><a href="./taskShow.html#taskShowInit">taskShowInit</a></i>( )</b> routine links the task show facility into the VxWorkssystem. It is called automatically when this show facility is configuredinto VxWorks using either of the following methods:<ul><li>If you use the configuration header files, define<b>INCLUDE_SHOW_ROUTINES</b> in <b>config.h</b>.</li><li>If you use the Tornado project facility, select <b>INCLUDE_TASK_SHOW</b>. </ul><p><p>Task information is crucial as a debugging aid and user-interfaceconvenience during the development cycle of an application. The routines<b><i><a href="./taskShow.html#taskInfoGet">taskInfoGet</a></i>( )</b>, <b><i><a href="./taskShow.html#taskShow">taskShow</a></i>( )</b>, <b><i><a href="./taskShow.html#taskRegsShow">taskRegsShow</a></i>( )</b>, and <b><i><a href="./taskShow.html#taskStatusString">taskStatusString</a></i>( )</b> are usedto display task information.<p>The chief drawback of using task information is that tasks maychange their state between the time the information is gathered and thetime it is utilized. Information provided by these routines shouldtherefore be viewed as a snapshot of the system, and not relied uponunless the task is consigned to a known state, such as suspended.<p>Task management and control routines are provided by taskLib. Programmaticaccess to task information and debugging features is provided by taskInfo.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>taskLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskShow.html#top">taskShow</a></b>, <b><a href="./taskLib.html#top">taskLib</a></b>, taskInfo, <b><a href="./taskHookLib.html#top">taskHookLib</a></b>, <b><a href="./taskVarLib.html#top">taskVarLib</a></b>, <b><a href="./semLib.html#top">semLib</a></b>, <b><a href="./kernelLib.html#top">kernelLib</a></b>, <i>VxWorks Programmer's Guide: Basic OS, Target Shell, </i><i>Tornado User's Guide: Shell</i><hr><a name="taskShowInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>taskShowInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>taskShowInit</i>( )</strong> - initialize the task show routine facility</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void taskShowInit (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine links the task show routines into the VxWorks system.It is called automatically when the task show facility isconfigured into VxWorks using either of the following methods:<ul><li> If you use the configuration header files, define<b>INCLUDE_SHOW_ROUTINES</b> in <b>config.h</b>.</li><li> If you use the Tornado project facility, select <b>INCLUDE_TASK_SHOW</b>.</ul><p></blockquote><h4>RETURNS</h4><blockquote><p><p> N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskShow.html#top">taskShow</a></b><hr><a name="taskInfoGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>taskInfoGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>taskInfoGet</i>( )</strong> - get information about a task</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskInfoGet ( int tid, /* ID of task for which to get info */ TASK_DESC * pTaskDesc /* task descriptor to be filled in */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine fills in a specified task descriptor (<b>TASK_DESC</b>) for aspecified task. The information in the task descriptor is, for the mostpart, a copy of information kept in the task control block (<b>WIND_TCB</b>).The <b>TASK_DESC</b> structure is useful for common information and avoidsdealing directly with the unwieldy <b>WIND_TCB</b>.<p></blockquote><h4>NOTE</h4><blockquote><p>Examination of WIND_TCBs should be restricted to debugging aids.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the task ID is invalid.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskShow.html#top">taskShow</a></b><hr><a name="taskShow"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>taskShow</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>taskShow</i>( )</strong> - display task information from TCBs</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskShow ( int tid, /* task ID */ int level /* 0 = summary, 1 = details, 2 = all tasks */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine displays the contents of a task control block (TCB)for a specified task. If <i>level</i> is 1, it also displays task optionsand registers. If <i>level</i> is 2, it displays all tasks.<p>The TCB display contains the following fields:<p><table><tr valign=top><th align=left>Field </th><th align=left> Meaning</tr><tr><td colspan="2"><hr></tr><tr valign=top><td align=left>NAME </td><td align=left> Task name</tr><tr valign=top><td align=left>ENTRY </td><td align=left> Symbol name or address where task began execution</tr><tr valign=top><td align=left>TID </td><td align=left> Task ID</tr><tr valign=top><td align=left>PRI </td><td align=left> Priority</tr><tr valign=top><td align=left>STATUS </td><td align=left> Task status, as formatted by <b><i><a href="./taskShow.html#taskStatusString">taskStatusString</a></i>( )</b></tr><tr valign=top><td align=left>PC </td><td align=left> Program counter</tr><tr valign=top><td align=left>SP </td><td align=left> Stack pointer</tr><tr valign=top><td align=left>ERRNO </td><td align=left> Most recent error code for this task</tr><tr valign=top><td align=left>DELAY </td><td align=left> If task is delayed, number of clock ticks remaining in delay (0 otherwise)</tr><tr valign=top><td align=left></tr></tr></table></blockquote><h4>EXAMPLE</h4><blockquote><p><p>The following example shows the TCB contents for the shell task:<pre> -> taskShow tShell, 1 NAME ENTRY TID PRI STATUS PC SP ERRNO DELAY ---------- --------- -------- --- --------- -------- -------- ------ ----- tShell _shell 20efcac 1 READY 201dc90 20ef980 0 0 stack: base 0x20efcac end 0x20ed59c size 9532 high 1452 margin 8080 options: 0x1e VX_UNBREAKABLE VX_DEALLOC_STACK VX_FP_TASK VX_STDIO D0 = 0 D4 = 0 A0 = 0 A4 = 0 D1 = 0 D5 = 0 A1 = 0 A5 = 203a084 SR = 3000 D2 = 0 D6 = 0 A2 = 0 A6 = 20ef9a0 PC = 2038614 D3 = 0 D7 = 0 A3 = 0 A7 = 20ef980 value = 34536868 = 0x20efda4</pre></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskShow.html#top">taskShow</a></b>, <b><i><a href="./taskShow.html#taskStatusString">taskStatusString</a></i>( )</b>, <i>VxWorks Programmer's Guide: Target Shell, </i>windsh, <i>Tornado User's Guide: Shell</i><hr><a name="taskRegsShow"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>taskRegsShow</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>taskRegsShow</i>( )</strong> - display the contents of a task's registers</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void taskRegsShow ( int tid /* task ID */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine displays the register contents of a specified taskon standard output.<p></blockquote><h4>EXAMPLE</h4><blockquote><p>The following example displays the register of the shell task (68000 family):<pre>-> taskRegsShow (taskNameToId ("tShell"))d0 = 0 d1 = 0 d2 = 578fe d3 = 1d4 = 3e84e1 d5 = 3e8568 d6 = 0 d7 = ffffffffa0 = 0 a1 = 0 a2 = 4f06c a3 = 578d0a4 = 3fffc4 a5 = 0 fp = 3e844c sp = 3e842csr = 3000 pc = 4f0f2value = 0 = 0x0</pre></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskShow.html#top">taskShow</a></b><hr><a name="taskStatusString"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>taskStatusString</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>taskStatusString</i>( )</strong> - get a task's status as a string</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskStatusString ( int tid, /* task to get string for */ char * pString /* where to return string */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deciphers the WIND task status word in the TCB for aspecified task, and copies the appropriate string to <i>pString</i>.<p>The formatted string is one of the following:<p><table><tr valign=top><th align=left>String </th><th align=left> Meaning</tr><tr><td colspan="2"><hr></tr><tr valign=top><td align=left>READY </td><td align=left> Task is not waiting for any resource other than the CPU.</tr><tr valign=top><td align=left>PEND </td><td align=left> Task is blocked due to the unavailability of some resource.</tr><tr valign=top><td align=left>DELAY </td><td align=left> Task is asleep for some duration.</tr><tr valign=top><td align=left>SUSPEND </td><td align=left> Task is unavailable for execution (but not suspended, delayed, or pended).</tr><tr valign=top><td align=left>DELAY+S </td><td align=left> Task is both delayed and suspended.</tr><tr valign=top><td align=left>PEND+S </td><td align=left> Task is both pended and suspended.</tr><tr valign=top><td align=left>PEND+T </td><td align=left> Task is pended with a timeout.</tr><tr valign=top><td align=left>PEND+S+T </td><td align=left> Task is pended with a timeout, and also suspended.</tr><tr valign=top><td align=left>...+I </td><td align=left> Task has inherited priority (+I may be appended to any string above).</tr><tr valign=top><td align=left>DEAD </td><td align=left> Task no longer exists.</tr><tr valign=top><td align=left></tr></tr></table></blockquote><h4>EXAMPLE</h4><blockquote><p><pre> -> taskStatusString (taskNameToId ("tShell"), xx=malloc (10)) new symbol "xx" added to symbol table. value = 0 = 0x0 -> printf ("shell status = <%s>\n", xx) shell status = <READY> value = 2 = 0x2</pre></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the task ID is invalid.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskShow.html#top">taskShow</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -