]> git.itanic.dy.fi Git - scan-pagemap/commitdiff
parser: Ignore unused pages
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Wed, 14 Jul 2010 07:28:35 +0000 (10:28 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Wed, 14 Jul 2010 07:28:35 +0000 (10:28 +0300)
Ignore any pages that have no physical pages (either in swap or ram)
mapped at all.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
parse.c

diff --git a/parse.c b/parse.c
index c09df57ea0d807cb7d2b0523c2ea51ef8fc64efe..b2739ef55deef5b2f1acae1f29f5ee65100af8b2 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -160,6 +160,11 @@ static int parse_pageframe(FILE *file, struct pageframe *pf_tree,
                        if (!pageframe)
                                pageframe = alloc_pageframe();
                        ret -= sizeof(pf[0]);
+
+                       /* ignore unused pages */
+                       if (!pf[ret / sizeof(pf[0])])
+                               continue;
+
                        pageframe_to_struct(pf[ret / sizeof(pf[0])], pageframe);
 
                        if (add_to_tree) {