summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2016-01-14 02:23:06 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2016-01-14 02:23:06 +0100
commite3e575b10c5bd270b1436d7711bc16c73b073e67 (patch)
tree4e6134a82654b8502d2a6700c34add027d1accf1
parent5aee97f8bce668658d279bded391999c851cbda3 (diff)
downloadpsutil-e3e575b10c5bd270b1436d7711bc16c73b073e67.tar.gz
#779 / proc cpu times: openbsd and netbsd impl
-rw-r--r--psutil/_psutil_bsd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/psutil/_psutil_bsd.c b/psutil/_psutil_bsd.c
index cbdf36b1..31511abb 100644
--- a/psutil/_psutil_bsd.c
+++ b/psutil/_psutil_bsd.c
@@ -383,6 +383,10 @@ psutil_proc_cpu_times(PyObject *self, PyObject *args) {
#elif defined(__OpenBSD__) || defined(__NetBSD__)
user_t = PSUTIL_KPT2DOUBLE(kp.p_uutime);
sys_t = PSUTIL_KPT2DOUBLE(kp.p_ustime);
+ // OpenBSD and NetBSD provide children user + system times summed
+ // together (no distinction).
+ children_user_t = kp.p_uctime_sec + kp.p_uctime_usec / 1000000.0;
+ children_sys_t = children_user_t;
#endif
return Py_BuildValue("(dddd)",
user_t, sys_t, children_user_t, children_sys_t);