Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

strlog(9f) [opensolaris man page]

strlog(9F)						   Kernel Functions for Drivers 						strlog(9F)

NAME
strlog - submit messages to the log driver SYNOPSIS
#include <sys/stream.h> #include <sys/strlog.h> #include <sys/log.h> int strlog(short mid, short sid, char level, unsigned short flags, char *fmt, ...); INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). PARAMETERS
mid Identification number of the module or driver submitting the message (in the case of a module, its mi_idnum value from mod- ule_info(9S)). sid Identification number for a particular minor device. level Tracing level for selective screening of low priority messages. Larger values imply less important information. flags Valid flag values are: SL_ERROR Message is for error logger. SL_TRACE Message is for trace. SL_NOTIFY Mail copy of message to system administrator. SL_CONSOLE Log message to console. SL_FATAL Error is fatal. SL_WARN Error is a warning. SL_NOTE Error is a notice. fmt printf(3C) style format string. %e, %g, and %G formats are not allowed but %s is supported. DESCRIPTION
The strlog() function expands the printf(3C) style format string passed to it, that is, the conversion specifiers are replaced by the actual argument values in the format string. The 32-bit representations of the arguments (up to NLORGARGS) follow the string starting at the next 32-bit boundary following the string. Note that the 64-bit argument will be truncated to 32-bits here but will be fully repre- sented in the string. The messages can be retrieved with the getmsg(2) system call. The flags argument specifies the type of the message and where it is to be sent. strace(1M) receives messages from the log driver and sends them to the standard output. strerr(1M) receives error messages from the log driver and appends them to a file called /var/adm/streams/error.mm-dd, where mm-dd identifies the date of the error message. RETURN VALUES
The strlog() function returns 0 if it fails to submit the message to the log(7D) driver and 1 otherwise. CONTEXT
The strlog() function can be called from user, interrupt, or kernel context. FILES
/var/adm/streams/error.mm-dd Error messages dated mm-dd appended by strerr(1M) from the log driver SEE ALSO
strace(1M), strerr(1M), getmsg(2), log(7D), module_info(9S) Writing Device Drivers STREAMS Programming Guide SunOS 5.11 16 Jan 2006 strlog(9F)

Check Out this Related Man Page

strace(8)						      System Manager's Manual							 strace(8)

NAME
strace - Writes STREAMS event trace messages to standard output SYNOPSIS
/usr/sbin/strace [mod_ID sub_ID pri_level] DESCRIPTION
The strace command gets STREAMS event trace messages from STREAMS drivers and modules via the STREAMS log driver (strlog), and writes these messages to standard output. You can limit the messages strace receives by specifying arguments to the command. The arguments, which must be specified together, are the following: Specifies the STREAMS module identification number. Specifies a subidentification number (often corresponding to a minor device). Specifies a tracing priority level. The strace command will get messages of a level equal to or less than the value in the pri_level argument. The value of the argument must be a nonnegative integer. You can specify all as the value for any of the arguments in the strace command line. The value all indicates that there are no restric- tions for that argument. You can also specify multiple sets of the command's three arguments to obtain the messages from more than one driver or module. More than one strace process can open the STREAMS log driver at a time. When you invoke strace, the log driver compares the sets of argu- ments from the command line with actual trace messages, returning the messages that satisfy the criteria. STREAMS event trace messages have the following format: seqnum stdtime tickstime pri_level ntfycode mod_ID sub_ID msgtext where: The event trace sequence number. The time the message was sent, in the format hh:mm:ss. The time the message was sent, measured in machine ticks since the last boot. The tracing priority level as defined by the STREAMS driver or module that originates the messages. Can be either of the following indicators: Indicates that the message has also been saved in the error log. Indicates that the message signaled a fatal error. The module identification number of the trace message source. The subidentification number of the trace message source. The trace message text. The strace command runs until terminated by the user. NOTES
Running strace with several sets of arguments can negatively affect STREAMS performance, particularly for those modules and drivers sending the messages. Also be aware that strace may not be able to handle a large number of messages. If drivers and modules return messages to strace too quickly, some may be lost. EXAMPLES
To display all trace messages received from the driver or module identified by mod_ID 28, enter: strace 28 all all To display those trace messages from the driver or module identified by mod_ID 28 and its minor devices identified by the sub_IDs 2, 3, and 4, enter: strace 28 2 all 28 3 all 28 4 all This command line causes messages of any tracing priority level to be displayed. To display the trace messages from the same driver or module and sub_IDs, but limited to certain priority levels, enter: strace 28 2 0 28 3 0 28 4 1 This command line specifies that messages from driver or module 28 and sub_IDs 2 and 3 must have a tracing priority of 0, and those from sub_ID 4 must have a tracing priority equal to or less than 1. RELATED INFORMATION
Commands: strclean(8), strerr(8). Interfaces: strlog(7). delim off strace(8)
Man Page