From: Timo Kokkonen Date: Sun, 15 Aug 2010 19:37:16 +0000 (+0300) Subject: parser: When scannin by name, scan all pids twice X-Git-Url: http://git.itanic.dy.fi/?p=scan-pagemap;a=commitdiff_plain;h=de88807c381a963df6ffe0345e850c4322b311cc parser: When scannin by name, scan all pids twice When scanning by a mapping name, we must first scan through all processes to find out which processes are using the mappings. Then we need to scan all pids again to find out if there are somewhere physical pages that are being shared by the given mapping with a different name. Signed-off-by: Timo Kokkonen --- diff --git a/parse.c b/parse.c index ad01072..a4b878a 100644 --- a/parse.c +++ b/parse.c @@ -507,6 +507,15 @@ int scan_all_pids(struct pageframe *pf, struct process *process_list, if (opts->parse_mask & PARSE_DUMP) return 0; + if (opts->parse_mask & PARSE_MAP_NAME) { + while (1) { + pid = get_next_pid(&dir); + if (pid <= 0) + break; + read_pageframe_with_threads(pid, pf, process_list, + opts); + } + } /* Do not add new pages in the tree after the initial scan */ opts->parse_mask |= PARSE_NOADD_TREE;