Re: [PATCH] Re: kernel/printk.c: increasing the buffer size to capture devfsd debug messages.

Robert Read (rread@datarithm.net)
Tue, 20 Feb 2001 14:05:15 -0800


On Tue, Feb 20, 2001 at 02:53:04PM -0600, Thomas Dodd wrote:
> Robert Read wrote:
>
> Why not just make the config option in Kbytes.
> and do:
>
> #define LOG_BUF_LEN (CONFIG_PRINTK_BUF_LEN * 1024)
>

This is good idea, but I believe LOG_BUF_LEN needs to be a power of
2. A bitmask is used in several places to wrap around the end of the
ring buffer. For example

#define LOG_BUF_MASK (LOG_BUF_LEN-1)

printk() {
....
log_buf[(log_start+log_size) & LOG_BUF_MASK] = *p;
}

I think LOG_BUF_LEN could be defined to round up (or down) at compile
time, but my post-lunch-sleepy brain can't think of the trick to do
it.

robert
-
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/