From: Herve COMMOWICK Date: Wed, 14 Oct 2015 06:57:05 +0000 (+0200) Subject: processes: correctly count processes on FreeBSD X-Git-Tag: collectd-5.5.1~52^2~4 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=15eefc2d997debe27ac73cc46709fcb146f9b919;p=collectd.git processes: correctly count processes on FreeBSD because actually we count threads instead of processes (partial backport of 85c31a6d66 for collectd-5.4 /mf) --- diff --git a/src/processes.c b/src/processes.c index e8839df4..516104f0 100644 --- a/src/processes.c +++ b/src/processes.c @@ -1908,18 +1908,18 @@ static int ps_read (void) pse.io_syscw = -1; ps_list_add (procs[i].ki_comm, have_cmdline ? cmdline : NULL, &pse); - } /* if ((proc_ptr == NULL) || (proc_ptr->ki_pid != procs[i].ki_pid)) */ - switch (procs[i].ki_stat) - { - case SSTOP: stopped++; break; - case SSLEEP: sleeping++; break; - case SRUN: running++; break; - case SIDL: idle++; break; - case SWAIT: wait++; break; - case SLOCK: blocked++; break; - case SZOMB: zombies++; break; - } + switch (procs[i].ki_stat) + { + case SSTOP: stopped++; break; + case SSLEEP: sleeping++; break; + case SRUN: running++; break; + case SIDL: idle++; break; + case SWAIT: wait++; break; + case SLOCK: blocked++; break; + case SZOMB: zombies++; break; + } + } /* if ((proc_ptr == NULL) || (proc_ptr->ki_pid != procs[i].ki_pid)) */ } kvm_close(kd);