STREAMS/UX for the HP 9000 Reference Manual

155
Debugging STREAMS/UX Modules and Drivers
STREAMS/UX Debugging Tool
static sp_timeout(private)
struct sp *private;
{
mblk_t *temp;
unsigned int s;
/* Make sure driver isn't being closed. */
if ((private->sp_state & SPOPEN) && (private->first_mp)) {
/* Take message off head of queue in private data
structure. */
temp = private->first_mp;
private->first_mp = private->first_mp->b_next;
temp->b_next = NULL;
/* Call putq to put message on sp's read queue and send
it upstream. */
putq(private->sp_rdq, temp);
}
}
The user writes a test for the driver. The test opens sp, and goes into a loop
calling putmsg() to send data and calling getmsg() to receive the data back.
The test prints a message each time it receives 100 messages. The user runs
the program, but it does not print any messages. While the program is
running, the user runs strdb to see what is happening on the stream. This is
shown below.
strdb
No current structure S:0
The user types :S to enter STREAMS/UX subsystem mode.
:S
STREAMS subsystem help commands..
? - show this help menu
d - print status of STREAMS daemon
h - show this help menu
la 'name' - list all active STREAMS on device 'name'
ll 'name' 'minor' - list all drivers linked under the STREAMS
driver 'name' and minor number 'minor'
lm 'name' 'minor' - list all modules pushed on STREAMS device
‘name’ and whose minor number is 'minor'
lp 'name' 'minor' - list all drivers persistently linked under
the STREAMS device 'name' and minor number
'minor'
q - quit the STREAMS subsystem commands
qc 'driver' 'file' - print 'driver' read / write side qcount to
file
qh 'name' 'minor'- display STREAM head queue structure
for device 'name' and minor number 'minor'
s [m | d] - Option d lists all the STREAMS drivers
configured in the system. Option m lists