📄 msgqshow.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/msgQShow.html - generated by refgen from msgQShow.c --> <title> msgQShow </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>msgQShow</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>msgQShow</strong> - message queue show routines </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./msgQShow.html#msgQShowInit">msgQShowInit</a>( )</b> - initialize the message queue show facility<br><b><a href="./msgQShow.html#msgQInfoGet">msgQInfoGet</a>( )</b> - get information about a message queue<br><b><a href="./msgQShow.html#msgQShow">msgQShow</a>( )</b> - show information about a message queue<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides routines to show message queue statistics,such as the task queuing method, messages queued, receivers blocked, etc.<p>The routine <b>msgQshowInit( )</b> links the message queue show facility into theVxWorks system. It is called automatically when the message queue showfacility is configured into VxWorks using either of thefollowing methods:<ul><li></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_MSG_Q_SHOW</b>.</ul><p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>msgQLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./pipeDrv.html#top">pipeDrv</a></b>,<i>VxWorks Programmer's Guide: Basic OS </i><hr><a name="msgQShowInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>msgQShowInit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>msgQShowInit( )</strong> - initialize the message queue show facility</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void msgQShowInit (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine links the message queue show facility into the VxWorks system.It is called automatically when the message queue show facility isconfigured into VxWorks using either of the following methods:<ul><li>If you use the configuration header files, define</li><b>INCLUDE_SHOW_ROUTINES</b> in <b>config.h</b>.<li>If you use the Tornado project facility, select <b>INCLUDE_MSG_Q_SHOW</b>.</li></ul><p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./msgQShow.html#top">msgQShow</a></b><hr><a name="msgQInfoGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>msgQInfoGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>msgQInfoGet( )</strong> - get information about a message queue</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS msgQInfoGet ( MSG_Q_ID msgQId, /* message queue to query */ MSG_Q_INFO * pInfo /* where to return msg info */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets information about the state and contents of a messagequeue. The parameter <i>pInfo</i> is a pointer to a structure of type <b>MSG_Q_INFO</b>defined in <b>msgQLib.h</b> as follows:<p><pre> typedef struct /* MSG_Q_INFO */ { int numMsgs; /* OUT: number of messages queued */ int numTasks; /* OUT: number of tasks waiting on msg q */ int sendTimeouts; /* OUT: count of send timeouts */ int recvTimeouts; /* OUT: count of receive timeouts */ int options; /* OUT: options with which msg q was created */ int maxMsgs; /* OUT: max messages that can be queued */ int maxMsgLength; /* OUT: max byte length of each message */ int taskIdListMax; /* IN: max tasks to fill in taskIdList */ int * taskIdList; /* PTR: array of task IDs waiting on msg q */ int msgListMax; /* IN: max msgs to fill in msg lists */ char ** msgPtrList; /* PTR: array of msg ptrs queued to msg q */ int * msgLenList; /* PTR: array of lengths of msgs */ } MSG_Q_INFO;</pre>If a message queue is empty, there may be tasks blocked on receiving.If a message queue is full, there may be tasks blocked on sending.This can be determined as follows:<ul><li>If <i>numMsgs</i> is 0, then <i>numTasks</i> indicates the number of tasks blocked</li>on receiving.<li>If <i>numMsgs</i> is equal to <i>maxMsgs</i>, then <i>numTasks</i> is the number of</li>tasks blocked on sending.<li>If <i>numMsgs</i> is greater than 0 but less than <i>maxMsgs</i>, then <i>numTasks</i> </li>will be 0.</ul><p>A list of pointers to the messages queued and their lengths can beobtained by setting <i>msgPtrList</i> and <i>msgLenList</i> to the addresses ofarrays to receive the respective lists, and setting <i>msgListMax</i> tothe maximum number of elements in those arrays. If either list pointeris NULL, no data will be returned for that array.<p>No more than <i>msgListMax</i> message pointers and lengths are returned,although <i>numMsgs</i> will always be returned with the actual number of messagesqueued.<p>For example, if the caller supplies a <i>msgPtrList</i> and <i>msgLenList</i>with room for 10 messages and sets <i>msgListMax</i> to 10, but there are 20messages queued, then the pointers and lengths of the first 10 messages inthe queue are returned in <i>msgPtrList</i> and <i>msgLenList</i>, but <i>numMsgs</i> willbe returned with the value 20.<p>A list of the task IDs of tasks blocked on the message queue can be obtainedby setting <i>taskIdList</i> to the address of an array to receive the list, andsetting <i>taskIdListMax</i> to the maximum number of elements in that array.If <i>taskIdList</i> is NULL, then no task IDs are returned. No more than<i>taskIdListMax</i> task IDs are returned, although <i>numTasks</i> will alwaysbe returned with the actual number of tasks blocked.<p>For example, if the caller supplies a <i>taskIdList</i> with room for 10 task IDsand sets <i>taskIdListMax</i> to 10, but there are 20 tasks blocked on themessage queue, then the IDs of the first 10 tasks in the blocked queuewill be returned in <i>taskIdList</i>, but <i>numTasks</i> will be returned withthe value 20.<p>Note that the tasks returned in <i>taskIdList</i> may be blocked for either sendor receive. As noted above this can be determined by examining <i>numMsgs</i>.<p>The variables <i>sendTimeouts</i> and <i>recvTimeouts</i> are the counts of the numberof times <b><a href="./msgQLib.html#msgQSend">msgQSend</a>( )</b> and <b><a href="./msgQLib.html#msgQReceive">msgQReceive</a>( )</b> respectively returned with a timeout.<p>The variables <i>options</i>, <i>maxMsgs</i>, and <i>maxMsgLength</i> are the parameterswith which the message queue was created.<p></blockquote><h4>WARNING</h4><blockquote><p>The information returned by this routine is not static and may beobsolete by the time it is examined. In particular, the lists oftask IDs and/or message pointers may no longer be valid. However,the information is obtained atomically, thus it will be an accuratesnapshot of the state of the message queue at the time of the call.This information is generally used for debugging purposes only.<p></blockquote><h4>WARNING</h4><blockquote><p>The current implementation of this routine locks out interrupts whileobtaining the information. This can compromise the overall interruptlatency of the system. Generally this routine is used for debuggingpurposes only.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_distLib_NOT_INITIALIZED</b>, <b>S_smObjLib_NOT_INITIALIZED</b>,<br> <b>S_objLib_OBJ_ID_ERROR</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./msgQShow.html#top">msgQShow</a></b><hr><a name="msgQShow"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>msgQShow( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>msgQShow( )</strong> - show information about a message queue</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS msgQShow ( MSG_Q_ID msgQId, /* message queue to display */ int level /* 0 = summary, 1 = details */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine displays the state and optionally the contents of a messagequeue.<p>A summary of the state of the message queue is displayed as follows:<pre> Message Queue Id : 0x3f8c20 Task Queuing : FIFO Message Byte Len : 150 Messages Max : 50 Messages Queued : 0 Receivers Blocked : 1 Send timeouts : 0 Receive timeouts : 0 Options : 0x1 MSG_Q_FIFO VxWorks Events -------------- Registered Task : 0x3f5c70 (t1) Event(s) to Send : 0x1 Options : 0x7 EVENTS_SEND_ONCE EVENTS_ALLOW_OVERWRITE EVENTS_SEND_IF_FREE</pre>If <i>level</i> is 1, then more detailed information will be displayed.If messages are queued, they will be displayed as follows:<pre> Messages queued: # address length value 1 0x123eb204 4 0x00000001 0x12345678</pre>If tasks are blocked on the queue, they will be displayed as follows:<pre> Receivers blocked: NAME TID PRI DELAY ---------- -------- --- ----- tExcTask 3fd678 0 21</pre></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_distLib_NOT_INITIALIZED</b>, <b>S_smObjLib_NOT_INITIALIZED</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./msgQShow.html#top">msgQShow</a></b>, <i>VxWorks Programmer's Guide: Target Shell, </i><b><a href="../../tornado/tools/windsh.html#top" >windsh</a></b>, <i>Tornado User's Guide: Shell</i></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -