Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Aug 2001 13:51:24 +0300
From:      Peter Pentchev <roam@ringlet.net>
To:        Bernd Rinn <Bernd.Rinn@uni-konstanz.de>
Cc:        freebsd-ports@FreeBSD.ORG
Subject:   Re: CPU time inconsistencies
Message-ID:  <20010808135124.I534@ringworld.oblivion.bg>
In-Reply-To: <20010808124341.A3351@planck.physik.uni-konstanz.de>; from Bernd.Rinn@uni-konstanz.de on Wed, Aug 08, 2001 at 12:43:41PM %2B0200
References:  <20010808124341.A3351@planck.physik.uni-konstanz.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Aug 08, 2001 at 12:43:41PM +0200, Bernd Rinn wrote:
> Hi,
> 
> I noticed an inconsistency in CPU time report on FreeBSD machines: The
> rusage values obtained from wait4 by the parrent differs from the
> value obtained from 'ps aux'. The program I used to test checks its
> own CPU time with clock() and tries to use 10000s. This is consistent
> with what the rusage struct of wait4() of the parent reports. But
> when I look at the 'time' field of 'ps aux' (I use a system call at
> the end of the test program to get a 'ps' snapshot), I get a higher value
> (10277s). In other cases I got a lower value when using 'ps'. Is there
> a way to determine more precisely the CPU time (including all
> terminated children) of a running process from outside that process
> than what is obtained from 'ps'?

This would be more appropriate for -questions, or at the very least,
-hackers, not -ports.  Still..

The ps(1) manual page documents in several places that the 'time'
shown is the sum of the user and system time for the process.
That is, the 'time' value includes the time spent in system calls.
The rusage structure has two separate parameters, ru_utime and ru_stime.

G'luck,
Peter

-- 
"yields falsehood, when appended to its quotation." yields falsehood, when appended to its quotation.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010808135124.I534>