From: Florian Forster Date: Thu, 11 Jun 2015 13:48:02 +0000 (+0100) Subject: processes plugin: Initialize the cswitch_{in,}vol fields. X-Git-Tag: collectd-5.5.1~121 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=1f0156c5219ccae789355ac68dd19e8cd455db05;p=collectd.git processes plugin: Initialize the cswitch_{in,}vol fields. --- diff --git a/src/processes.c b/src/processes.c index 0649eab2..fde96f89 100644 --- a/src/processes.c +++ b/src/processes.c @@ -1740,6 +1740,7 @@ static int ps_read (void) continue; } + memset (&pse, 0, sizeof (pse)); pse.id = pid; pse.age = 0; @@ -2014,6 +2015,7 @@ static int ps_read (void) } } /* if (process has argument list) */ + memset (&pse, 0, sizeof (pse)); pse.id = procs[i].p_pid; pse.age = 0; @@ -2043,6 +2045,9 @@ static int ps_read (void) pse.io_syscr = -1; pse.io_syscw = -1; + pse.cswitch_vol = -1; + pse.cswitch_invol = -1; + ps_list_add (procs[i].p_comm, have_cmdline ? cmdline : NULL, &pse); } /* if ((proc_ptr == NULL) || (proc_ptr->p_pid != procs[i].p_pid)) */ @@ -2258,6 +2263,7 @@ static int ps_read (void) continue; } + memset (&pse, 0, sizeof (pse)); pse.id = pid; pse.age = 0; @@ -2284,6 +2290,9 @@ static int ps_read (void) pse.io_syscr = ps.io_syscr; pse.io_syscw = ps.io_syscw; + pse.cswitch_vol = -1; + pse.cswitch_invol = -1; + switch (state) { case 'R': running++; break;