From owner-freebsd-ports Wed Aug 8 3:43:46 2001 Delivered-To: freebsd-ports@freebsd.org Received: from hamilton.physik.uni-konstanz.de (hamilton1.physik.uni-konstanz.de [134.34.147.36]) by hub.freebsd.org (Postfix) with ESMTP id 77A4937B406 for ; Wed, 8 Aug 2001 03:43:43 -0700 (PDT) (envelope-from bernd@hamilton.physik.uni-konstanz.de) Received: from planck.physik.uni-konstanz.de (root@planck.physik.uni-konstanz.de [134.34.147.33]) by hamilton.physik.uni-konstanz.de (8.10.2/8.10.2/Theorie-Cluster Uni-Konstanz 8.10.1-1) with ESMTP id f78AhfI06819 for ; Wed, 8 Aug 2001 12:43:41 +0200 Received: (from bernd@localhost) by planck.physik.uni-konstanz.de (8.10.2/8.10.2/Theorie-Cluster Uni-Konstanz 8.10.1-1) id f78Ahfa03383 for freebsd-ports@FreeBSD.ORG; Wed, 8 Aug 2001 12:43:41 +0200 Date: Wed, 8 Aug 2001 12:43:41 +0200 From: Bernd Rinn To: freebsd-ports@FreeBSD.ORG Subject: CPU time inconsistencies Message-ID: <20010808124341.A3351@planck.physik.uni-konstanz.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.4i Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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'? Regards, Bernd P.S.: Please cc to Bernd.Rinn@uni-konstanz.de. -- Bernd Rinn Fakultät für Physik Universität Konstanz Tel. 07531/88-3812, e-mail: Bernd.Rinn@uni-konstanz.de PGP-Fingerprint: 1F AC 31 64 FF EF A9 67 6E 0D 4C 26 0B E7 ED 5C To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message