STREAMS-UX Programmer's Guide (February 2007)
STREAMS Commands
strace and strerr
Appendix G
290
strace and strerr
The strace and strerr commands use the STREAMS log driver, /dev/strlog. SVR4.2 calls this driver
/dev/log, but HP-UX already includes a non-streams driver named /dev/log. Therefore, STREAMS logging
uses /dev/strlog.
strace
strace gets STREAMS event trace messages from STREAMS drivers and modules via the STREAMS log
driver (strlog(7)), and writes these messages to standard output. By default, strace without arguments
writes all STREAMS trace messages from all drivers and modules. strace with command-line arguments
limits the trace messages received.
The syntax for the strace command is as follows:
strace [ mod sub pri ] ...
The following arguments must be specified in groups of three:
mod Specifies the STREAMS module identification number from the streamtab entry.
sub Specifies a sub-identification number that often corresponds to a minor device.
pri Specifies a tracing priority level. strace gets messages of a level equal to or less than the
value specified by pri. Only positive integer values are allowed.
The value "all" can be used for any argument in the strace command line to indicate that there are no
restrictions for that argument.
Multiple sets of the three arguments can be specified to obtain the messages from more than one driver or
module.
Only one strace process can open the STREAMS log driver at a time. When strace is invoked, the log driver
compares the sets of command line arguments with actual trace messages. The log driver returns only the
messages that satisfy the specified criteria.
STREAMS event trace messages have the following syntax:
seq time tick pri ind mod sub text
The components are interpreted as follows:
seq trace event sequence number.
time Time in hh:mm:ss when the message was sent
tick Time when the message was sent, expressed in terms of machine ticks since the last boot.
pri Tracing priority level as defined by the STREAMS driver or module that created the
messages.
ind Can be any combination of the following three message indicators:
E: The message has also been saved in the error log.
F: The message signalled a fatal error.
N: The message has also been mailed to the system administrator.
mod Module identification number of the trace message source.
text trace message text.