diff options
author | bde <bde@FreeBSD.org> | 1996-06-08 11:48:28 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1996-06-08 11:48:28 +0000 |
commit | a2c3393c3cac3bbd922db2d009416c996338352d (patch) | |
tree | 254e3ec69adebdff5d5a8c3e43831e251da8ecf3 /sys/kern | |
parent | 17a064408cd014ab923354a0792dbd882e789a2a (diff) | |
download | FreeBSD-src-a2c3393c3cac3bbd922db2d009416c996338352d.zip FreeBSD-src-a2c3393c3cac3bbd922db2d009416c996338352d.tar.gz |
Fixed accumulation of run time for processes that don't accumulate
any statclock ticks. Pretend that all the time up to the first
statclock tick is system time. . This makes a difference mainly for
benchmarks that test short-lived processes - the user and system
times for processes that each lived for about 1ms only added up to
about 10% of the real time even when there was very little interrupt
activity.
Break the printing of a quad_t variable correctly.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_resource.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 5757cdb..e0fffd2 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.18 1996/01/16 18:10:19 phk Exp $ + * $Id: kern_resource.c,v 1.19 1996/03/11 06:04:20 hsu Exp $ */ #include <sys/param.h> @@ -490,11 +490,8 @@ calcru(p, up, sp, ip) tot = st + ut + it; if (tot == 0) { - up->tv_sec = up->tv_usec = 0; - sp->tv_sec = sp->tv_usec = 0; - if (ip != NULL) - ip->tv_sec = ip->tv_usec = 0; - return; + st = 1; + tot = 1; } sec = p->p_rtime.tv_sec; @@ -511,7 +508,8 @@ calcru(p, up, sp, ip) } totusec = (quad_t)sec * 1000000 + usec; if (totusec < 0) { - printf("calcru: negative time: %d usec\n", totusec); + /* XXX no %qd in kernel. Truncate. */ + printf("calcru: negative time: %ld usec\n", (long)totusec); totusec = 0; } u = totusec; |