]> git.itanic.dy.fi Git - scan-pagemap/commitdiff
print_page_stats: Reserve 7 digits for page count alignment
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Mon, 11 Jun 2012 19:19:55 +0000 (22:19 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Mon, 11 Jun 2012 19:19:55 +0000 (22:19 +0300)
If there are mappings that are larger than 4 gigabytes, 6 digits is
not enough for the output. 7 digits is enough until 40 gigabytes,
which should probably be enough in most of users. If someone has got
more than 40 gigabytes of ram and wants to have nicely aligned page
usage prints, I'm happy to implement some sort of dynamic
alignmenting for it..

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
analyze.c

index 04abf811fea05f13fe44e660f1751aac51673414..29752b1a9a46f9025e52094fdad90be4dc4430fa 100644 (file)
--- a/analyze.c
+++ b/analyze.c
@@ -196,17 +196,17 @@ void print_page_stats(struct rb_root *root)
                if (!af.kpageflag[i])
                        continue;
 
-               printf("%13s pages: %6ld, %5lld %sB\n",
+               printf("%13s pages: %7ld, %5lld %sB\n",
                        kpageflag_to_str(i),
                        af.kpageflag[i],
                        PAGE_TO_NICE(af.kpageflag[i]),
                        PAGE_TO_NICE_UNIT(af.kpageflag[i]));
        }
 
-       printf("      present pages: %6ld, %5lld %sB\n"
-               "      swapped pages: %6ld, %5lld %sB\n"
-               "       unique pages: %6ld, %5lld %sB\n"
-               "        total pages: %6ld, %5lld %sB\n",
+       printf("      present pages: %7ld, %5lld %sB\n"
+               "      swapped pages: %7ld, %5lld %sB\n"
+               "       unique pages: %7ld, %5lld %sB\n"
+               "        total pages: %7ld, %5lld %sB\n",
                af.pages_present,
                PAGE_TO_NICE(af.pages_present),
                PAGE_TO_NICE_UNIT(af.pages_present),