Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Dec 2008 15:05:56 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-drivers@freebsd.org
Cc:        David Christensen <davidch@broadcom.com>, Sam Leffler <sam@freebsd.org>, "freebsd-net@FreeBSD.org" <freebsd-net@freebsd.org>
Subject:   Re: Gathering Hardware State During a Driver Initiated Kernel Panic
Message-ID:  <200812011505.56535.jhb@freebsd.org>
In-Reply-To: <492B2306.60404@freebsd.org>
References:  <5D267A3F22FD854F8F48B3D2B52381933940B2DEFE@IRVEXCHCCR01.corp.ad.broadcom.com> <492B2306.60404@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 24 November 2008 04:56:22 pm Sam Leffler wrote:
> David Christensen wrote:
> > Is there a method or callback in FreeBSD where a driver can 
> > be notified that it has caused a kernel panic in order to 
> > generate a dump of internal hardware state information?  I've
> > written a sysctl call for manual intervention and can handle
> > some "expected" hardware events completely in the driver but
> > I don't know of a way to get control again in cases where the 
> > driver wasn't expecting a failure.
> >   
> 
> Not sure how one can deduce a driver is at fault but you might define a 
> ddb command for the driver and invoke that on panic using the ddb script 
> mechanisms (see ddb(4)).

You might be able to set the current 'panic' ddb script function to one you 
define in your code somehow.  That is, set it on entry to bce_start() and 
then reset it to empty when bce_start() returns.  Similarly for the interrupt 
handler, bce_init(), and bce_ioctl().  I haven't looked to see if there is a 
clean way to set a script function in C though.

-- 
John Baldwin



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