From: "bhe@redhat.com" <bhe@redhat.com>
To: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Cc: "kexec@lists.infradead.org" <kexec@lists.infradead.org>,
"vgoyal@redhat.com" <vgoyal@redhat.com>
Subject: Re: [Patch v3 3/7] preparation functions for parsing vmcoreinfo
Date: Tue, 12 Aug 2014 18:01:56 +0800 [thread overview]
Message-ID: <20140812100156.GC4887@dhcp-16-105.nay.redhat.com> (raw)
In-Reply-To: <20140812094623.GB4887@dhcp-16-105.nay.redhat.com>
On 08/12/14 at 05:46pm, Baoquan He wrote:
> On 08/01/14 at 07:12am, Atsushi Kumagai wrote:
> > >diff --git a/makedumpfile.c b/makedumpfile.c
> > >index 220570e..78aa7a5 100644
> > >--- a/makedumpfile.c
> > >+++ b/makedumpfile.c
> > >@@ -681,6 +681,10 @@ get_kernel_version(char *release)
> > > int32_t version;
> > > long maj, min, rel;
> > > char *start, *end;
> > >+ static int done = 0;
> > >+
> > >+ if (done)
> > >+ return info->kernel_version;
> >
> > This function just convert the argument as string into
> > a number, it shouldn't be affected by external factors.
> >
> > You should use info->kernel_version in the caller side if
> > you want to avoid duplicate calling of this function, but
> > I think it's unnecessary since this function is small.
>
> In show_mem_usage() implementaion, the page_offset is needed before
> initial() calling because the dumpable elf program loads have ot be
> prepared before that. However in current commited code, the page_offset
> is got in initial() when call check_release().
>
> So I have to get it in advance by this way. Then the
> get_kernel_version() can be reused in this way. Anyway, by this I
> needn't change the code in initial().
>
> If use info->kernel_version directly before initial() calling, it's
> still zero.
>
I add the static variable "done" just because it always print below
warning message twice, this makes me uncomfortable. Otherwise
get_kernel_version() can be called any time no matter how many times it
has been called if it's only a converting utility function.
The kernel version is not supported.
The created dumpfile may be incomplete.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2014-08-12 10:03 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-28 8:19 [Patch v3 0/7] add a new interface to show the memory usage of 1st kernel Baoquan He
2014-07-28 8:20 ` [Patch v3 1/7] initialize pfn_memhole in get_num_dumpable_cyclic Baoquan He
2014-07-28 8:20 ` [Patch v3 2/7] functions to get crashkernel memory range Baoquan He
2014-08-01 7:32 ` Atsushi Kumagai
2014-08-12 9:25 ` bhe
2014-07-28 8:20 ` [Patch v3 3/7] preparation functions for parsing vmcoreinfo Baoquan He
2014-08-01 7:12 ` Atsushi Kumagai
2014-08-12 9:46 ` bhe
2014-08-12 10:01 ` bhe [this message]
2014-08-14 7:37 ` Atsushi Kumagai
2014-08-14 8:15 ` bhe
2014-07-28 8:20 ` [Patch v3 4/7] set vmcoreinfo for kcore Baoquan He
2014-08-01 7:12 ` Atsushi Kumagai
2014-08-12 10:08 ` bhe
2014-07-28 8:20 ` [Patch v3 5/7] prepare the dump loads for kcore analysis Baoquan He
2014-08-01 7:12 ` Atsushi Kumagai
2014-08-12 10:10 ` bhe
2014-07-28 8:20 ` [Patch v3 6/7] implement a function to print the memory usage Baoquan He
2014-07-28 8:20 ` [Patch v3 7/7] add a new interface to show the memory usage of 1st kernel Baoquan He
2014-07-29 12:43 ` Vivek Goyal
2014-07-31 2:32 ` Baoquan He
2014-08-01 7:12 ` Atsushi Kumagai
2014-08-12 10:14 ` bhe
2014-08-21 10:31 ` bhe
2014-08-26 2:28 ` Atsushi Kumagai
2014-08-26 3:22 ` bhe
2014-08-26 6:25 ` Petr Tesarik
2014-08-26 14:12 ` bhe
2014-09-02 6:20 ` Atsushi Kumagai
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=20140812100156.GC4887@dhcp-16-105.nay.redhat.com \
--to=bhe@redhat.com \
--cc=kexec@lists.infradead.org \
--cc=kumagai-atsushi@mxc.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