diff options
-rw-r--r-- | memps.c | 37 |
1 files changed, 30 insertions, 7 deletions
@@ -1288,10 +1288,23 @@ static int show_map_new(int pid) } if (!sum) { - printf(" S(CODE) S(DATA) P(CODE) P(DATA) PSS " - "ADDR(start-end) OBJECT NAME\n"); - printf("-------- -------- -------- -------- -------- " - "----------------- ------------------------------\n"); + if (sizeof(unsigned long) == 4) { + /* for 32-bit address */ + printf(" S(CODE) S(DATA) P(CODE) P(DATA) PSS " + "ADDR(start-end) " + "OBJECT NAME\n"); + printf("-------- -------- -------- -------- -------- " + "----------------- " + "------------------------------\n"); + } else { + /* for 64-bit address */ + printf(" S(CODE) S(DATA) P(CODE) P(DATA) PSS " + "ADDR(start-end) " + "OBJECT NAME\n"); + printf("-------- -------- -------- -------- -------- " + "--------------------------------- " + "------------------------------\n"); + } } else { printf(" S(CODE) S(DATA) P(CODE) P(DATA) PSS\n"); printf("-------- -------- -------- -------- --------\n"); @@ -1327,9 +1340,19 @@ static int show_map_new(int pid) duplication = 0; if (!sum) { - printf("%8d %8d %8d %8d %8d %08lx-%08lx %s\n", - shared_clean, shared_dirty, private_clean, - private_dirty, mi->pss, start, end, mi->name); + if (sizeof(unsigned long) == 4) { + /* for 32-bit address */ + printf("%8d %8d %8d %8d %8d %08lx-%08lx %s\n", + shared_clean, shared_dirty, + private_clean, private_dirty, mi->pss, + start, end, mi->name); + } else { + /* for 64-bit address */ + printf("%8d %8d %8d %8d %8d %016lx-%016lx %s\n", + shared_clean, shared_dirty, + private_clean, private_dirty, mi->pss, + start, end, mi->name); + } } shared_clean = 0; shared_dirty = 0; |