Subject: Re: system vs user time
To: Manuel Bouyer <firstname.lastname@example.org>
From: David Laight <email@example.com>
Date: 11/14/2007 22:02:13
On Wed, Nov 14, 2007 at 10:45:30PM +0100, Manuel Bouyer wrote:
> 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
David Laight: firstname.lastname@example.org