diff options
author | Sung-hun Kim <sfoon.kim@samsung.com> | 2023-12-21 16:56:16 +0900 |
---|---|---|
committer | Sung-hun Kim <sfoon.kim@samsung.com> | 2023-12-21 16:58:12 +0900 |
commit | 815c53d70f709776bbe1bea5809e0db451936a3e (patch) | |
tree | 96c38b174b900902b11cdde4d5542adcd5aa0e3d | |
parent | de66f0da2a333df764a55ca30d51a1ab81e73d7d (diff) | |
download | memps-tizen.tar.gz memps-tizen.tar.bz2 memps-tizen.zip |
Print swap in memps printing for a given pidtizen_9.0_m2_releaseaccepted/tizen/unified/riscv/20231227.042002accepted/tizen/unified/dev/20240620.005744accepted/tizen/unified/20231226.180038accepted/tizen/unified/20231226.154353accepted/tizen/9.0/unified/20241030.233249tizen_9.0tizenaccepted/tizen_unified_riscvaccepted/tizen_unified_devaccepted/tizen_unifiedaccepted/tizen_9.0_unified
Change-Id: I391fa55a186b80f02fe63484fdbb5c1fd1633fb5
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
-rw-r--r-- | memps.c | 27 |
1 files changed, 15 insertions, 12 deletions
@@ -1373,6 +1373,7 @@ static int show_map_new(int pid) unsigned private_dirty = 0; unsigned private_clean = 0; unsigned pss = 0; + unsigned swap = 0; unsigned long start = 0; unsigned long end = 0; unsigned private_clean_total = 0; @@ -1391,24 +1392,24 @@ static int show_map_new(int pid) if (!sum) { if (sizeof(unsigned long) == 4) { /* for 32-bit address */ - printf(" S(CODE) S(DATA) P(CODE) P(DATA) PSS " + printf(" S(CODE) S(DATA) P(CODE) P(DATA) PSS SWAP " "ADDR(start-end) " "OBJECT NAME\n"); - printf("-------- -------- -------- -------- -------- " + printf("-------- -------- -------- -------- -------- -------- " "----------------- " "------------------------------\n"); } else { /* for 64-bit address */ - printf(" S(CODE) S(DATA) P(CODE) P(DATA) PSS " + printf(" S(CODE) S(DATA) P(CODE) P(DATA) PSS SWAP " "ADDR(start-end) " "OBJECT NAME\n"); - printf("-------- -------- -------- -------- -------- " + printf("-------- -------- -------- -------- -------- -------- " "--------------------------------- " "------------------------------\n"); } } else { - printf(" S(CODE) S(DATA) P(CODE) P(DATA) PSS\n"); - printf("-------- -------- -------- -------- --------\n"); + printf(" S(CODE) S(DATA) P(CODE) P(DATA) PSS SWAP\n"); + printf("-------- -------- -------- -------- -------- --------\n"); } for (mi = milist; mi;) { shared_clean += mi->shared_clean; @@ -1416,6 +1417,7 @@ static int show_map_new(int pid) private_clean += mi->private_clean; private_dirty += mi->private_dirty; pss += mi->pss; + swap += mi->swap; shared_clean_total += mi->shared_clean; shared_dirty_total += mi->shared_dirty; @@ -1443,15 +1445,15 @@ static int show_map_new(int pid) if (!sum) { if (sizeof(unsigned long) == 4) { /* for 32-bit address */ - printf("%8d %8d %8d %8d %8d %08lx-%08lx %s\n", + printf("%8d %8d %8d %8d %8d %8d %08lx-%08lx %s\n", shared_clean, shared_dirty, - private_clean, private_dirty, mi->pss, + private_clean, private_dirty, mi->pss, mi->swap, start, end, mi->name); } else { /* for 64-bit address */ - printf("%8d %8d %8d %8d %8d %016lx-%016lx %s\n", + printf("%8d %8d %8d %8d %8d %8d %016lx-%016lx %s\n", shared_clean, shared_dirty, - private_clean, private_dirty, mi->pss, + private_clean, private_dirty, mi->pss, mi->swap, start, end, mi->name); } } @@ -1468,12 +1470,13 @@ static int show_map_new(int pid) temp = NULL; } if (sum) { - printf("%8d %8d %8d %8d %8d\n", + printf("%8d %8d %8d %8d %8d %8d\n", shared_clean_total, shared_dirty_total, private_clean_total, private_dirty_total, - pss); + pss, + swap); } return 1; |