From owner-freebsd-bugs Wed Mar 10 4:13: 0 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.26.10.9]) by hub.freebsd.org (Postfix) with ESMTP id 9A7EB150DF for ; Wed, 10 Mar 1999 04:12:54 -0800 (PST) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id XAA20806; Wed, 10 Mar 1999 23:12:32 +1100 Date: Wed, 10 Mar 1999 23:12:32 +1100 From: Bruce Evans Message-Id: <199903101212.XAA20806@godzilla.zeta.org.au> To: amagai@nue.org, bde@zeta.org.au, freebsd-bugs@FreeBSD.ORG Subject: Re: kern/10402: times(3) non-decreaseness broken in 4.0 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >> Record the times returned by calcru() and adjust them on each call to > >Where do record the times? In proc structure (with new slots)? I think it belongs in the pstats struct. >=== >How this, > st = (u * st) / tot; > sp->tv_sec = st / 1000000; > sp->tv_usec = st % 1000000; > >will be > > if (ip == NULL) { > st = (u * (st + it)) / tot; > } else { > st = (u * st) / tot; > } > sp->tv_sec = st / 1000000; > sp->tv_usec = st % 1000000; > >System mode will be include interrput handling time. No, that's another family of problems (how to report interrupt time without confusing applications that don't know about it). Note that the interrupt time can be determined using p->p_runtime and the rusage info for existing processes (ps sort of does this), but there is insufficient info to determine it for child processes (ps just gets it wrong). I think getrusage() should add the interrupt time to the system time so that old applications show it, and there should be a new rusage syscall that gives the interrupt time. In any case, calcru() should keep the interrupt time separate and let its callers decide what to do with it. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message