diff options
| author | Bruce Evans <bde@FreeBSD.org> | 1998-07-27 19:16:21 +0000 |
|---|---|---|
| committer | Bruce Evans <bde@FreeBSD.org> | 1998-07-27 19:16:21 +0000 |
| commit | bc9e7c3b4227265a72363a3e2898afc0068ffd0d (patch) | |
| tree | 02b4d0ae4fb51e82cb4dbab46e84bbc7dd6dc463 | |
| parent | d6c37912c61f77db81788f51b68cc44c50d1dbf9 (diff) | |
Notes
| -rw-r--r-- | sys/kern/kern_resource.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index a19f489cc75b..1bad1d2f0471 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_resource.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_resource.c,v 1.36 1998/05/17 11:52:43 phk Exp $ + * $Id: kern_resource.c,v 1.37 1998/05/28 09:30:18 phk Exp $ */ #include "opt_compat.h" @@ -524,6 +524,16 @@ calcru(p, up, sp, ip) microuptime(&tv); totusec += (tv.tv_usec - p->p_switchtime.tv_usec) + (tv.tv_sec - p->p_switchtime.tv_sec) * (int64_t)1000000; + + /* + * Copy the time that was just read to `switchtime' in case + * we are being called from exit1(). Exits don't go through + * mi_switch(), so `switchtime' doesn't get set in the normal + * way. We set it here instead of more cleanly in exit1() + * to avoid losing track of the time between the calls to + * microuptime(). + */ + switchtime = tv; } if (totusec < 0) { /* XXX no %qd in kernel. Truncate. */ |
