[PATCH v5 05/10] x86, cleanup: use dbgprint_mem_range for memory range debugging
Linn Crosetto
linn at hp.com
Thu Apr 10 13:18:58 PDT 2014
Wang Chao,
On Thu, Apr 10, 2014 at 05:12:58PM +0800, WANG Chao wrote:
> Signed-off-by: WANG Chao <chaowang at redhat.com>
> ---
> kexec/arch/i386/crashdump-x86.c | 26 +++-----------------------
> 1 file changed, 3 insertions(+), 23 deletions(-)
>
> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> index 4072c10..2437c30 100644
> --- a/kexec/arch/i386/crashdump-x86.c
> +++ b/kexec/arch/i386/crashdump-x86.c
> @@ -517,15 +517,7 @@ static int add_memmap(struct memory_range *memmap_p, int *nr_memmap_p,
> memmap_p[tidx].type = type;
> *nr_memmap_p = nr_entries + 1;
>
> - dbgprintf("Memmap after adding segment\n");
> - for (i = 0; i < CRASH_MAX_MEMMAP_NR; i++) {
> - mstart = memmap_p[i].start;
> - mend = memmap_p[i].end;
> - if (mstart == 0 && mend == 0)
> - break;
> - dbgprintf("%016llx - %016llx\n",
> - mstart, mend);
> - }
> + dbgprint_mem_range("Memmap after adding segment", memmap_p, *nr_memmap_p);
>
> return 0;
> }
> @@ -605,16 +597,7 @@ static int delete_memmap(struct memory_range *memmap_p, int *nr_memmap_p,
> *nr_memmap_p = nr_entries - 1;
> }
>
> - dbgprintf("Memmap after deleting segment\n");
> - for (i = 0; i < CRASH_MAX_MEMMAP_NR; i++) {
> - mstart = memmap_p[i].start;
> - mend = memmap_p[i].end;
> - if (mstart == 0 && mend == 0) {
> - break;
> - }
> - dbgprintf("%016llx - %016llx\n",
> - mstart, mend);
> - }
> + dbgprint_mem_range("Memmap after deleting segment", memmap_p, *nr_memmap_p);
>
> return 0;
> }
> @@ -913,10 +896,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);
> + dbgprint_mem_range("CRASH MEMORY RANGES", mem_range, nr_ranges);
>
> /*
> * if the core type has not been set on command line, set it here
Is the definition for dbgprint_mem_range() missing? It was added in patch v4 1/4
but I do not see it in this set.
Linn
More information about the kexec
mailing list