Messages in this thread Patch in this message | | | Date | Tue, 4 May 2004 18:09:12 +0200 (MEST) | From | <> | Subject | [PATCH] report size of printk buffer |
| |
In the old days the printk log buffer had a constant size, and dmesg asked for the 4096, later 8192, later 16384 bytes in there. These days the printk log buffer has variable size, and it is not easy for dmesg to do the right thing, especially when doing a "read and clear". The patch below adds a syslog subfuntion that reports the buffer size.
Andries
diff -uprN -X /linux/dontdiff a/kernel/printk.c b/kernel/printk.c --- a/kernel/printk.c 2004-03-28 17:11:55.000000000 +0200 +++ b/kernel/printk.c 2004-05-04 18:00:27.000000000 +0200 @@ -240,6 +240,7 @@ __setup("log_buf_len=", log_buf_len_setu * 7 -- Enable printk's to console * 8 -- Set level of messages printed to console * 9 -- Return number of unread characters in the log buffer + * 10 -- Return size of the log buffer */ int do_syslog(int type, char __user * buf, int len) { @@ -359,6 +360,9 @@ int do_syslog(int type, char __user * bu case 9: /* Number of chars in the log buffer */ error = log_end - log_start; break; + case 10: /* Size of the log buffer */ + error = log_buf_len; + break; default: error = -EINVAL; break; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |