Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Aug 2014 12:56:58 -0400
From:      Ryan Stone <rysto32@gmail.com>
To:        "Kendrick, Stuart" <Stuart.Kendrick@emc.com>
Cc:        "freebsd-dtrace@freebsd.org" <freebsd-dtrace@freebsd.org>
Subject:   Re: printing time
Message-ID:  <CAFMmRNzy_gSi8duNVoh4rRGVV=c=UHPdxXWhXyHaLURZPp-AMg@mail.gmail.com>
In-Reply-To: <D0249056.15458%stuart.kendrick@emc.com>
References:  <D0249056.15458%stuart.kendrick@emc.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 28, 2014 at 10:52 AM, Kendrick, Stuart
<Stuart.Kendrick@emc.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFMmRNzy_gSi8duNVoh4rRGVV=c=UHPdxXWhXyHaLURZPp-AMg>