Recommended ways to log driver operations

M. Warner Losh imp at bsdimp.com
Fri Oct 28 16:06:48 PDT 2005


In message: <67beabb0510281557k5d237a0br9b586bdde35c6971 at mail.gmail.com>
            Bharma Ji <bharmaji at gmail.com> writes:
: Resurrecting a recent thread...
: Thanks for your resposne. ktr and alq are unfortunately not availabe on the
: freebsd version that I am using.
: I have reduced my requirements for the logging facility. Now all I require
: is that the log be persistent. The problem that I face is that in the event
: of a kernel panic - the driver messages are all lost.Is there a way to write
: the messages to the disk while the driver is executing.(seems to much to ask
: probably - but someone somewhere would have thought of a way around it)

If all you want is for them to be persistant, then printf will put
them into the dmesg buffer which you can extract via the debugger from
either a core file or a live system that's paniced.  If there's
sufficient time between the last printf and a panic, then syslog will
have flushed it to disk...

Warner


More information about the freebsd-drivers mailing list