Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753842AbZK3Jfv (ORCPT ); Mon, 30 Nov 2009 04:35:51 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753811AbZK3Jfu (ORCPT ); Mon, 30 Nov 2009 04:35:50 -0500 Received: from lazybastard.de ([212.112.238.170]:46468 "EHLO longford.logfs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753789AbZK3Jft (ORCPT ); Mon, 30 Nov 2009 04:35:49 -0500 Date: Mon, 30 Nov 2009 10:35:41 +0100 From: =?utf-8?B?SsO2cm4=?= Engel To: Artem Bityutskiy Cc: Simon Kagstrom , Linus Torvalds , linux-mtd , LKML , "Koskinen Aaro (Nokia-D/Helsinki)" , Ingo Molnar , David Woodhouse , Andrew Morton , Alan Cox Subject: Re: [PATCH/RFC v5 4/5]: core: Add dump device to call on oopses and panics Message-ID: <20091130093541.GA14254@logfs.org> References: <20091012110954.67d7d8d8.akpm@linux-foundation.org> <20091012182346.GH17138@elte.hu> <20091013151751.59e217a7@marrow.netinsight.se> <20091013152235.188059d2@marrow.netinsight.se> <20091126093657.GA25430@logfs.org> <1259566071.7518.48.camel@localhost> <20091130074603.GA30911@logfs.org> <1259571118.7518.56.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1259571118.7518.56.camel@localhost> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1084 Lines: 34 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/