From 99d2ecbc7d212b98592079eb074caebe4343eb69 Mon Sep 17 00:00:00 2001 From: Garance A Drosehn Date: Sun, 20 Jun 2004 02:03:33 +0000 Subject: [PATCH] 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 --- sys/kern/kern_proc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 268076a40367..8b9eaa0730d3 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 */