From owner-freebsd-dtrace@FreeBSD.ORG Thu Aug 28 16:56:59 2014 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDA4F9ED for ; Thu, 28 Aug 2014 16:56:59 +0000 (UTC) Received: from mail-oa0-x22f.google.com (mail-oa0-x22f.google.com [IPv6:2607:f8b0:4003:c02::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89080114B for ; Thu, 28 Aug 2014 16:56:59 +0000 (UTC) Received: by mail-oa0-f47.google.com with SMTP id i7so830370oag.20 for ; Thu, 28 Aug 2014 09:56:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=6mPBJ75CVSXSb6xOcYRhBRDjulY820YIJPFKkuG+vC8=; b=woM8fruUjq5k94PF7ULVenKfDMILykaW3CPqN3fxkJNLWrJhghvyl80RxZPcaTtV+Z v/NgPjTbD2cqsE4xZpoGDMTCeFPzvCtM/5B8rkiq5HlQvtFtqBi+f/DaLD9XXuxcY8Ns I8Xz4+Oio4/cE/6J7GtfGswh6+GvRnnFcD/fz7mX8HKrYvmrvZGjLQVpf2Mp9kWXdpXk Ryb2tnzK16nnXnley7WYQMGN7ufx8KCUJmTYfXc4m2WGTpPfqNeNMSr2qvoj635WN5uy YlerVhKHnnUi2fx1rPOXDS+tNLpcf5DcujCfDmmyMylfJdhK81FZz4km9DtI3T+ankyN A1zA== MIME-Version: 1.0 X-Received: by 10.182.236.65 with SMTP id us1mr4990870obc.38.1409245018862; Thu, 28 Aug 2014 09:56:58 -0700 (PDT) Received: by 10.76.10.200 with HTTP; Thu, 28 Aug 2014 09:56:58 -0700 (PDT) In-Reply-To: References: Date: Thu, 28 Aug 2014 12:56:58 -0400 Message-ID: Subject: Re: printing time From: Ryan Stone To: "Kendrick, Stuart" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-dtrace@freebsd.org" X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Aug 2014 16:56:59 -0000 On Thu, Aug 28, 2014 at 10:52 AM, Kendrick, Stuart wrote: > How else might I print a timestamp, other than using =E2=80=98printf =E2= =80=A6 walltimestamp=E2=80=99? > > I=E2=80=99m running dtrace on a platform (modified version of FreeBSD 7) = where =E2=80=98printf %Y=E2=80=99 only ever returns the one timestamp: 196= 9 Dec 31 18:00:00 > > So I=E2=80=99m casting around for another approach: suggestions? Do you need wall clock time, or do you just need relative timestamps to other dtrace prints? timestamp works in all FreeBSD versions and you can print it as a simple int. The counter is given in nanoseconds (I believe that it's specifically the number of nanoseconds since boot, but don't quote me on that). Alternatively, the code to implement walltimestamp was quite simple, so you could investigate back-porting that: http://svn.freebsd.org/changeset/base/238537