From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755570AbZBELxZ (ORCPT ); Thu, 5 Feb 2009 06:53:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752730AbZBELxO (ORCPT ); Thu, 5 Feb 2009 06:53:14 -0500 Received: from charlotte.tuxdriver.com ([70.61.120.58]:45375 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752350AbZBELxN (ORCPT ); Thu, 5 Feb 2009 06:53:13 -0500 Date: Thu, 5 Feb 2009 06:52:54 -0500 From: Neil Horman To: "Ken'ichi Ohmichi" Cc: Eric Biederman , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, hbabu@us.ibm.com, Simon Horman , Andrew Morton , Vivek Goyal Subject: Re: [PATCH]: add dmesg log symbols to /proc/vmcoreinfo lists Message-ID: <20090205115254.GA15621@hmsreliant.think-freely.org> References: <20090119212127.GA13157@hmsreliant.think-freely.org> <20090120141551.GA5125@redhat.com> <20090120150958.GB18207@hmsreliant.think-freely.org> <20090120152255.GB5125@redhat.com> <20090127001211.f847ea5a.akpm@linux-foundation.org> <20090128041109.GA4943@verge.net.au> <20090204120549.GA2182@hmsreliant.think-freely.org> <498A317A.8030707@mxs.nes.nec.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <498A317A.8030707@mxs.nes.nec.co.jp> User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam-Score: -1.4 (-) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 05, 2009 at 09:23:22AM +0900, Ken'ichi Ohmichi wrote: > > Hi Neil, > > Thank you for a kernel patch and a makedumpfile patch. > > Neil Horman wrote: > >> That aside we aren't currently exporting log_buf_len, so I don't > >> think this code works actually works. > >> > >> Neil can you add a comment in kernel/printk.c of the algorithm > >> necessary for external tools to decode the ring buffer? > >> > >> We need the comment because people working on kernel/printk.c > >> need to know what is happening and without having to review lots > >> of user space code, and we need the comment to verify that we > >> are exporting the right things. > >> > > > > Ok, as per Erics comment, I've written this. It applies on top of whats already > > in your tree Andrew. It adds some comments on the function in question so that > > anyone working on printk.c will know why we're exporting their symbols. It also > > modifies slightly the symbols we are exporting so that we can handle dmesg > > buffers that are longer than the standard PAGE_SIZE configuration, and lets us > > detect and handle buffer wraps. > > > > Thanks! > > > > printk.c | 12 +++++++++++- > > 1 file changed, 11 insertions(+), 1 deletion(-) > > > > Signed-off-by: Neil Horman > > > > diff --git a/kernel/printk.c b/kernel/printk.c > > index dd5cc7b..6a1163b 100644 > > --- a/kernel/printk.c > > +++ b/kernel/printk.c > > @@ -138,10 +138,20 @@ static int log_buf_len = __LOG_BUF_LEN; > > static unsigned logged_chars; /* Number of chars produced since last read+clear operation */ > > > > #ifdef CONFIG_KEXEC > > +/* > > + * This appends the listed symbols to /proc/vmcoreinfo > > + * /proc/vmcoreinfo is used by various utiilties, like > > + * crash and makedumpfile to obtain access to symbols that > > + * are otherwise very difficult to locate. These symbols > > + * are specifically used so that utilities > > + * can access and extract the dmesg log from a vmcore file > > + * after a crash > > + */ > > void log_buf_kexec_setup(void) > > { > > VMCOREINFO_SYMBOL(log_buf); > > - VMCOREINFO_SYMBOL(log_end); > > + VMCOREINFO_SYMBOL(log_buf_len); > > + VMCOREINFO_SYMBOL(logged_chars) > > } > > #endif > > Please do not remove VMCOREINFO_SYMBOL(log_end), because makedumpfile > needs it for knowing the latest log offset in ring buffer of dmesg. > I updated a makedumpfile patch for handling ring buffer, and it is > possible to download the latest patch from the following site: > > https://sourceforge.net/tracker2/download.php?group_id=178938&atid=887142&file_id=312113&aid=2521075 > Understood, new patch attached. Add some comments and extra symbols on top of whats there for kernel/printk.c to satisfy Erics requests, and support Ken'ichi's enhanced version of the makedumpfile patch Neil Signed-off-by: Neil Horman printk.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kernel/printk.c b/kernel/printk.c index dd5cc7b..6c25eba 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -138,10 +138,21 @@ static int log_buf_len = __LOG_BUF_LEN; static unsigned logged_chars; /* Number of chars produced since last read+clear operation */ #ifdef CONFIG_KEXEC +/* + * This appends the listed symbols to /proc/vmcoreinfo + * /proc/vmcoreinfo is used by various utiilties, like + * crash and makedumpfile to obtain access to symbols that + * are otherwise very difficult to locate. These symbols + * are specifically used so that utilities + * can access and extract the dmesg log from a vmcore file + * after a crash + */ void log_buf_kexec_setup(void) { VMCOREINFO_SYMBOL(log_buf); VMCOREINFO_SYMBOL(log_end); + VMCOREINFO_SYMBOL(log_buf_len); + VMCOREINFO_SYMBOL(logged_chars) } #endif