misc: adapt 3 programs to some enum changes, <meminfo>
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 <james.warner@comcast.net>
This commit is contained in:
parent
dbc880edd3
commit
105de6264c
4
free.c
4
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");
|
||||
|
@ -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 };
|
||||
|
4
vmstat.c
4
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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user