From 4e1af4733669d840d1591d870b3fdbe1c717e800 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Mon, 11 Jun 2012 22:19:55 +0300 Subject: [PATCH] print_page_stats: Reserve 7 digits for page count alignment 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 --- analyze.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/analyze.c b/analyze.c index 04abf81..29752b1 100644 --- 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), -- 2.45.0