Frank Hofmann wrote:
On Mon, 21 May 2007, snow wrote:

In Kernel module coding,we offten use cmn_err,but where can i find the info it put

It goes to a kernel streams queue that syslogd(1M) reads out and, in normal system operation, writes into /var/adm/messages. You can force a direct immediate read from the system command line by dmesg(1M). If you happen to have had a system crash that you'd like to troubleshoot, the latest system message buffer can be accessed from [k]mdb via the "::msgbuf" dcmd. On lowest-level (showing how the information is arranged in-kernel), it'd be:

*log_recentq::print queue_t q_first |    \
::walk b_next |                \
::walk b_cont |             \
::print mblk_t b_rptr |            \
/S
You might also want to look at the cmn_err(9f) man page. Depending on the first character in the format string, the output might only go to the console and not the message buf. Here is the section of the manual page describing this:

    The first character in format affects where the message will
    be written:

    !  The message goes only to the system log.

    ^  The message goes only to the console.

    ?  If level is also CE_CONT, the message is always  sent  to
       the  system  log, but is only written to the console when
       the  system  has  been  booted  in  verbose   mode.   See
       kernel(1M).  If neither condition is met, the '?' charac-
       ter has no effect and is simply ignored.

    Refer to syslogd(1M) to determine where the  system  log  is
    written.

max

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to