If machine has high number of CPUs or interrupts or both, the /proc/stat
can easily grow over current buffer size 4kB. On my current machine (64
cores, ~300 interrupts) the /proc/stat has 12kB of data. And since the
`procs_running` line is after the interrupts it is never read.
Increasing the size to 64KB so it will accommodate even heavier machines.
pset_list_len = 0;
return -1;
}
- /* #endif HAVE_THREAD_INFO */
+ /* #endif HAVE_THREAD_INFO */
#elif KERNEL_LINUX
pagesize_g = sysconf(_SC_PAGESIZE);
}
}
#endif
- /* #endif KERNEL_LINUX */
+ /* #endif KERNEL_LINUX */
#elif HAVE_LIBKVM_GETPROCS && \
(HAVE_STRUCT_KINFO_PROC_FREEBSD || HAVE_STRUCT_KINFO_PROC_OPENBSD)
} /* int ps_read_process (...) */
static int procs_running(void) {
- char buffer[4096] = {};
+ char buffer[65536] = {};
char id[] = "procs_running "; /* white space terminated */
char *running;
char *endptr = NULL;