From 133915d49405693b587c3e67fc56c186543ae210 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 16 Mar 2018 11:33:42 -0700 Subject: Fix vmstat for large machines. 48 cores is too much to fit in toybuf. --- toys/other/vmstat.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/toys/other/vmstat.c b/toys/other/vmstat.c index ae856cf6..a16afe65 100644 --- a/toys/other/vmstat.c +++ b/toys/other/vmstat.c @@ -48,7 +48,7 @@ static void get_vmstat_proc(struct vmstat_proc *vmstat_proc) "MemFree: ", "Buffers: ", "Cached: ", "SwapFree: ", "SwapTotal: ", "/proc/vmstat", "pgpgin ", "pgpgout ", "pswpin ", "pswpout " }; uint64_t *new = (uint64_t *)vmstat_proc; - char *p = p, *name = name; + char *p = p, *name = name, *file = NULL; int i, j; // We use vmstuff to fill out vmstat_proc as an array of uint64_t: @@ -56,21 +56,23 @@ static void get_vmstat_proc(struct vmstat_proc *vmstat_proc) // Any other string is a key to search for, with decimal value right after // 0 means parse another value on same line as last key - for (i = 0; i