From owner-freebsd-current@FreeBSD.ORG Sat Aug 20 21:18:00 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AE401065676 for ; Sat, 20 Aug 2011 21:18:00 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.18.15]) by mx1.freebsd.org (Postfix) with ESMTP id B2B998FC19 for ; Sat, 20 Aug 2011 21:17:59 +0000 (UTC) Received: from [78.34.143.123] (helo=fabiankeil.de) by smtprelay03.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1QusjA-0000fw-Tm; Sat, 20 Aug 2011 23:05:13 +0200 Date: Sat, 20 Aug 2011 23:05:10 +0200 From: Fabian Keil To: Ashley Williams Message-ID: <20110820230510.4363cefc@fabiankeil.de> In-Reply-To: References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/o0UKjT5j7TMEzsK6qPiwbyq"; protocol="application/pgp-signature" X-Df-Sender: 775067 Cc: freebsd-current@freebsd.org Subject: Re: dtrace walltimestamp X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-current@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Aug 2011 21:18:00 -0000 --Sig_/o0UKjT5j7TMEzsK6qPiwbyq Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Ashley Williams wrote: > walltimestamp and timestamp don't appear to be right in BETA-1: >=20 >=20 > # dtrace -qn 'syscall::exec*:return { printf("%Y > %s\n",walltimestamp,curpsinfo->pr_psargs); }' > 1970 Jan 1 10:00:00 date > 1970 Jan 1 10:00:00 ping > 1970 Jan 1 10:00:00 ls I can reproduce this on amd64 with a recent HEAD, walltimestamp is always 0, which together with the dmesg warnings seems to indicate that it's not supported (yet). > # dtrace -qn 'syscall::exec*:return { printf("%Y > %s\n",timestamp,curpsinfo->pr_psargs); }' > 1970 Jan 6 12:02:27 ping > 1970 Jan 6 12:02:29 ls > 1970 Jan 6 12:02:31 dtrace Note that the timestamp value is relative to the time the system is booted (I think), and not to midnight, January 1, 1970. Assuming your system has been running for a few days and the offsets are right as well, the output seems fine. At least on my system, timestamp offsets can only can be relied on with either kern.timecounter.hardware=3DTSC or with C3 states disabled, though. Measuring the elapsed time (in ms) between events that happen in roughly 1 second intervals with kern.timecounter.hardware=3DHPET and dev.cpu.0.cx_lowest=3DC2: elapsed value ------------- Distribution ------------- count 990 | 0 1000 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 57 1010 | 0 1020 | 0 1030 |@ 1 1040 | 0 elapsed avg 1007 And doing the same with dev.cpu.0.cx_lowest=3DC3: elapsed value ------------- Distribution ------------- count 40 | 0 50 |@@@@@@@@@@@@@@@@@@@ 28 60 |@@@@@@@ 10 70 |@@@ 5 80 |@ 1 90 | 0 100 |@ 2 110 |@ 2 120 |@ 2 130 | 0 140 |@ 1 150 |@ 1 160 |@ 1 170 |@ 1 180 | 0 190 | 0 200 | 0 210 | 0 220 |@ 1 230 |@ 1 240 | 0 250 | 0 260 | 0 270 | 0 280 | 0 290 |@ 1 300 |@ 1 310 | 0 320 |@ 1 330 | 0 elapsed avg 90 Fabian --Sig_/o0UKjT5j7TMEzsK6qPiwbyq Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk5QIYkACgkQBYqIVf93VJ2b8QCeO/ikuQkdsMuE+6Aoh6Jc1mGM OzUAnj/TLtJWGm+0ZKHnwB36bgBnm/Gw =hjhr -----END PGP SIGNATURE----- --Sig_/o0UKjT5j7TMEzsK6qPiwbyq--