summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorgad <gad@FreeBSD.org>2004-06-20 02:03:33 +0000
committergad <gad@FreeBSD.org>2004-06-20 02:03:33 +0000
commitf83481b5479a3f23b0dc595890844383919274bf (patch)
tree86b819e5903b7adaf8a0741c0e091e705a5042b4 /sys
parentf777e901f95b9d46495fd1e532378e2e34cc001d (diff)
downloadFreeBSD-src-f83481b5479a3f23b0dc595890844383919274bf.zip
FreeBSD-src-f83481b5479a3f23b0dc595890844383919274bf.tar.gz
Add a call to calcru() to update the kproc_info fields of ki_rusage.ru_utime
and ki_rusage.ru_stime. This greatly improves the accuracy of those fields. Suggested by: bde
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_proc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 268076a..8b9eaa0 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -694,6 +694,8 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp)
kp->ki_start = p->p_stats->p_start;
timevaladd(&kp->ki_start, &boottime);
kp->ki_rusage = p->p_stats->p_ru;
+ calcru(p, &kp->ki_rusage.ru_utime, &kp->ki_rusage.ru_stime,
+ NULL);
kp->ki_childstime = p->p_stats->p_cru.ru_stime;
kp->ki_childutime = p->p_stats->p_cru.ru_utime;
/* Some callers want child-times in a single value */
OpenPOWER on IntegriCloud