From owner-freebsd-questions@FreeBSD.ORG Tue Mar 23 09:36:29 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49B6416A4CE for ; Tue, 23 Mar 2004 09:36:29 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 057E243D1D for ; Tue, 23 Mar 2004 09:36:29 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id i2NHaSF0076249; Tue, 23 Mar 2004 11:36:28 -0600 (CST) (envelope-from dan) Date: Tue, 23 Mar 2004 11:36:28 -0600 From: Dan Nelson To: Chris Landauer Message-ID: <20040323173627.GC2492@dan.emsphone.com> References: <200403231730.i2NHU0r09531@calamari.aero.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200403231730.i2NHU0r09531@calamari.aero.org> X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: freebsd-questions@freebsd.org Subject: Re: wraparound value for (user) time X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2004 17:36:29 -0000 In the last episode (Mar 23), Chris Landauer said: > you werote: > > Which value wrapped? user, system, or elapsed? > > > The best I could come up with was that elapsed time might be stored > > in a long variable in milliseconds, which would wrap at 49.7 days. > > User and system times are stored as "struct timeval"s and should > > never wrap. > > thanx for answering so quickly - it is the user cpu time that wraps, > in much less than 49 days, apparently (elapsed time was 164 hrs and > 340 hrs in the two cases that wrapped, and the cpu percentage should > have been between 90 and 95) > > i did finally find struct timeval, which has a long - arithmetically, > i convinced myself that the value had to be not an unsigned one (so > the wrapped values were negative, but printed as positive), but i > need to look further at the resolution issue - i will study it > further and report the results as soon as i have something definitive > (or at least useful) to say Note that struct timeval has two members, tv_sec, and tv_usec. tv_sec will wrap in 2038, and tv_usec wraps every second :) It might be that there's a bug somewhere in tcsh's time calculations; see if /usr/bin/time does any better. Another thing to try is enabling process accounting ("accton /var/account/acct"), and then use "lastcomm -esu" to print the stats. -- Dan Nelson dnelson@allantgroup.com