From owner-freebsd-questions@FreeBSD.ORG Tue Feb 26 16:37:40 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC3D71065687 for ; Tue, 26 Feb 2008 16:37:40 +0000 (UTC) (envelope-from yoniy@mellanox.co.il) Received: from mellanox.co.il (mail.mellanox.co.il [194.90.237.43]) by mx1.freebsd.org (Postfix) with ESMTP id 0996713C459 for ; Tue, 26 Feb 2008 16:37:39 +0000 (UTC) (envelope-from yoniy@mellanox.co.il) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yoniy@mellanox.co.il) with SMTP; 26 Feb 2008 18:37:37 +0200 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Tue, 26 Feb 2008 18:37:36 +0200 Message-ID: <6C2C79E72C305246B504CBA17B5500C903690FF1@mtlexch01.mtl.com> In-Reply-To: <200802251504.01873.fbsd.questions@rachie.is-a-geek.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Capturing dmesg upon system crash on 6.3 Thread-Index: Ach3t03dVolxFKA6T/iE7G5DcMT5fQAsShwg From: "Yehonatan Yossef" To: "Mel" , Cc: Subject: RE: Capturing dmesg upon system crash on 6.3 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2008 16:37:40 -0000 > > > > > > I'm facing a system reboot upon loading of the driver, and > > > > > > > > > > I could use > > > > > > > > > > > a tool for capturing dmesg upon system crash (such as > > > > > > netconsole > > > > > > > > > on Linux). > > > > > > > > > > Your kernel isn't setup for driver development: > > > > > http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-ha > > > > > ndbook/kerneldebug.html > > > > > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kern > > > > > elconfig.html > > > > > > > > > > Basically, your system is rebooting cause the kernel=20 > panics and=20 > > > > > you're not setup for crash dumps, or anything that could help=20 > > > > > you diagnose the panic. > > > > > -- > > > > > Mel > > > > > > > > I've setup the dumpdev/dumpdir and I get a vmcore image > > > > > > upon a crash. > > > > > > > I don't really understand how to use kgdb in order to read > > > > > > it but more > > > > > > > than that - I don't need that much of data. I only want=20 > the dmesg=20 > > > > report at the moment, see at what point my driver went > > > > > > crazy. Is it possible? > > > > > > > > > Uhm, no. Fundamental logic flaw: when a kernel is=20 > stopped, you can't=20 > > > issue userland commands. All you have when you use ddb, is the=20 > > > contents of the registers, ram and backtrace. > > > > > > You really want ddb in the kernel: when a kernel panics,=20 > it'll drop=20 > > > to ddb and you can examine registers and do a backtrace,=20 > instead of=20 > > > dumping core and rebooting. It should point exactly to where your=20 > > > driver went crazy. > > > -- > > > Mel > > > > I meant making the dmesg log sent over the network/serial=20 > console to a=20 > > linux machine. I just found out about syslogd, I'm trying to figure=20 > > out how to use it. > > DDB sounds like a great option for deeper debugging, I'll use it. >=20 > Ooh, sorry, totally got your question wrong. > Serial should really be the way to go. But it depends when=20 > you load your driver. If your driver panics the kernel before=20 > it gets to loading syslogd, there may not be much sent. > You could help this by not loading the network interface on=20 > bootup, but via cron instead, so that you're sure syslogd is=20 > up and running when you load the driver. Of course this=20 > assumes a working main network interface and that the driver=20 > isn't loaded automatically by /boot/loader.conf. > -- > Mel >=20 Thanks Mel, DDB is a great help.