public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] report size of printk buffer
@ 2004-05-04 16:09 Andries.Brouwer
  2004-05-05 13:12 ` Olaf Dabrunz
  2004-05-05 20:42 ` Roman Zippel
  0 siblings, 2 replies; 6+ messages in thread
From: Andries.Brouwer @ 2004-05-04 16:09 UTC (permalink / raw)
  To: akpm, torvalds; +Cc: linux-kernel

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;

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-05-06 15:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-04 16:09 [PATCH] report size of printk buffer Andries.Brouwer
2004-05-05 13:12 ` Olaf Dabrunz
2004-05-05 20:42 ` Roman Zippel
2004-05-06 13:36   ` Andries Brouwer
2004-05-06 15:11     ` Roman Zippel
2004-05-06 15:23       ` Andries Brouwer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox