X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fprocesses.c;h=fac4778487f3fb0820925433c04267fbb5ee4e5b;hb=b333eb9557c96bdd2a336c33d623e428922a1046;hp=d094e73ec005830f6937a6b94eb4d65ce81c7c38;hpb=e20c6c14a4a72acad60705af1165519599175750;p=collectd.git diff --git a/src/processes.c b/src/processes.c index d094e73e..fac47784 100644 --- a/src/processes.c +++ b/src/processes.c @@ -287,7 +287,8 @@ static void ps_list_register (const char *name, const char *regexp) if (status != 0) { DEBUG ("ProcessMatch: compiling the regular expression \"%s\" failed.", regexp); - sfree(new->re); + sfree (new->re); + sfree (new); return; } } @@ -1436,6 +1437,12 @@ static int ps_read_process(long pid, procstat_t *ps, char *state) ps->io_syscr = myUsage->pr_sysc; ps->io_syscw = myUsage->pr_sysc; + /* + * TODO: context switch counters for Solaris + */ + ps->cswitch_vol = -1; + ps->cswitch_invol = -1; + /* * TODO: Find way of setting BLOCKED and PAGING status @@ -1673,6 +1680,10 @@ static int ps_read (void) pse.cpu_user_counter = task_absolutetime_info.total_user; pse.cpu_system_counter = task_absolutetime_info.total_system; + + /* context switch counters not implemented */ + pse.cswitch_vol = -1; + pse.cswitch_invol = -1; } status = task_threads (task_list[task], &thread_list, @@ -2026,6 +2037,10 @@ static int ps_read (void) pse.io_syscr = -1; pse.io_syscw = -1; + /* context switch counters not implemented */ + pse.cswitch_vol = -1; + pse.cswitch_invol = -1; + ps_list_add (procs[i].ki_comm, have_cmdline ? cmdline : NULL, &pse); switch (procs[i].ki_stat) @@ -2159,7 +2174,8 @@ static int ps_read (void) pse.io_syscr = -1; pse.io_syscw = -1; - pse.cswitch_vol = -1; + /* context switch counters not implemented */ + pse.cswitch_vol = -1; pse.cswitch_invol = -1; ps_list_add (procs[i].p_comm, have_cmdline ? cmdline : NULL, &pse); @@ -2308,6 +2324,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 (cmdline, cargs, &pse); } /* for (i = 0 .. nprocs) */