Subject: Re: system vs user time
To: None <>
From: Manuel Bouyer <>
List: tech-kern
Date: 11/15/2007 15:24:26
On Wed, Nov 14, 2007 at 10:02:13PM +0000, David Laight wrote:
> On Wed, Nov 14, 2007 at 10:45:30PM +0100, Manuel Bouyer wrote:
> > Hi,
> > one remaining problem in bouyer-xenamd64 is that the time spent by a process
> > in userland is accounted as system time (in top, only system and interrupt
> > are non-0, user and nice are always 0 no matter what we do).
> > Can someone points me to the function where the various CPU times are
> > accounted, and eventually how it makes a difference between system and user
> > time ?
> It is based on the clock interrupt counting whether the interrupted PC
> is user or system.  Then the total execution time (calculated from
> process switches) is split between user/system/interrupt based on the
> counts.  Look at calcru() in kern/kern_resource.c

Thanks ! This allowed me to diagnose an issue in the way the intrframe
address is computed. Looks like intrframe is only used for this ...

Manuel Bouyer, LIP6, Universite Paris VI. 
     NetBSD: 26 ans d'experience feront toujours la difference