From owner-freebsd-bugs@FreeBSD.ORG Sun Jun 24 13:40:10 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA41710657C2 for ; Sun, 24 Jun 2012 13:40:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BBE428FC08 for ; Sun, 24 Jun 2012 13:40:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q5ODe9Bo063590 for ; Sun, 24 Jun 2012 13:40:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q5ODe9qr063589; Sun, 24 Jun 2012 13:40:09 GMT (envelope-from gnats) Date: Sun, 24 Jun 2012 13:40:09 GMT Message-Id: <201206241340.q5ODe9qr063589@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Fabian Keil Cc: Subject: Re: kern/159612: [dtrace] walltimestamp and timestamp functions incomplete X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Fabian Keil List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jun 2012 13:40:10 -0000 The following reply was made to PR kern/159612; it has been noted by GNATS. From: Fabian Keil To: bug-followup@FreeBSD.org Cc: ashley.wil@gmail.com, Andriy Gapon Subject: Re: kern/159612: [dtrace] walltimestamp and timestamp functions incomplete Date: Sun, 24 Jun 2012 15:34:21 +0200 --Sig_/XTu3iD5adcBI3uKvVE.eD/i Content-Type: multipart/mixed; boundary="MP_/IIPfuo+xn64ZrhajrzOaxRo" --MP_/IIPfuo+xn64ZrhajrzOaxRo Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline The attached patch adds support for walltimestamp on amd64 and i386 by copying the code from mips. I only tested it on amd64. The problem perceived with timestamp was the result of a misunderstanding as confirmed in: http://lists.freebsd.org/pipermail/freebsd-current/2011-August/026733.html Fabian --MP_/IIPfuo+xn64ZrhajrzOaxRo Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-dtrace-Add-support-for-walltimestamp-on-amd64-and-i3.patch =46rom ac8877b5b0417d6177e59df7e63744a3c69497cc Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sun, 24 Jun 2012 15:19:46 +0200 Subject: [PATCH] dtrace: Add support for walltimestamp on amd64 and i386 Code copied from mips. --- sys/cddl/dev/dtrace/amd64/dtrace_subr.c | 7 +++++-- sys/cddl/dev/dtrace/i386/dtrace_subr.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c b/sys/cddl/dev/dtrace/= amd64/dtrace_subr.c index 9960fa9..2d42ce2 100644 --- a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c @@ -461,8 +461,11 @@ dtrace_gethrtime() uint64_t dtrace_gethrestime(void) { - printf("%s(%d): XXX\n",__func__,__LINE__); - return (0); + struct timespec curtime; + + getnanotime(&curtime); + + return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec); } =20 /* Function to handle DTrace traps during probes. See amd64/amd64/trap.c */ diff --git a/sys/cddl/dev/dtrace/i386/dtrace_subr.c b/sys/cddl/dev/dtrace/i= 386/dtrace_subr.c index cef6914..3a1677a 100644 --- a/sys/cddl/dev/dtrace/i386/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/i386/dtrace_subr.c @@ -462,8 +462,11 @@ dtrace_gethrtime() uint64_t dtrace_gethrestime(void) { - printf("%s(%d): XXX\n",__func__,__LINE__); - return (0); + struct timespec curtime; + + getnanotime(&curtime); + + return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec); } =20 /* Function to handle DTrace traps during probes. See i386/i386/trap.c */ --=20 1.7.10.3 --MP_/IIPfuo+xn64ZrhajrzOaxRo-- --Sig_/XTu3iD5adcBI3uKvVE.eD/i Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/nF2UACgkQSMVSH78upWOi4gCfR0/f1VxhprZAQAh48SJKAKda unUAn1RTccEMuHwYAshlKlFRy7OwiM50 =e5Ai -----END PGP SIGNATURE----- --Sig_/XTu3iD5adcBI3uKvVE.eD/i--