Custom kernel logging using an USB microcontroller?

From: Jouko Orava
Date: Sun Dec 12 2010 - 19:32:11 EST


Hello,

Would any of you happen to have written a kernel module for
custom kernel logging to a USB microcontroller?

I'm having unexpected shutdowns/reboots with absolutely no
sign of the cause in any logs, when using the radeon driver
heavily, and having kernel MCE support enabled. Disabling kernel
MCE support seems to eliminate the problem. See
https://bugs.freedesktop.org/show_bug.cgi?id=30349 for details.

I don't have suitable hardware for a serial console, so
this is proving really difficult to investigate.

I do, however, have a USB AVR microcontroller (pjrc.com/teensy),
which has a few thousand bytes of RAM; I'd like to use it as a custom
logging device. Specifically, I need an in-kernel interface to log
directly to the USB microcontroller, so I can find out the codepath
causing the problems I'm having. (I suspect thermal or voltage
misreporting, so a printk interface would be useful.)
I don't really want nor need to save the entire kernel log.

Since these USB microcontrollers are dirt cheap (24 USD), need only
an USB cable to work, and are very easy to program as HID devices using
avr-gcc, it occurs to me that this has probably been already done.
It seems like a useful tool for any kernel or kernel module developer.

So, any pointers to existing code I could adapt?
Or hints on how the kernel-side logging via USB should be done?

Thanks for your time,
Jouko Orava
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/