From: Simon Horman <horms@verge.net.au>
To: Thomas Renninger <trenn@suse.de>
Cc: yinghai@kernel.org, kexec@lists.infradead.org,
ebiederm@xmission.com, vgoyal@redhat.com
Subject: Re: [PATCH 2/4] kexec-tools: Introduce dbg_memrange() macro and make use of it
Date: Sun, 26 May 2013 22:17:18 +0900 [thread overview]
Message-ID: <20130526131718.GD11134@verge.net.au> (raw)
In-Reply-To: <1369213056-77661-3-git-send-email-trenn@suse.de>
On Wed, May 22, 2013 at 10:57:34AM +0200, Thomas Renninger wrote:
> There are several places where memory range arrays are printed for debug
> reasons. In load_crashdump_segments() the memory type is missing.
>
> Unify printing memory ranges in --debug case in a macro and add the first
> users.
>
> Signed-off-by: Thomas Renninger <trenn@suse.de>
> Signed-off-by: Thomas Renninger <Thomas Renninger" trenn@suse.de>
This patch seems fine, but the second signed-off-by line seems to
be a malformed duplicate of the first one.
> ---
> kexec/arch/i386/crashdump-x86.c | 5 +----
> kexec/arch/i386/kexec-x86-common.c | 6 +-----
> kexec/arch/ppc/crashdump-powerpc.c | 8 +-------
> kexec/kexec.h | 11 +++++++++++
> 4 files changed, 14 insertions(+), 16 deletions(-)
>
> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> index 17c8744..9b5a7cd 100644
> --- a/kexec/arch/i386/crashdump-x86.c
> +++ b/kexec/arch/i386/crashdump-x86.c
> @@ -959,10 +959,7 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,
>
> get_backup_area(info, mem_range, nr_ranges);
>
> - dbgprintf("CRASH MEMORY RANGES\n");
> -
> - for(i = 0; i < nr_ranges; ++i)
> - dbgprintf("%016Lx-%016Lx\n", mem_range[i].start, mem_range[i].end);
> + dbg_memrange("CRASH MEMORY RANGES", &mem_range, nr_ranges);
>
> /*
> * if the core type has not been set on command line, set it here
> diff --git a/kexec/arch/i386/kexec-x86-common.c b/kexec/arch/i386/kexec-x86-common.c
> index ed6c950..015dcb6 100644
> --- a/kexec/arch/i386/kexec-x86-common.c
> +++ b/kexec/arch/i386/kexec-x86-common.c
> @@ -477,11 +477,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges,
> mem_max = end;
> }
>
> - dbgprintf("MEMORY RANGES\n");
> - for (i = 0; i < *ranges; i++) {
> - dbgprintf("%016Lx-%016Lx (%d)\n", (*range)[i].start,
> - (*range)[i].end, (*range)[i].type);
> - }
> + dbg_memrange("MEMORY RANGES", range, *ranges);
>
> return ret;
> }
> diff --git a/kexec/arch/ppc/crashdump-powerpc.c b/kexec/arch/ppc/crashdump-powerpc.c
> index eee5b37..feb3cfd 100644
> --- a/kexec/arch/ppc/crashdump-powerpc.c
> +++ b/kexec/arch/ppc/crashdump-powerpc.c
> @@ -236,13 +236,7 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges)
> *ranges = memory_ranges;
>
> int j;
> - dbgprintf("CRASH MEMORY RANGES\n");
> - for (j = 0; j < *ranges; j++) {
> - start = crash_memory_range[j].start;
> - end = crash_memory_range[j].end;
> - dbgprintf("%016Lx-%016Lx\n", start, end);
> - }
> -
> + dbg_memrange("MEMORY RANGES", &crash_memory_range, *ranges);
> return 0;
>
> err:
> diff --git a/kexec/kexec.h b/kexec/kexec.h
> index 715b568..eea8c50 100644
> --- a/kexec/kexec.h
> +++ b/kexec/kexec.h
> @@ -121,6 +121,17 @@ do { \
> fprintf(stderr, __VA_ARGS__); \
> } while(0)
>
> +#define dbg_memrange(title, range, nr) \
> +do { \
> + int i; \
> + dbgprintf(title "\n"); \
> + for (i = 0; i < nr; i++) { \
> + dbgprintf("%016Lx-%016Lx (%d)\n", (*range)[i].start, \
> + (*range)[i].end, (*range)[i].type); \
> + } \
> + } while (0)
> +
> +
> struct kexec_segment {
> const void *buf;
> size_t bufsz;
> --
> 1.7.6.1
>
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2013-05-26 13:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-22 8:57 Different minor kexec cleanups Thomas Renninger
2013-05-22 8:57 ` [PATCH 1/4] kexec-tools: Cleanup: Fix indentation Thomas Renninger
2013-05-26 13:13 ` Simon Horman
2013-05-22 8:57 ` [PATCH 2/4] kexec-tools: Introduce dbg_memrange() macro and make use of it Thomas Renninger
2013-05-26 13:17 ` Simon Horman [this message]
2013-05-22 8:57 ` [PATCH 3/4] kexec-tools: Fix possible overflows and make use of dbg_memrange() macro Thomas Renninger
2013-05-26 13:16 ` Simon Horman
2013-05-22 8:57 ` [PATCH 4/4] kexec-tools: Add cgroup_disable=memory to crash kernel parameters Thomas Renninger
2013-05-26 13:20 ` Simon Horman
2013-05-28 14:48 ` Vivek Goyal
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=20130526131718.GD11134@verge.net.au \
--to=horms@verge.net.au \
--cc=ebiederm@xmission.com \
--cc=kexec@lists.infradead.org \
--cc=trenn@suse.de \
--cc=vgoyal@redhat.com \
--cc=yinghai@kernel.org \
/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