summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 19a16a1)
raw | patch | inline | side by side (parent: 19a16a1)
author | Florian Forster <octo@collectd.org> | |
Sat, 17 Mar 2012 10:41:04 +0000 (11:41 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Sat, 17 Mar 2012 10:41:04 +0000 (11:41 +0100) |
src/processes.c | patch | blob | history |
diff --git a/src/processes.c b/src/processes.c
index 3822d42c950dcc45da334c5793421da0207292d3..518419f4c79d1955d05ed5c906c18c86604f593a 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
kvm_t *kd;
char errbuf[1024];
struct kinfo_proc *procs; /* array of processes */
+ struct kinfo_proc *proc_ptr = NULL;
int count; /* returns number of processes */
int i;
- struct kinfo_proc *proc_ptr = NULL;
-
procstat_t *ps_ptr;
procstat_entry_t pse;
errbuf);
return (0);
}
+
/* Get the list of processes. */
procs = kvm_getprocs(kd, KERN_PROC_ALL, 0, &count);
if (procs == NULL)
case SLOCK: blocked++; break;
case SZOMB: zombies++; break;
}
-
}
kvm_close(kd);
+
ps_submit_state ("running", running);
ps_submit_state ("sleeping", sleeping);
ps_submit_state ("zombies", zombies);
ps_submit_state ("blocked", blocked);
ps_submit_state ("idle", idle);
ps_submit_state ("wait", wait);
+
for (ps_ptr = list_head_g; ps_ptr != NULL; ps_ptr = ps_ptr->next)
ps_submit_proc_list (ps_ptr);
/* #endif HAVE_LIBKVM_GETPROCS && HAVE_STRUCT_KINFO_PROC_FREEBSD */