From: Simon Horman <horms@verge.net.au>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: "Ken'ichi Ohmichi" <oomichi@mxs.nes.nec.co.jp>,
Eric Biederman <ebiederm@xmision.com>,
kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
hbabu@us.ibm.com, Andrew Morton <akpm@linux-foundation.org>,
Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [PATCH]: add dmesg log symbols to /proc/vmcoreinfo lists
Date: Sun, 8 Feb 2009 17:52:37 +0900 [thread overview]
Message-ID: <20090208085235.GA2804@verge.net.au> (raw)
In-Reply-To: <20090205115254.GA15621@hmsreliant.think-freely.org>
On Thu, Feb 05, 2009 at 06:52:54AM -0500, Neil Horman wrote:
> 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 <nhorman@tuxdriver.com>
> > >
> > > 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 <nhorman@tuxdriver.com>
>
>
>
> 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
Utilities appears to have a typo.
> + * 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
--
Simon Horman
VA Linux Systems Japan K.K., Sydney, Australia Satellite Office
H: www.vergenet.net/~horms/ W: www.valinux.co.jp/en
prev parent reply other threads:[~2009-02-08 11:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-19 21:21 [PATCH]: add dmesg log symbols to /proc/vmcoreinfo lists Neil Horman
2009-01-20 4:12 ` Simon Horman
2009-01-20 14:15 ` Vivek Goyal
2009-01-20 15:09 ` Neil Horman
2009-01-20 15:22 ` Vivek Goyal
2009-01-27 8:12 ` Andrew Morton
2009-01-27 11:55 ` Neil Horman
2009-01-27 15:37 ` Vivek Goyal
2009-01-28 4:11 ` Simon Horman
2009-02-03 20:45 ` Eric W. Biederman
2009-02-04 12:05 ` Neil Horman
2009-02-04 15:37 ` Eric W. Biederman
2009-02-04 21:41 ` Neil Horman
2009-02-05 0:23 ` Ken'ichi Ohmichi
2009-02-05 11:52 ` Neil Horman
2009-02-08 8:52 ` Simon Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090208085235.GA2804@verge.net.au \
--to=horms@verge.net.au \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmision.com \
--cc=hbabu@us.ibm.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=oomichi@mxs.nes.nec.co.jp \
--cc=vgoyal@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox