Search code examples
linuxubuntulinux-kernelprintk

Where does output of print in kernel go?


I am debugging a driver for linux (specifically ubuntu server 9.04), and there are several printf statements in the code.

Where can I view the output of these statements?

EDIT1: What i'm trying to do is write to kernel using the proc file-system. The print code is

static int proc_fractel_config_write(struct file *file, const char *argbuf, unsigned long count, void *data)
{
    printk(KERN_DEBUG "writing fractel config\n");
    ...

In kern.log, I see the following message when i try to overwrite the file /proc/net/madwifi/ath1/fractel_config (with varying time of course).

[ 8671.924873] proc write 
[ 8671.924919] 

Any explainations?


Solution

  • It depends on the distribution, but many use klogd(8) to get the messages from the kernel and will either log them to a file (sometimes /var/log/dmesg or /var/log/kernel) or to the system log via syslog(3). In the latter case, where the log entries end up will depend on the configuration of syslogd(8).

    One note about the dmesg command: Kernel messages are stored in a circular buffer, so large amounts of output will be overwritten.