From owner-cvs-src@FreeBSD.ORG Sat Oct 22 09:28:02 2005 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E639316A420; Sat, 22 Oct 2005 09:28:02 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E6CBE43D55; Sat, 22 Oct 2005 09:28:01 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j9M9S0AC019933; Sat, 22 Oct 2005 19:28:00 +1000 Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j9M9Rvhe009380; Sat, 22 Oct 2005 19:27:58 +1000 Date: Sat, 22 Oct 2005 19:27:57 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Andre Oppermann In-Reply-To: <435913FE.774C683D@freebsd.org> Message-ID: <20051022185422.Q8268@delplex.bde.org> References: <30805.1129910750@critter.freebsd.dk> <435913FE.774C683D@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@freebsd.org, Poul-Henning Kamp , src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: Timekeeping [Was: Re: cvs commit: src/usr.bin/vmstat vmstat.c src/usr.bin/w w.c] X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2005 09:28:03 -0000 On Fri, 21 Oct 2005, Andre Oppermann wrote: > Poul-Henning Kamp wrote: >> Again, if you have been sitting in DDB, what exactly is the definition >> of "uptime" ? > > IMO it's this: > > Uptime is the time the operating was available to present it's common > services to userland. That excludes any suspend and ddb times. Single > user mode however counts because the OS was servicing userland even if > there was only one user. Uptime is represented in SI seconds. I agree for suspend and ddb, but not for single user mode. The system can be shut down to single user mode and restarted without rebooting. Restarting runs /etc/rc etc. The system can hardly be considered to be up until /etc/rc has completed, but we've never bother breaking boottime of providing a beginning-of-uptime variable to give the actual start of uptime. SIngle user mode is even more clearly down for remote services, but ruptime doesn't understand this. I don't really understand the protocol, but ruptime seems to just talk to rwhod; rwhod never understood the difference between local and remote uptime and just uses the kernel boottime like w used to. > Time since boottime is the UTC delta from the time of when the OS > initialized itself to now. Leap seconds cause deviations from uptime. > Time since boottime is represented as numerical delta in seconds from > two UTC timestamps. What's a UTC delta? Deltas don't (shouldn't) depend on the calendar. Leap seconds shouldn't cause deviations. They don't now, since boottime is broken (set backwards) to compensate for them. What are numerical deltas and UTC timestamps? In C99, there are only time_t's in some scale and difftime() to not-necessarily-numerically subtract them. In POSIX, using difftime() is essential sonce the broken scale breaks mainly numerical differences. > Uptime != Time since boottime. Only because the correct base point is not the boot time. We still use boottime for the base, so CLOCK_MONOTONIC only gives a different value due to bugs. Bruce