From 105de6264c28ade4c5ce73006736cfa25cf479b8 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Mon, 29 May 2017 02:22:22 -0500 Subject: [PATCH] misc: adapt 3 programs to some enum changes, That preceding commit corrected a little mismanagement regarding the MEMINFO_MEM_CACHED enumerator, which was used in the following programs: free, top plus vmstat. This patch simply adapts those programs to use the new MEMINFO_MEM_CACHED_ALL enumerator, which reflects both the 'Cached' plus 'SReclaimable' values they expected. Signed-off-by: Jim Warner --- free.c | 4 ++-- top/top.c | 6 +++--- vmstat.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/free.c b/free.c index 350bc862..6072c629 100644 --- a/free.c +++ b/free.c @@ -371,11 +371,11 @@ int main(int argc, char **argv) if (flags & FREE_WIDE) { printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_BUFFERS, ul_int), flags, args)); - printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_CACHED, ul_int) + printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_CACHED_ALL, ul_int) , flags, args)); } else { printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_BUFFERS, ul_int) + - MEMINFO_GET(mem_info, MEMINFO_MEM_CACHED, ul_int), flags, args)); + MEMINFO_GET(mem_info, MEMINFO_MEM_CACHED_ALL, ul_int), flags, args)); } printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_AVAILABLE, ul_int), flags, args)); printf("\n"); diff --git a/top/top.c b/top/top.c index 84b3c0c5..2aded0b5 100644 --- a/top/top.c +++ b/top/top.c @@ -201,9 +201,9 @@ static const char Graph_bars[] = "|||||||||||||||||||||||||||||||||||||||||||||| static struct meminfo_info *Mem_ctx; static struct meminfo_stack *Mem_stack; static enum meminfo_item Mem_items[] = { - MEMINFO_MEM_FREE, MEMINFO_MEM_USED, MEMINFO_MEM_TOTAL, - MEMINFO_MEM_CACHED, MEMINFO_MEM_BUFFERS, MEMINFO_MEM_AVAILABLE, - MEMINFO_SWAP_TOTAL, MEMINFO_SWAP_FREE, MEMINFO_SWAP_USED }; + MEMINFO_MEM_FREE, MEMINFO_MEM_USED, MEMINFO_MEM_TOTAL, + MEMINFO_MEM_CACHED_ALL, MEMINFO_MEM_BUFFERS, MEMINFO_MEM_AVAILABLE, + MEMINFO_SWAP_TOTAL, MEMINFO_SWAP_FREE, MEMINFO_SWAP_USED }; enum Rel_memitems { mem_FRE, mem_USE, mem_TOT, mem_QUE, mem_BUF, mem_AVL, swp_TOT, swp_FRE, swp_USE }; diff --git a/vmstat.c b/vmstat.c index 4713297f..98a51531 100644 --- a/vmstat.c +++ b/vmstat.c @@ -124,7 +124,7 @@ static enum meminfo_item Mem_items[] = { MEMINFO_MEM_ACTIVE, MEMINFO_MEM_INACTIVE, MEMINFO_MEM_BUFFERS, - MEMINFO_MEM_CACHED + MEMINFO_MEM_CACHED_ALL }; enum Rel_memitems { mem_SUS, mem_FREE, mem_ACT, mem_INA, mem_BUF, mem_CAC, MAX_mem @@ -191,7 +191,7 @@ static enum meminfo_item Sum_mem_items[] = { MEMINFO_MEM_INACTIVE, MEMINFO_MEM_FREE, MEMINFO_MEM_BUFFERS, - MEMINFO_MEM_CACHED, + MEMINFO_MEM_CACHED_ALL, MEMINFO_SWAP_TOTAL, MEMINFO_SWAP_USED, MEMINFO_SWAP_FREE,