summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2020-09-09 15:36:42 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2020-09-09 16:11:42 +0900
commite12a9c82899b88dccade910f57bf249a28da515b (patch)
tree0384353d78db323995ca458a395a7fa49b2c91e1
parent8490cdba82e5df40e04a9d900cd514a2e70392f5 (diff)
downloadmemps-accepted/tizen_6.0_unified.tar.gz
memps-accepted/tizen_6.0_unified.tar.bz2
memps-accepted/tizen_6.0_unified.zip
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.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/memps.c b/memps.c
index 5a7bfa6..cf27d39 100644
--- a/memps.c
+++ b/memps.c
@@ -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;