[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091130093541.GA14254@logfs.org>
Date: Mon, 30 Nov 2009 10:35:41 +0100
From: Jörn Engel <joern@...fs.org>
To: Artem Bityutskiy <dedekind1@...il.com>
Cc: Simon Kagstrom <simon.kagstrom@...insight.net>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-mtd <linux-mtd@...ts.infradead.org>,
LKML <linux-kernel@...r.kernel.org>,
"Koskinen Aaro (Nokia-D/Helsinki)" <aaro.koskinen@...ia.com>,
Ingo Molnar <mingo@...e.hu>,
David Woodhouse <dwmw2@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Alan Cox <alan@...rguk.ukuu.org.uk>
Subject: Re: [PATCH/RFC v5 4/5]: core: Add dump device to call on oopses and panics
On Mon, 30 November 2009 10:51:58 +0200, Artem Bityutskiy wrote:
>
> How about this patch on top of the existing one (untested):
>
> + /*
> + * Have we ever rotated around the circular buffer? If we never did,
> + * we have to have zeroes at the end.
> + */
> + if (log_buf[end]) {
> + s1 = log_buf + end;
> + l1 = log_buf_len - end;
> + } else {
> + s1 = "";
> + l1 = 0;
So now you are assuming that a) the buffer is initially zeroed and b)
noone ever writes NUL to it. Is that correct?
I'm not sure whether those assumptions are valid. If they are, then
this will obviously work. Otherwise we can just always assume the
wrapped case.
Jörn
--
Write programs that do one thing and do it well. Write programs to work
together. Write programs to handle text streams, because that is a
universal interface.
-- Doug MacIlroy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists