From 15eefc2d997debe27ac73cc46709fcb146f9b919 Mon Sep 17 00:00:00 2001 From: Herve COMMOWICK Date: Wed, 14 Oct 2015 08:57:05 +0200 Subject: [PATCH] processes: correctly count processes on FreeBSD because actually we count threads instead of processes (partial backport of 85c31a6d66 for collectd-5.4 /mf) --- src/processes.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) 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); -- 2.11.0