From de88807c381a963df6ffe0345e850c4322b311cc Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Sun, 15 Aug 2010 22:37:16 +0300 Subject: [PATCH] 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 --- parse.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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; -- 2.45.0