]> git.itanic.dy.fi Git - scan-pagemap/commitdiff
parser: Store the per mapping statistics in the maps structure
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Sun, 4 Jul 2010 20:16:49 +0000 (23:16 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Sun, 4 Jul 2010 20:16:49 +0000 (23:16 +0300)
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
pagemap.h
parse.c

index bcd4fa59dd45d11dd5b445198c629685b494fb54..e229ed73ae505939b7c2d9d0357b2bc0696f4bc9 100644 (file)
--- a/pagemap.h
+++ b/pagemap.h
@@ -38,6 +38,9 @@ struct maps {
        unsigned long end;
        unsigned long size;
 
+       long int pages_present;
+       long int pages_swapped;
+
        /* Name of the mapping, such as library name or something else */
        char name[128];
        int pid; /* Process which address space the mapping belongs to */
diff --git a/parse.c b/parse.c
index ff3b22c15cecde508f149694f80670194167e086..44e16f89c1f3f36055e222f2b6e2aa6b418e9f7b 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -188,6 +188,12 @@ static int parse_pageframe(FILE *file, struct pageframe *pf_tree,
                                tmp->map = map;
                                list_add(&match->ml->list, &tmp->list);
                        }
+
+                       if (match->page_present) {
+                               map->pages_present++;
+                       } else if (match->page_swapped) {
+                               map->pages_swapped++;
+                       }
                }
        }