Date: Thu, 28 Aug 2014 08:24:43 -0700 From: Adam Leventhal <ahl@delphix.com> To: "Kendrick, Stuart" <Stuart.Kendrick@emc.com> Cc: "freebsd-dtrace@freebsd.org" <freebsd-dtrace@freebsd.org> Subject: Re: printing time Message-ID: <CDD0540E-873F-4FB8-9EAC-3E4C4DC01DF9@delphix.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
Hi Stuart
Is walltimestamp always 0? Could you use timestamp as an alternative (you could do some math to convert it to wall time).
Adam
--
Adam Leventhal
CTO, Delphix
Sent from my mobile
On Aug 28, 2014, at 7:52 AM, "Kendrick, Stuart" <Stuart.Kendrick@emc.com> wrote:
> How else might I print a timestamp, other than using ‘printf … walltimestamp’?
>
> I’m running dtrace on a platform (modified version of FreeBSD 7) where ‘printf %Y’ only ever returns the one timestamp: 1969 Dec 31 18:00:00
>
> So I’m casting around for another approach: suggestions?
>
> My script ‘watch-file.d’:
>
>
> # pragma D option quiet
>
>
> BEGIN
>
> {
>
> printf("\n Timestamp gid uid pid ppid execname function\n\n");
>
> }
>
>
> syscall::open*:entry, syscall::unlink:entry, syscall::rename:entry
>
> /strstr(stringof(copyinstr(arg0)), $1) != NULL/
>
> {
>
> printf("%Y %5d %5d %5d %5d %-12s %-10s %s\n",
>
> walltimestamp, gid, uid, pid, ppid, execname, probefunc, stringof(copyinstr(arg0)));
>
> }
>
> Typically run as follows:
> ./watch-file.d ‘“/etc/foo”’ | tee /var/tmp/foo.log
> where /etc/foo is the file I want to watch — i.e. something is updating this file at awkward moments, and I want to identify what process does this.
>
>
>
> [...]
>
> 1969 Dec 31 18:00:00 0 0 2739 1 isi_rpc_d open /etc/ifs/local.xml
> 1969 Dec 31 18:00:00 0 0 2739 1 isi_rpc_d open /etc/ifs/local.xml
> 1969 Dec 31 18:00:00 0 0 2739 1 isi_rpc_d open /etc/ifs/local.xml
> 1969 Dec 31 18:00:00 0 0 3131 1 isi_celog_monitor open /etc/ifs/local.xml
> 1969 Dec 31 18:00:00 0 0 3131 1 isi_celog_monitor open /etc/ifs/local.xml
> 1969 Dec 31 18:00:00 0 0 3131 1 isi_celog_monitor open /etc/ifs/local.xml
> 1969 Dec 31 18:00:00 0 0 3099 1 isi_celog_coalescer open /etc/ifs/local.xml
> 1969 Dec 31 18:00:00 0 0 3099 1 isi_celog_coalescer open /etc/ifs/local.xml
> 1969 Dec 31 18:00:00 0 0 3099 1 isi_celog_coalescer open /etc/ifs/local.xml
> 1969 Dec 31 18:00:00 0 0 3099 1 isi_celog_coalescer open /etc/ifs/local.xml
> ~
>
>
> —sk
>
> Stuart Kendrick
> EMC Isilon
> _______________________________________________
> freebsd-dtrace@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace
> To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CDD0540E-873F-4FB8-9EAC-3E4C4DC01DF9>
