diff --git a/zdump/dfi.c b/zdump/dfi.c index fe420b6c..f81fbe4c 100644 --- a/zdump/dfi.c +++ b/zdump/dfi.c @@ -152,9 +152,24 @@ static void mem_map_print(void) { struct dfi_mem_chunk *mem_chunk; u64 print_start = 0, print_end = 0; + const char *zero_str; u32 volnr = 0; STDERR("\nMemory map:\n"); + /* + * Print each memory chunk if verbose specified + */ + if (g.opts.verbose_specified) { + dfi_mem_chunk_iterate(mem_chunk) { + zero_str = ""; + if (mem_chunk->read_fn == dfi_mem_chunk_read_zero) + zero_str = " zeroes"; + STDERR(" %016llx - %016llx (%llu MB%s)\n", + mem_chunk->start, mem_chunk->end, + TO_MIB(mem_chunk->size), zero_str); + } + return; + } /* * Merge adjacent memory chunks from the same volume */ diff --git a/zdump/opts.c b/zdump/opts.c index f82f4c19..387c102c 100644 --- a/zdump/opts.c +++ b/zdump/opts.c @@ -3,7 +3,7 @@ * * Option parsing * - * Copyright IBM Corp. 2001, 2017 + * Copyright IBM Corp. 2001, 2018 * * s390-tools is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See LICENSE for details. @@ -46,9 +46,10 @@ static char help_text[] = "-s, --select Select system data SYS (\"kdump\", \"prod\", or \"all\")\n" "-d, --device Print DUMPDEV (dump device) information\n" "-v, --version Print version information, then exit\n" +"-V, --verbose Show detailed layout of memory map on printing DUMP information\n" "-h, --help Print this help, then exit\n"; -static const char copyright_str[] = "Copyright IBM Corp. 2001, 2017"; +static const char copyright_str[] = "Copyright IBM Corp. 2001, 2018"; /* * Select option strings @@ -251,9 +252,10 @@ void opts_parse(int argc, char *argv[]) {"fmt", required_argument, NULL, 'f'}, {"select", required_argument, NULL, 's'}, {"debug", no_argument, NULL, 'X'}, + {"verbose", no_argument, NULL, 'V'}, {NULL, 0, NULL, 0 } }; - static const char optstr[] = "hvidmus:f:X"; + static const char optstr[] = "hvVidmus:f:X"; init_defaults(); while ((opt = getopt_long(argc, argv, optstr, long_opts, &idx)) != -1) { @@ -262,6 +264,9 @@ void opts_parse(int argc, char *argv[]) print_help_exit(); case 'v': print_version_exit(); + case 'V': + g.opts.verbose_specified = 1; + break; case 'i': action_set(ZG_ACTION_DUMP_INFO); break; diff --git a/zdump/zgetdump.h b/zdump/zgetdump.h index a1fd9919..7e711f00 100644 --- a/zdump/zgetdump.h +++ b/zdump/zgetdump.h @@ -35,6 +35,7 @@ struct options { int argc_fuse; const char *select; int select_specified; + int verbose_specified; }; extern const char *OPTS_SELECT_KDUMP;