netconsole - log kernel messages over the network. 2.4.10.
Hi All,
Ingo was not aware of the sourceforge project, and suggested me to resend my reply to lkml. Does the patch work for you guys? Do I do something wrong? That would be more than possible. :-)
----- Forwarded message from Ookhoi <[email protected]> -----
To: Ingo Molnar <[email protected]>
Cc: [email protected]
Hi Ingo,
Quoted 2 lines
this is the first public release of the 'netconsole patch', a debugging patch that implements kernel-level network logging via UDP packets.
Is this different from the netconsole project on sourceforge? The last message on that lists seemes to be from july, and you didn't cc it.
Quoted 4 lines
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:
Can you also make older patches available for testing? The current netconsole-2.4.10-B1 doesn't seem to work for me on plain 2.4.10 or 2.4.9-ac15 patched with Rik his latest vm patch. The patch applies fine, but I can't load the module:
cuddle:~# uname -a Linux cuddle 2.4.9-ac15 #1 Thu Sep 27 13:54:51 CEST 2001 i686 unknown cuddle:~# insmod netconsole dev=eth0 target_ip=0x0a604875 source_port=6666 target_port=5555 Using /lib/modules/2.4.9-ac15/kernel/drivers/net/netconsole.o /lib/modules/2.4.9-ac15/kernel/drivers/net/netconsole.o: init_module: Operation not permitted Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters
The same message for plain 2.4.10, and the same when I use the script netconsole-server included in netconsole-client-20010927. I also tried it with the target_eth_byte0 thingies, with the mac address from the local nic.
Target ip address is 10.96.72.117 (I hope 0x0a604875 is oke)
Quoted 19 lines
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=0xA8and 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
Quoted 5 lines
more about features and limitations can be found under:
Documentation/networking/netlogging.txtreports, comments, suggestions welcome.
Somebody more or less asked this already, but, will things like SysRq work in the future? That would be great. :-) Thnx!
Ookhoi
----- End forwarded message -----
Quoted 7 lines · Ookhoi
Hi All,
Ingo was not aware of the sourceforge project, and suggested me to resend my reply to lkml. Does the patch work for you guys? Do I do something wrong? That would be more than possible. :-)
Quoted 7 lines
...
cuddle:~# uname -a Linux cuddle 2.4.9-ac15 #1 Thu Sep 27 13:54:51 CEST 2001 i686 unknown cuddle:~# insmod netconsole dev=eth0 target_ip=0x0a604875 source_port=6666 target_port=5555 Using /lib/modules/2.4.9-ac15/kernel/drivers/net/netconsole.o /lib/modules/2.4.9-ac15/kernel/drivers/net/netconsole.o: init_module: Operation not permitted Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters
If you're not using the eepro100 driver, then an insmod of the netconsole driver will fail:
+ if (!ndev->poll_controller) {
+ printk(KERN_ERR "netconsole: %s's network driver does not implement netlogging yet, aborting.\n", dev);
+ return -1;
+ }
Maybe that message is in your logs somewhere?
Take a look at the poll_controller() implementation in the eepro100 part of Ingo's patch - it's dead simple.
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.
-
Hi Andrew,
Quoted 21 lines
Quoted 11 lines
Ingo was not aware of the sourceforge project, and suggested me to resend my reply to lkml. Does the patch work for you guys? Do I do something wrong? That would be more than possible. :-)
...
cuddle:~# uname -a Linux cuddle 2.4.9-ac15 #1 Thu Sep 27 13:54:51 CEST 2001 i686 unknown cuddle:~# insmod netconsole dev=eth0 target_ip=0x0a604875 source_port=6666 target_port=5555 Using /lib/modules/2.4.9-ac15/kernel/drivers/net/netconsole.o /lib/modules/2.4.9-ac15/kernel/drivers/net/netconsole.o: init_module: Operation not permitted Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parametersIf you're not using the eepro100 driver, then an insmod of the netconsole driver will fail:
(quoted diff) +4
-0+ if (!ndev->poll_controller) { + printk(KERN_ERR "netconsole: %s's network driver does not implement netlogging yet, aborting.\n", dev); + return -1; + }
Quoted 1 line
Maybe that message is in your logs somewhere?
Have to check that, can't reach the machine atm. But I don't use the eepro100 driver for sure in that machine, so the insmod failure makes sense. :-)
Quoted 2 lines
Take a look at the
poll_controller()implementation in the eepro100 part of Ingo's patch - it's dead simple.
I believe you ;-) but I'm affraid I'm just a user, no programmer at all :-(
Quoted 3 lines
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.
Would love to contribute.. Anyway, thank you for your answer!
Ookhoi
Great tool Ingo thanks. Below is a tested tulip patch. Thanks Andrew for the the inspiration.
Albert
Quoted 8 lines · Andrew Morton
Quoted 1 line · Ookhoi
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=0xAEUsing /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 ~~~~~~~~~~~~~~~
drivers/net/tulip/tulip_core.c Thu Sep 27 10:10:15 2001 renamed from drivers/net/tulip/tulip_core.c.orig Thu Sep 27 21:04:14 2001 +22 -0
@@ -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 ~~~~~~~~~~~~~~~
Signature · 2 lines
Albert Cranford Deerfield Beach FL USA [email protected]
PATCH 1/1 netconsole-2.4.10-C2
Quoted 2 lines · Albert Cranford
Great tool Ingo thanks. Below is a tested tulip patch. Thanks Andrew for the the inspiration.
thanks Albert - i've added it to the patch, and the latest netconsole-2.4.10-C2 version can be downloaded from:
http://redhat.com/~mingo/netconsole-patches/
NOTE: new client-side utilities are needed as well.
other changes:
- netconsole-server fix from Andreas Dilger
- introduced versioning and offsetting of output, to display messages in the correct order even if interim routers reorder packets. Future netconsole-clients should reliably detect the right protocol version.
- small cleanups.
Ingo
netconsole patch for 2.5?
Hello,
Is there a netconsole patch for Linux 2.5? Is netconsole on anyone's radar for inclusion?
Thanks a lot!
Quoted 31 lines · Ingo Molnar
Quoted 2 lines · Albert Cranford
Great tool Ingo thanks. Below is a tested tulip patch. Thanks Andrew for the the inspiration.
thanks Albert - i've added it to the patch, and the latest netconsole-2.4.10-C2 version can be downloaded from:
http://redhat.com/~mingo/netconsole-patches/
NOTE: new client-side utilities are needed as well.
other changes:
- netconsole-server fix from Andreas Dilger
- introduced versioning and offsetting of output, to display messages in the correct order even if interim routers reorder packets. Future netconsole-clients should reliably detect the right protocol version.
- small cleanups.
Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/