Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Oct 2005 15:57:15 -0700
From:      Bharma Ji <bharmaji@gmail.com>
To:        freebsd-drivers@freebsd.org
Subject:   Re: Recommended ways to log driver operations
Message-ID:  <67beabb0510281557k5d237a0br9b586bdde35c6971@mail.gmail.com>
In-Reply-To: <20051017.210955.104032631.imp@bsdimp.com>
References:  <67beabb0510171825q1e124bf6v2adbe0c9f235a6ae@mail.gmail.com> <20051017.210955.104032631.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 writ=
e
the messages to the disk while the driver is executing.(seems to much to as=
k
probably - but someone somewhere would have thought of a way around it)


On 10/17/05, M. Warner Losh <imp@bsdimp.com> wrote:
>
> In message: <67beabb0510171825q1e124bf6v2adbe0c9f235a6ae@mail.gmail.com>
> Bharma Ji <bharmaji@gmail.com> writes:
> : I recently wrote a driver for a chip. I am wondering if there are any
> : standard recommended ways of logging the driver operations. I have used
> : printf in the driver and I look at it using dmesg so far. Am wondering
> if it
> : is possible to create a driver specific log file so that it is easy to
> : debug. Also, if the driver emits copious output then the log buffer wil=
l
> : overflow and some messages may be truncated. Writing to a specific log
> file
> : may help in that case. However, I have no idea if this is worth
> : investigating. Any suggestions appreciated
>
> printf(9) doesn't give you much of a chance to segregate the logs. You
> can also use log(9), but that just adds the ability to give a priority
> to the log message, which can help.
>
> If you want to debug the driver to find out what's going on at a high
> rate, you might want to look at ktr(9) and alq(9). These facilities
> are more for debugging and performance tuning, rather than day to day
> operations. In general, FreeBSD drivers follow the unix tradition of
> only complaining when there are problems.
>
> Warner
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?67beabb0510281557k5d237a0br9b586bdde35c6971>