"-P, --process=PROCESS scan maps belonging to processes with "
"given name\n"
"-m, --map=mapname scan maps with given mapping name\n"
+ "-d, --dump dump process maps\n"
"-h, --help show this help\n",
name);
{ .val = 'P', .name = "process", .has_arg = 1, },
{ .val = 'm', .name = "map", .has_arg = 1, },
{ .val = OPT_WITH_THREADS, .name = "with-threads" },
+ { .val = 'd', .name = "dump", },
{ .val = 'h', .name = "help", },
};
- char short_options[] = "p:P:m:h";
+ char short_options[] = "p:P:m:dh";
opts->parse_mask = 0;
while (1) {
case OPT_WITH_THREADS:
opts->with_threads = 1;
break;
+ case 'd':
+ opts->parse_mask |= PARSE_DUMP;
+ break;
case 'h':
print_help_and_die(argv[0]);
+ break;
}
}
}
if (scan_all_pids(&pf, &process_list, &opts))
return 1;
- print_pid_stats(&pf, process_list, &opts);
- print_page_stats(&pf);
+ if (opts.parse_mask & PARSE_DUMP)
+ dump_process_maps(process_list);
+ else {
+ print_pid_stats(&pf, process_list, &opts);
+ print_page_stats(&pf);
+ }
return 0;
}