From owner-freebsd-hackers Thu Jan 28 00:43:13 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA08951 for freebsd-hackers-outgoing; Thu, 28 Jan 1999 00:43:13 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from zed.ludd.luth.se (zed.ludd.luth.se [130.240.16.33]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA08942 for ; Thu, 28 Jan 1999 00:43:10 -0800 (PST) (envelope-from pantzer@sister.ludd.luth.se) Received: from sister.ludd.luth.se (pantzer@sister.ludd.luth.se [130.240.16.77]) by zed.ludd.luth.se (8.8.5/8.8.5) with SMTP id JAA10784; Thu, 28 Jan 1999 09:43:02 +0100 Message-Id: <199901280843.JAA10784@zed.ludd.luth.se> X-Mailer: exmh version 2.0.2 2/24/98 To: "Kenneth D. Merry" cc: pantzer@ludd.luth.se (Mattias Pantzare), freebsd-hackers@FreeBSD.ORG Subject: Re: Device statistics In-reply-to: Your message of "Wed, 27 Jan 1999 17:05:54 MST." <199901280005.RAA54630@panzer.plutotech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 28 Jan 1999 09:43:01 +0100 From: Mattias Pantzare Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Mattias Pantzare wrote... > > I am trying to teach iostat to print the percent of time the disk is busy > > (transactions in progress), for that I use the information in struct devstat. > > > > The problem is that start_time is recorded using getmicrouptime. If I replace > > that with getmicrotime I can do my magic. > > > > Is there a function that I missed that can get the same time > > as getmicrouptim but in userspace? > > Try the kern.boottime sysctl variable. That's what w/uptime uses to figure > out how long the machine has been up. > > You can subtract the current time from the boot time to get the uptime. > > I used getmicrouptime(), since it increases monotonically, unlike the > regular system time. (e.g., you're running xntpd, and it steps the time > back some) That means that I can't use the current time to subtreact from boot time, as that won't give the same time... If getmicrouptime was recorded in devstat when the sample is taken that would work to (even better). > > > Current temperature 99-01-28 00:19:17 -40.7 degrees Celsius (-41.2F) > > Wow, is that temperature accurate? Yes. Some places have almost -50 C To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message