]> git.itanic.dy.fi Git - scan-pagemap/commitdiff
parser: When scannin by name, scan all pids twice
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Sun, 15 Aug 2010 19:37:16 +0000 (22:37 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Sun, 15 Aug 2010 19:37:16 +0000 (22:37 +0300)
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 <kaapeli@itanic.dy.fi>
parse.c

diff --git a/parse.c b/parse.c
index ad01072c91385ecf639a7e172cd2507c45b9fc22..a4b878a3b85e0006de7b4fefbcf8cd0ae2f277ca 100644 (file)
--- 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;