]> git.itanic.dy.fi Git - scan-pagemap/commitdiff
Fix bug when showing process shared mappings
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Thu, 3 Nov 2011 12:54:41 +0000 (14:54 +0200)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Thu, 3 Nov 2011 12:54:41 +0000 (14:54 +0200)
The way page table tree is walked through nowadays requires that the
process map data is incremented every time the page table tree is
processed. Otherwise the last time the tree is processed, the counters
are overwritten with the last values, which is most likely zeros.

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

index cd8d5db4aa2ccbe90311f9a02c78835d513c8164..a119fab8a92b57bffb66a3bb6c57b34a28717949 100644 (file)
--- a/analyze.c
+++ b/analyze.c
@@ -324,8 +324,8 @@ static void _dump_process_maps(struct rb_root *root, struct process *ps,
                        af.map = map;
 
                        count_pages(root, &af);
-                       map->pages_present = af.pages_present;
-                       map->pages_swapped = af.pages_swapped;
+                       map->pages_present += af.pages_present;
+                       map->pages_swapped += af.pages_swapped;
                }
 
                biggest = MAX(biggest, map->pages_present + map->pages_swapped);