public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] netconsole - log kernel messages over the network. 2.4.10.
@ 2001-09-26 20:04 Ingo Molnar
  2001-09-26 19:36 ` Marcelo Tosatti
  0 siblings, 1 reply; 33+ messages in thread
From: Ingo Molnar @ 2001-09-26 20:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-net, netdev


this is the first public release of the 'netconsole patch', a debugging
patch that implements kernel-level network logging via UDP packets.

the special thing about this approach is the ability to send 'emergency'
network packets even from IRQ handlers. This enables the netconsole to
send enough info even if we crash in init or in an interrupt handler.

another property of netconsole is that it's able to share the networking
device with other kernel subsystems, like the TCP/IP stack. So the
networking device is not dedicated for netconsole use, it's transparently
shared.

netconsole is also designed to be robust, it goes straight to the network
driver, so it does not depend on the networking stack to log messages.

kernel-level netlogging is useful in a number of scenarios:

 - if remotely managed systems with no serial cable logging keep crashing
   without any trace of an oops message in the userspace log. (the patch
   was written to debug such a crash. Original idea of sending an
   emergency packet from IRQ handlers comes from Daniel Veillard who's
   system produced the crash - thanks Daniel!)

 - if for whatever reason the amount of logging is so high that a serial
   console cannot hold it and disks can not keep up - or in cases where
   logged messages disturb the debugged subsystem. I'm sure fellow VM
   hackers will find this useful :-)

 - the netconsole can be used to emit crashdumps over the network, without
   any delay between the point of crash and start of netlogging.

the kernel patch (against 2.4.10 or 2.4.9-ac), and a simple user-space
tool to display netconsole messages can be found at:

	http://redhat.com/~mingo/netconsole-patches/

sample startup of the netconsole on the server:

     insmod netconsole dev=eth1 target_ip=0x0a000701 \
                  source_port=6666 \
                  target_port=6666 \
                  target_eth_byte0=0x00 \
                  target_eth_byte1=0x90\
                  target_eth_byte2=0x27 \
                  target_eth_byte3=0x8C \
                  target_eth_byte4=0xA0 \
                  target_eth_byte5=0xA8

and on the client:

	# ./netconsole-client -server 10.0.7.5 -client 10.0.7.1 -port 6666
        [...network console startup...]
        netconsole: network logging started up successfully!
        SysRq : Loglevel set to 9

more about features and limitations can be found under:

	Documentation/networking/netlogging.txt

reports, comments, suggestions welcome.

	Ingo


^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: [patch] netconsole - log kernel messages over the network. 2.4.10.
@ 2001-09-28  2:53 Albert Cranford
  2001-09-28  7:45 ` [patch] netconsole-2.4.10-C2 Ingo Molnar
  0 siblings, 1 reply; 33+ messages in thread
From: Albert Cranford @ 2001-09-28  2:53 UTC (permalink / raw)
  To: Andrew Morton, Ingo Molnar; +Cc: ookhoi, linux-kernel

Great tool Ingo thanks.  Below is a tested tulip patch.
Thanks Andrew for the the inspiration.
Albert
Andrew Morton wrote:
> 
> Ookhoi wrote:
> >
> 
> What we need is for a bunch of people to implement poll_controller()
> for *their* ethernet driver and contribute the tested diffs
> back to Ingo.
> 


/etc/rc.d/rc.netconsole 192.168.1.2
dev=eth0 target_ip=0xC0A80102 source_port=6666 target_port=6666 \
        target_eth_byte0=0x00 target_eth_byte1=0x03 target_eth_byte2=0x6D \
        target_eth_byte3=0x16 target_eth_byte4=0x51 target_eth_byte5=0xAE
Using /lib/modules/2.4.10/kernel/drivers/net/netconsole.o

~~~~~~~~~~~   DMESG from server  ~~~~~~~~~~~~~~~~
Linux version 2.4.10 (root@home1) (gcc version 3.0.1) \
        #1 Thu Sep 27 22:28:20 EDT 2001
.......
Linux Tulip driver version 0.9.15-pre6 (July 2, 2001)
eth0: ADMtek Comet rev 17 at 0xdc00, 00:03:6D:16:4E:39, IRQ 10.
.........
netconsole: using network device <eth0>
netconsole: using source IP -64.-88.1.10
netconsole: using target IP -64.-88.1.2
netconsole: using source UDP port: 6666
netconsole: using target UDP port: 6666
netconsole: using target ethernet address 00:03:6d:16:51:ae.
netconsole: network logging started up successfully!
netconsole-client -server 0xc0a8010a -client 0xc0a80102 -port 6666
~~~~~~~~~ Start netconsole-client ~~~~~~~~
displaying netconsole output from server 0xc0a8010a, \
        client 0xc0a80102, UDP port 6666.
~~~~~~~~~ Alt-SysRq-s on Server output to client ~~~~~
SysRq : Emergency Sync
Syncing device 08:04 ... OK
Syncing device 08:12 ... OK
Syncing device 08:01 ... OK
Done.
~~~~~~~~~~ PATCH BEGIN ~~~~~~~~~~~~~~~
--- linux/drivers/net/tulip/tulip_core.c.orig   Thu Sep 27 21:04:14 2001
+++ linux/drivers/net/tulip/tulip_core.c        Thu Sep 27 10:10:15 2001
@@ -243,6 +243,7 @@
 static struct net_device_stats *tulip_get_stats(struct net_device *dev);
 static int private_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 static void set_rx_mode(struct net_device *dev);
+static void poll_tulip(struct net_device *dev);
 
 
 
@@ -1671,6 +1672,9 @@
        dev->get_stats = tulip_get_stats;
        dev->do_ioctl = private_ioctl;
        dev->set_multicast_list = set_rx_mode;
+#ifdef HAVE_POLL_CONTROLLER
+       dev->poll_controller = &poll_tulip;
+#endif
 
        if (register_netdev(dev))
                goto err_out_free_ring;
@@ -1839,6 +1843,24 @@
 
        /* pci_power_off (pdev, -1); */
 }
+
+
+#ifdef HAVE_POLL_CONTROLLER
+
+/*
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+
+static void poll_tulip (struct net_device *dev)
+{
+       disable_irq(dev->irq);
+       tulip_interrupt (dev->irq, dev, NULL);
+       enable_irq(dev->irq);
+}
+
+#endif
 
 
 static struct pci_driver tulip_driver = {
~~~~~~~~~~ PATCH END ~~~~~~~~~~~~~~~

-- 
Albert Cranford Deerfield Beach FL USA
ac9410@bellsouth.net


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2001-10-03  1:13 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-26 20:04 [patch] netconsole - log kernel messages over the network. 2.4.10 Ingo Molnar
2001-09-26 19:36 ` Marcelo Tosatti
2001-09-26 21:15   ` jamal
2001-09-27  5:45     ` Ingo Molnar
2001-09-26 21:29   ` Andreas Dilger
2001-09-26 23:46     ` Andreas Dilger
2001-09-27  5:28       ` Ingo Molnar
2001-09-27  6:38   ` [patch] netconsole-2.4.10-B1 Ingo Molnar
2001-09-28  7:08     ` Andreas Dilger
2001-09-29  1:34       ` Randy.Dunlap
2001-09-29  9:52         ` Ingo Molnar
2001-09-29 16:32           ` John Alvord
2001-09-29 16:40           ` Pekka Savola
2001-09-29 22:37             ` Andreas Dilger
2001-09-30  3:38           ` Kenneth Johansson
2001-09-30  7:52             ` Rik van Riel
2001-09-30 10:40               ` Riley Williams
2001-09-30 10:48               ` Glynn Clements
2001-09-30 12:25               ` Richard Gooch
2001-10-01  7:35                 ` Ingo Molnar
2001-10-01 14:55                   ` Oliver Xymoron
2001-10-01 16:28                   ` Richard Gooch
2001-10-01  8:47               ` Henning P. Schmiedehausen
2001-10-01 16:03                 ` Andreas Dilger
2001-09-30 21:18             ` H. Peter Anvin
2001-09-30 16:00           ` Marcus Sundberg
2001-10-01  7:39             ` Ingo Molnar
2001-09-30 19:42           ` Randy.Dunlap
2001-09-30 20:25             ` Randy.Dunlap
2001-10-01  4:09               ` Andreas Dilger
2001-10-03  1:09                 ` [patch] netconsole-2.4.10-C2 Randy.Dunlap
2001-10-01 16:58       ` [patch] netconsole-2.4.10-B1 Randy.Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2001-09-28  2:53 [patch] netconsole - log kernel messages over the network. 2.4.10 Albert Cranford
2001-09-28  7:45 ` [patch] netconsole-2.4.10-C2 Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox