From: Vivek Goyal <vgoyal@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Neil Horman <nhorman@tuxdriver.com>,
linux-kernel@vger.kernel.org, hbabu@us.ibm.com,
kexec@lists.infradead.org, horms@verge.net.au
Subject: Re: [PATCH]: add dmesg log symbols to /proc/vmcoreinfo lists
Date: Tue, 27 Jan 2009 10:37:32 -0500 [thread overview]
Message-ID: <20090127153732.GB4191@redhat.com> (raw)
In-Reply-To: <20090127001211.f847ea5a.akpm@linux-foundation.org>
On Tue, Jan 27, 2009 at 12:12:11AM -0800, Andrew Morton wrote:
> On Tue, 20 Jan 2009 10:22:56 -0500 Vivek Goyal <vgoyal@redhat.com> wrote:
>
> > On Tue, Jan 20, 2009 at 10:09:58AM -0500, Neil Horman wrote:
> > > On Tue, Jan 20, 2009 at 09:15:51AM -0500, Vivek Goyal wrote:
> > > > On Mon, Jan 19, 2009 at 04:21:27PM -0500, Neil Horman wrote:
> > > > > Hey all-
> > > > > It would be nice to be able to extract the dmesg log from a vmcore file
> > > > > without needing to keep the debug symbols for the running kernel handy all the
> > > > > time. We have a facility to do this in /proc/vmcore. This patch adds the
> > > > > log_buf and log_end symbols to the vmcoreinfo area so that tools (like
> > > > > makedumpfile) can easily extract the dmesg logs from a vmcore image.
> > > > >
> > > >
> > > > It would be nice to get dmesg log if debug symbols are not around. Can't
> > > > we use System.map for getting symbol addresses? vmcoreinfo had started
> > > > small and seems to be growing now. I am thinking down the line will making
> > > > use of System.map for such cases make sense?
> > > >
> > >
> > > System.map only include exported and public symbols. log_buf and log_end are
> > > static, and not reported in the System.map. Its a nice idea, but not
> > > comprehensive for everything in the kernel.
> > >
> > > ><snip>
> > > >
> > > > Will it be an issue if we make log_buf and log_end non static and directly
> > > > access these in kexec.c?
> > > >
> > > I had considered that, but was a bit hesitant to do so, since it exposes the
> > > internal implementation of the dmesg buffer. In the event someone disables
> > > CONFIG_PRINTK, thats just more code we need to ifdef. With this implementation
> > > we just stub out the log_buf_setup function, and let that be that. It seems
> > > more consice to me this way.
> > >
> >
> > Makes sense to me.
> >
> > Acked-by: Vivek Goyal <vgoyal@redhat.com>
> >
>
> I rewrote the title to
>
> kexec: add dmesg log symbols to /proc/vmcoreinfo lists
>
> it's nice to identify which subsystem is responsible for a patch.
>
> I also did all the below. Please check it. (Is anyone else reading all
> this stuff??)
>
>
> From: Andrew Morton <akpm@linux-foundation.org>
>
> - switch didnt-need-to-be-a-macro to inline
>
> - Remove unneeded ifdefs (we already did that in the header)
>
> - repair bouncy enter key
>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: Simon Horman <horms@verge.net.au>
> Cc: Vivek Goyal <vgoyal@redhat.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
Hi Andrew,
This looks good. I should have altleast caught unnecessary #ifdefs.:-(
Thanks
Vivek
> include/linux/kernel.h | 5 ++++-
> kernel/kexec.c | 2 --
> kernel/printk.c | 1 -
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff -puN include/linux/kernel.h~kexec-add-dmesg-log-symbols-to-proc-vmcoreinfo-lists-fix include/linux/kernel.h
> --- a/include/linux/kernel.h~kexec-add-dmesg-log-symbols-to-proc-vmcoreinfo-lists-fix
> +++ a/include/linux/kernel.h
> @@ -254,7 +254,10 @@ static inline int printk_ratelimit(void)
> static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \
> unsigned int interval_msec) \
> { return false; }
> -#define log_buf_kexec_setup() do {} while(0)
> +
> +static inline void log_buf_kexec_setup(void)
> +{
> +}
> #endif
>
> extern int printk_needs_cpu(int cpu);
> diff -puN kernel/kexec.c~kexec-add-dmesg-log-symbols-to-proc-vmcoreinfo-lists-fix kernel/kexec.c
> --- a/kernel/kexec.c~kexec-add-dmesg-log-symbols-to-proc-vmcoreinfo-lists-fix
> +++ a/kernel/kexec.c
> @@ -1409,9 +1409,7 @@ static int __init crash_save_vmcoreinfo_
> VMCOREINFO_OFFSET(list_head, prev);
> VMCOREINFO_OFFSET(vm_struct, addr);
> VMCOREINFO_LENGTH(zone.free_area, MAX_ORDER);
> -#ifdef CONFIG_PRINTK
> log_buf_kexec_setup();
> -#endif
> VMCOREINFO_LENGTH(free_area.free_list, MIGRATE_TYPES);
> VMCOREINFO_NUMBER(NR_FREE_PAGES);
> VMCOREINFO_NUMBER(PG_lru);
> diff -puN kernel/printk.c~kexec-add-dmesg-log-symbols-to-proc-vmcoreinfo-lists-fix kernel/printk.c
> --- a/kernel/printk.c~kexec-add-dmesg-log-symbols-to-proc-vmcoreinfo-lists-fix
> +++ a/kernel/printk.c
> @@ -143,7 +143,6 @@ void log_buf_kexec_setup(void)
> VMCOREINFO_SYMBOL(log_end);
> }
>
> -
> static int __init log_buf_len_setup(char *str)
> {
> unsigned size = memparse(str, &str);
> _
next prev parent reply other threads:[~2009-01-27 15:39 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 [this message]
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
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=20090127153732.GB4191@redhat.com \
--to=vgoyal@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hbabu@us.ibm.com \
--cc=horms@verge.net.au \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nhorman@tuxdriver.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