RE: Capturing dmesg upon system crash on 6.3

2008-02-26 Thread Tom Evans
On Mon, 2008-02-25 at 15:41 +0200, Yehonatan Yossef wrote:
 I'm looking into the syslogd capabilities at the moment, it might be
 enough.
 I've tried following the serial console setup you've pointed, but when I
 added the 'console=comconsole' to loader.conf the OS hanged during
 boot time, had to re-install the system.
 
 I'm currently porting Mellanox ethernet driver, InfiniBand will be
 probably next. Mail me outside this list if you're interested in
 InfiniBand.
 

The OS probably didnt hang, you told it to send all its output to
comconsole (ie serial port) and not display anything. This might look as
though it has hung. Try (in /boot/loader.conf):

  boot_multicons=YES
  console=vidconsole,comconsole

to output to both of them. Also, set the correct tty on your serial
console with something like (in /etc/ttys):

ttyd0   /usr/libexec/getty std.9600   vt100   off secure

There will be a ttyd0 line already.

All of this is in the various handbooks.

Cheers

Tom



signature.asc
Description: This is a digitally signed message part


RE: Capturing dmesg upon system crash on 6.3

2008-02-26 Thread Yehonatan Yossef
  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
 

Thanks Mel, DDB is a great help.



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Capturing dmesg upon system crash on 6.3

2008-02-25 Thread Mel
On Monday 25 February 2008 10:28:12 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-handbook/kerneldebug.html
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.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
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: Capturing dmesg upon system crash on 6.3

2008-02-25 Thread Yehonatan Yossef
  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?

Yony
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Capturing dmesg upon system crash on 6.3

2008-02-25 Thread Mel
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
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: Capturing dmesg upon system crash on 6.3

2008-02-25 Thread Yehonatan Yossef
I'm looking into the syslogd capabilities at the moment, it might be
enough.
I've tried following the serial console setup you've pointed, but when I
added the 'console=comconsole' to loader.conf the OS hanged during
boot time, had to re-install the system.

I'm currently porting Mellanox ethernet driver, InfiniBand will be
probably next. Mail me outside this list if you're interested in
InfiniBand.

Yehonatan Yossef
Mellanox Technologies INC
Office: +972-4-9097200 ext. 301 
Cell: +972-54-2345031 ([EMAIL PROTECTED])
 

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Monday, February 25, 2008 3:29 PM
 To: Yehonatan Yossef
 Cc: freebsd-questions@freebsd.org; [EMAIL PROTECTED]; 
 [EMAIL PROTECTED]
 Subject: Re: Capturing dmesg upon system crash on 6.3
 
 Yehonatan, good day.
 
 Mon, Feb 25, 2008 at 11:28:12AM +0200, Yehonatan Yossef wrote:
  I'm a freebsd newbee, trying to port an ethernet driver 
 from Linux to 
  FreeBSD 6.3.
  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).
 
 May be serial console will help you?
 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/seri
 alconsole-setup.html
 
 Out of curiosity: are you porting some InfiniBand drivers to FreeBSD?
 --
 Eygene
 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: Capturing dmesg upon system crash on 6.3

2008-02-25 Thread Yehonatan Yossef
 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.

Yony
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Capturing dmesg upon system crash on 6.3

2008-02-25 Thread Eygene Ryabinkin
Yehonatan, good day.

Mon, Feb 25, 2008 at 11:28:12AM +0200, Yehonatan Yossef wrote:
 I'm a freebsd newbee, trying to port an ethernet driver from Linux to
 FreeBSD 6.3.
 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).

May be serial console will help you?
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/serialconsole-setup.html

Out of curiosity: are you porting some InfiniBand drivers to FreeBSD?
-- 
Eygene
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Capturing dmesg upon system crash on 6.3

2008-02-25 Thread Eygene Ryabinkin
Mon, Feb 25, 2008 at 03:41:03PM +0200, Yehonatan Yossef wrote:
 I'm looking into the syslogd capabilities at the moment, it might be
 enough.

Syslog can die too early to spot everything.  But your mileage may vary.

 I've tried following the serial console setup you've pointed, but when I
 added the 'console=comconsole' to loader.conf the OS hanged during
 boot time, had to re-install the system.

You mean that nothing were seen on the other end of the serial cable?
I had not used serial console in FreeBSD for a while, so maybe others
can tell if the Handbook is still correct?

And if the only change that was made to make the OS hang was the
change in the loader.conf, then you could just use LiveFS CD and
edit loader.conf at your system -- there is no point in wasting
time reinstalling the whole system.
-- 
Eygene
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Capturing dmesg upon system crash on 6.3

2008-02-25 Thread Mel
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
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Capturing dmesg upon system crash on 6.3

2008-02-25 Thread Dieter
 I'm looking into the syslogd capabilities at the moment, it might be
 enough.
 I've tried following the serial console setup you've pointed, but when I
 added the 'console=3Dcomconsole' to loader.conf the OS hanged during
 boot time, had to re-install the system.

I assume the info you need is not getting captured in /var/log?

Perhaps your system needs a firmware setting changed to use a RS-232 console?

I assume it is not waiting for a control line, e.g. carrier detect, to go high?

Some systems have buggy firmware and still read from the ps2 keyboard
even though they are printing to the RS-232 console.

If all else fails there is the aim a video camera at the screen method.  :-(
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]