From owner-freebsd-current@FreeBSD.ORG Sat Nov 29 15:07:17 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CC09D16A4CE; Sat, 29 Nov 2003 15:07:17 -0800 (PST) Received: from obsecurity.dyndns.org (adsl-63-207-60-234.dsl.lsan03.pacbell.net [63.207.60.234]) by mx1.FreeBSD.org (Postfix) with ESMTP id 98B2143FBD; Sat, 29 Nov 2003 15:07:14 -0800 (PST) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 4FD4766C8E; Sat, 29 Nov 2003 15:07:14 -0800 (PST) Date: Sat, 29 Nov 2003 15:07:14 -0800 From: Kris Kennaway To: stable@FreeBSD.org Message-ID: <20031129230714.GB10325@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ADZbWkCsHQ7r3kzd" Content-Disposition: inline User-Agent: Mutt/1.4.1i cc: current@FreeBSD.org cc: phk@freeBSD.org Subject: Corrected gettimeofday() test code X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Nov 2003 23:07:17 -0000 --ADZbWkCsHQ7r3kzd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I forwarded the reports of timecounter problems to phk, and he asked that people who are seeing timecounter problems provide FULL details of their system configuration, including: * dmesg * kernel configuration * compiler options * time-related system configuration (whether ntpd/timed/ntpdate is running, and if so whether it's correcting for a seriously drifting clock) * The kernel timecounter configuration, e.g. the kern.timecounter.method and kern.timecounter.hardware sysctls, and whether changing them has any effect. * The exact output of the corrected test program below (the original would give spurious errors if it didn't run at least once a second, which may have been confusing some people if their systems were sufficiently loaded). * The system status when the problem is observed (i.e. does it only occur under load; what else is running at the time) It's hard to track down this kind of problem when people don't provide this level of detail, and half-reports just confuse the issue. Thanks, Kris ----- Forwarded message from Poul-Henning Kamp ----- X-Original-To: kkenn@localhost Delivered-To: kkenn@localhost.obsecurity.org Delivered-To: kris@freebsd.org Date: Sat, 29 Nov 2003 23:48:12 +0100 From: Poul-Henning Kamp Subject: Re: gettimeofday() test code In-reply-to: "Your message of Sat, 29 Nov 2003 14:21:24 PST." <20031129222124.GA10022@xor.obsecurity.org> To: Kris Kennaway X-UIDL: 1f9b02cde6c0ab3cc62d0309b681fcc3 X-Bogosity: No, tests=3Dbogofilter, spamicity=3D0.000000, version=3D0.15.7 Have them run this one instead... #include #include int main() { struct timeval prevtime; struct timeval curtime; double last, now; gettimeofday(&prevtime, NULL); last =3D prevtime.tv_sec + prevtime.tv_usec * 1e-6; for (;;) { gettimeofday(&curtime, NULL); now =3D curtime.tv_sec + curtime.tv_usec * 1e-6; if (now < last) { printf("%f %f %d.%06d %d.%06d\n", now, last, curtime.tv_sec, curtime.tv_usec, prevtime.tv_sec, prevtime.tv_usec); } last =3D now; prevtime =3D curtime; } return 0; } --=20 Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe =20 Never attribute to malice what can adequately be explained by incompetence. ----- End forwarded message ----- --ADZbWkCsHQ7r3kzd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/ySahWry0BWjoQKURAh0VAKDuNU+vS918cROls2Ncs45aaRZFyQCdGZHv 160xoA/l1FFriEgWgeIT8ho= =/QSO -----END PGP SIGNATURE----- --ADZbWkCsHQ7r3kzd--