1

I'm trying to understand Linux better, specifically driver registration and such so I'm trying to follow what happens when I insert modules and drivers. From what I thought I understood, kernel events such as module insertion and removal are logged in /var/log/messages, but I'm finding inconsistent results depending on the module. For instance, if I load the usb-storage module, the kernel logs the process to /var/log/messages, as demonstrated below:

[root@lily frank]# modprobe -v usb-storage
insmod /lib/modules/2.6.32-573.26.1.el6.i686/kernel/drivers/usb/storage/usb-storage.ko 

[root@lily dev]# cat /var/log/messages | tail
Jun 16 10:03:29 lily kernel: Initializing USB Mass Storage driver...
Jun 16 10:03:29 lily kernel: usbcore: registered new interface driver usb-storage
Jun 16 10:03:29 lily kernel: USB Mass Storage support registered.

But is when I try the same thing with some other modules, the kernel doesn't log the operation, as demonstrated below with the fcoe driver:

[root@lily dev]# modprobe -v fcoe
insmod /lib/modules/2.6.32-573.26.1.el6.i686/kernel/drivers/scsi/scsi_tgt.ko 
insmod /lib/modules/2.6.32-573.26.1.el6.i686/kernel/drivers/scsi/scsi_transport_fc.ko 
insmod /lib/modules/2.6.32-573.26.1.el6.i686/kernel/drivers/scsi/libfc/libfc.ko 
insmod /lib/modules/2.6.32-573.26.1.el6.i686/kernel/drivers/scsi/fcoe/libfcoe.ko 
insmod /lib/modules/2.6.32-573.26.1.el6.i686/kernel/drivers/scsi/fcoe/fcoe.ko 
[root@lily dev]# cat /var/log/messages | tail
Jun 16 10:03:29 lily kernel: Initializing USB Mass Storage driver...
Jun 16 10:03:29 lily kernel: usbcore: registered new interface driver usb-storage
Jun 16 10:03:29 lily kernel: USB Mass Storage support registered.

As you can see the kernel hasn't log anything in /var/log/messages since logging the insertion of the usb-storage module. I find it doesn't log the insertion of a lot of modules.

Can somebody tell me the reason for this behavior? Does it have to do with logging levels or something?

1

The kernel doesn't log module operations in a centralised manner, each module can log whatever it wants (using printk()). The USB module logs "Initializing USB Mass Storage Driver..." etc.; but the FCoE drivers only log messages when errors occur — if everything loads correctly they're silent. Many modules work this way; the tendency is to minimize the number of messages logged, especially when things are working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.