From owner-freebsd-questions@FreeBSD.ORG Mon Feb 25 14:04:04 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 8396616A404 for ; Mon, 25 Feb 2008 14:04:04 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from snoogles.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 4CDDA13C45D for ; Mon, 25 Feb 2008 14:04:04 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (localhost [127.0.0.1]) by snoogles.rachie.is-a-geek.net (Postfix) with ESMTP id 292C01CC8B; Mon, 25 Feb 2008 05:04:03 -0900 (AKST) From: Mel To: freebsd-questions@freebsd.org Date: Mon, 25 Feb 2008 15:04:01 +0100 User-Agent: KMail/1.9.7 References: <6C2C79E72C305246B504CBA17B5500C90364164C@mtlexch01.mtl.com> In-Reply-To: <6C2C79E72C305246B504CBA17B5500C90364164C@mtlexch01.mtl.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802251504.01873.fbsd.questions@rachie.is-a-geek.net> Cc: Yehonatan Yossef 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: Mon, 25 Feb 2008 14:04:04 -0000 On Monday 25 February 2008 14:44:28 Yehonatan Yossef wrote: > > On Monday 25 February 2008 13:32:01 Yehonatan Yossef wrote: > > > > > 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 panics and > > > > you're not setup for crash dumps, or anything that could help 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 the dmesg > > > report at the moment, see at what point my driver went > > > > crazy. Is it possible? > > > > > > Uhm, no. Fundamental logic flaw: when a kernel is stopped, > > you can't issue userland commands. All you have when you use > > ddb, is the contents of the registers, ram and backtrace. > > > > You really want ddb in the kernel: when a kernel panics, > > it'll drop to ddb and you can examine registers and do a > > backtrace, instead of dumping core and rebooting. It should > > point exactly to where your driver went crazy. > > -- > > Mel > > I meant making the dmesg log sent over the network/serial console to a > linux machine. I just found out about syslogd, I'm trying to figure out > how to use it. > DDB sounds like a great option for deeper debugging, I'll use it. Ooh, sorry, totally got your question wrong. Serial should really be the way to go. But it depends when you load your driver. If your driver panics the kernel before it gets to loading syslogd, there may not be much sent. You could help this by not loading the network interface on bootup, but via cron instead, so that you're sure syslogd is up and running when you load the driver. Of course this assumes a working main network interface and that the driver isn't loaded automatically by /boot/loader.conf. -- Mel