5.3  STREAMS Examination Utilities

The WindNet STREAMS component provides a rich set of utilities with which a STREAMS application developer can examine STREAMS structures, such as open streams, queues, message blocks. It also provides utilities to display statistics about the usage of open streams , queues, and message blocks. These utilities are included in VxWorks if you define INCLUDE_STREAMS_DEBUG in configAll.h.

The following sections introduce the various show utilities.

5.3.1  strmOpenStreamsShow( )

This routine displays information about all open streams in the STREAMS subsystem. It displays the address of the stream, flags associated with the stream, the major number associated with the stream, and the minor number associated with the stream.

For example, the following command displays information similar to the output below: The file descriptor associated with the open stream is displayed as an index to the global variable sth_open_streams.

-> strmOpenStreamsShow

sth_open_streams[11] ==> sth 0x3fe300, flags 0x80, maj 9, min 2
sth_open_streams[14] ==> sth 0x39969c, flags 0x0, maj 9, min 7
sth_open_streams[15] ==> sth 0x3aa714, flags 0x200, maj 9, min 6

5.3.2  strmQueueShow( )

This routine displays information about all queues on a stream. The parameter passed to this routine is the address of a specified stream.

It displays the name of the stream, the read queue address, the read queue next pointer address, the write queue address, and the write queue next pointer address.

For example, the following command displays information similar to the output below:

-> strmQueueShow (0x3fe300)

name sth q 0x3fe050 q_next 0x0 wrq 0x3fe094 wrq_next 0x3fdc40
name echo q 0x3fdbfc q_next 0x3fe050 wrq 0x3fdc40 wrq_next 0x3fdbfc

5.3.3  strmBandShow( )

This routine displays information about all message blocks in a particular band. The parameters passed to this routine are the address of the specified stream and band.

For example, the following command displays the output below:

-> strmBandShow (0x3fe300, 100)

mp 0x396b64, type 0, band 100, len 512, size 512, cont 0x0
mp 0x3a160c, type 0, band 100, len 512, size 512, cont 0x0

5.3.4  strmMessageShow( )

This routine displays information about all the messages in the queue-pair. The parameter passed to this routine is the address of the specified queue.

It displays the address of the message block, the message type, the band, and the size of the message.

For example, the following command displays the output below:

-> strmMessageShow (0x3fdbfc) 

Queue check: rq 0x3fdbfc, wq 0x3fdc40
Write Queue 0x3fdbfc, first 0x396b64, last 0x394874, next 0x3fdbfc flag 0x24
mp 0x396b64, type 0, band 0, len 512, size 512, cont 0x0
mp 0x3a160c, type 0, band 0, len 512, size 512, cont 0x0
mp 0x3980e4, type 0, band 0, len 512, size 512, cont 0x0
mp 0x394874, type 0, band 0, len 512, size 512, cont 0x0
Read Queue 0x3fe050, first 0x397624, last 0x3960a4, next 0x0 flag 0x2f
mp 0x397624, type 0, band 0, len 512, size 512, cont 0x0
mp 0x3968b4, type 0, band 0, len 512, size 512, cont 0x0
mp 0x3960a4, type 0, band 0, len 512, size 512, cont 0x0

5.3.5  strmQueueStatShow( )

This routine displays statistics about system-wide usage of queues. It displays the number of queues allocated, the number of queues in use, the total number of queues configured, the maximum number of queues that can be allocated, and the number of queue allocation failures.

For example, the following command displays the output below:

-> strmQueueStatShow

ITEM       Allocated       inuse       total       max       fail
Queue         10            10          10         10         0

5.3.6  strmStatShow( )

This routine displays statistics about streams in the system. It displays the number of streams allocated, the number of streams in use, the total number of streams configured, the maximum number of streams that can be configured, the number of stream allocation failures.

For example, the following command displays the output below:

-> strmStatShow

ITEM       Allocated       inuse       total       max       fail
Streams        3             3          10          3          0

5.3.7  strmMsgStatShow( )

This command displays statistics about system-wide usage of STREAMS message blocks. It displays the size of the message block (under the column head Size), the number of message blocks available for this size (Avail), the number of message blocks of this size in use (InUse), the total number of message blocks allocated for this size (Total), the total memory usage by message blocks of this size (Total mem), the number of allocation requests that have failed for this message block size (FailCnt), the number of calls to bufcall( ) pending due to allocb( ) failure for message blocks of this size (Bufcalls).

For example, the following command displays information similar to the output below:

-> strmMsgStatShow

STREAMS Message Pool
Size    Avail   InUse   Total       Total mem   FailCnt Bufcalls pending
0        0       0       0               0       0       0
64       0       33      33              7392    0       0
128      0       0       0               0       0       0 
256      0       5       5               2080    0       0
512      1       43      44              29568   0       0
1024     0       0       0               0       0       0 
2048     0       0       0               0       0       0
4096     0       0       0               0       0       0
8192     0       1       1               8352    0       0 
8192     NA      0       0               0       0       0
Mblks 82, Data 33600, Total mem 47392, Bufcall struct reserve 20

5.3.8  strmDriverModShow( )

This routine displays STREAMS modules and drivers configuration information in two different formats: a verbose (long) format and a short format.

In the long format, this routine displays the following device characteristics:

name
the name of the device

type
the type (STREAMS module or STREAMS device)

major
the major number for devices (applicable only to devices)

idnum
the module ID number

idname
the name as specified in the driver/module module_info structure

minpsz
the minimum packet size allowed

maxpsz
the maximum packet size allowed

lowat
the low water mark

hiwat
the high water mark

In the short format, this command displays the names of all the STREAMS drivers and modules configured in the system.

For example, the following command displays information in the short format similar to the following output:

-> strmDriverModShow 

strmDriverModShow
dlb      nuls     sad      sockmod  tirdwr
log      pipemod  sc       timod 

The same command, with the argument 1, displays information in the verbose (long) format similar to the output below:

-> strmDriverModShow (1)

name     type  major  idnum  idname    minpsz  maxpsz  lowat   hiwat
dlb       dev      8   5246  dlb            0    1500    128     512
log       dev      0   5206  log            0      -1    128    2048
nuls      mux      1   5212  nuls           0      -1    128     512
pipemod   mod          5218  pipemod        0      -1    128    2048
sad       dev      2   5222  sad            0      -1   2048    4096
sc        mod          5220  sc             0      -1    128    2048
sockmod   mod          5335  sockmod        2       1      1       2
timod     mod          5226  timod          0      -1    128    2048
tirdwr    mod          5230  tirdwr         0      -1    128    2048