diff options
author | Seung-Woo Kim <sw0312.kim@samsung.com> | 2020-09-09 15:36:42 +0900 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2020-09-09 16:11:42 +0900 |
commit | e12a9c82899b88dccade910f57bf249a28da515b (patch) | |
tree | 0384353d78db323995ca458a395a7fa49b2c91e1 | |
parent | 8490cdba82e5df40e04a9d900cd514a2e70392f5 (diff) | |
download | memps-tizen_6.0.tar.gz memps-tizen_6.0.tar.bz2 memps-tizen_6.0.zip |
Consider 64-bit addresstizen_6.0.m2_releasesubmit/tizen_6.0_hotfix/20201103.114805submit/tizen_6.0_hotfix/20201102.192505submit/tizen_6.0/20201029.205104submit/tizen/20200909.072053accepted/tizen/unified/20200910.123935accepted/tizen/6.0/unified/hotfix/20201103.001833accepted/tizen/6.0/unified/20201030.115651tizen_6.0_hotfixtizen_6.0accepted/tizen_6.0_unified_hotfixaccepted/tizen_6.0_unified
The result for 'memps <pid>' shows address of maps only with
32-bit address. So on 64-bit, the printing style is messy.
Fix the result style considering 64-bit address.
Change-Id: I98372bf80882b900edf19a35bfc57231c8b75e10
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
-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; |