From owner-freebsd-dtrace@FreeBSD.ORG Thu Aug 28 15:24:51 2014 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7085A3F for ; Thu, 28 Aug 2014 15:24:51 +0000 (UTC) Received: from mail-pa0-x230.google.com (mail-pa0-x230.google.com [IPv6:2607:f8b0:400e:c03::230]) (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 B4FC0156E for ; Thu, 28 Aug 2014 15:24:51 +0000 (UTC) Received: by mail-pa0-f48.google.com with SMTP id ey11so2972305pad.35 for ; Thu, 28 Aug 2014 08:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphix.com; s=google; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=xLldZ3tuKKldoKMOP78LlTuEMAn17BlHd+ywiFmUcUI=; b=Int7407XFI3RobP40mUBBbB7W9buxuL8LEylqIrLIqAmHi3C9H9ttSsqZraUmPJsWF ASvm+++4jENNYHANi6kEhJDZ1Bh0vL/tY1FiyFgpejlB+zgmYjL+VAAvcsHEOuvMuKLq qEmnJjzoq6TXtpXSY0W/zeGNtX+IkoMBTZWr0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=xLldZ3tuKKldoKMOP78LlTuEMAn17BlHd+ywiFmUcUI=; b=Kw3F9SbI2kRl8LcG+nDWP1hcUlG/NRKj8UNVsO2CCTKAaNxbma7UpPPXjahcjN5qFq KMSntBoBya5zYPWLLUYpQiLWOz1RY2ZkuC5tv0C9oLFpk00BbzfrRFnlVZ00A3h2tB+9 16A0EZCSm+SB+ENuANxMkMp7LA0Dx8T+crPMtTPEWMM50y/d7hVHxTCV40vBi9xb5H5z 8U6WYIUY3MjmDfYIQmrXv5YSC+r2frV+C8AKUiUedySM0i8TQXBtauO0UODf6SMf+8NL s29qBbPrknlh4Zc9yJf7SVU0BEw0UifNcv1IT1A3ftJvC9pga8cE2zWXYqNu7deQ2VRi qusA== X-Gm-Message-State: ALoCoQma0NaI2k6NqOxOQ8WVZ3ZawRld0C2lECC5nTMVw0ELWCE6Tvslpn/N162OPgvrOlXQZmYz X-Received: by 10.68.242.202 with SMTP id ws10mr7056315pbc.32.1409239489069; Thu, 28 Aug 2014 08:24:49 -0700 (PDT) Received: from [10.151.51.69] (mobile-166-171-249-235.mycingular.net. [166.171.249.235]) by mx.google.com with ESMTPSA id wi10sm3815364pbc.95.2014.08.28.08.24.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Aug 2014 08:24:48 -0700 (PDT) References: Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-Id: X-Mailer: iPhone Mail (10B143) From: Adam Leventhal Subject: Re: printing time Date: Thu, 28 Aug 2014 08:24:43 -0700 To: "Kendrick, Stuart" 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 15:24:52 -0000 Hi Stuart Is walltimestamp always 0? Could you use timestamp as an alternative (you co= uld 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" wr= ote: > How else might I print a timestamp, other than using =E2=80=98printf =E2=80= =A6 walltimestamp=E2=80=99? >=20 > I=E2=80=99m running dtrace on a platform (modified version of FreeBSD 7) w= here =E2=80=98printf %Y=E2=80=99 only ever returns the one timestamp: 1969 D= ec 31 18:00:00 >=20 > So I=E2=80=99m casting around for another approach: suggestions? >=20 > My script =E2=80=98watch-file.d=E2=80=99: >=20 >=20 > # pragma D option quiet >=20 >=20 > BEGIN >=20 > { >=20 > printf("\n Timestamp gid uid pid ppid execname function= \n\n"); >=20 > } >=20 >=20 > syscall::open*:entry, syscall::unlink:entry, syscall::rename:entry >=20 > /strstr(stringof(copyinstr(arg0)), $1) !=3D NULL/ >=20 > { >=20 > printf("%Y %5d %5d %5d %5d %-12s %-10s %s\n", >=20 > walltimestamp, gid, uid, pid, ppid, execname, probefunc, string= of(copyinstr(arg0))); >=20 > } >=20 > Typically run as follows: > ./watch-file.d =E2=80=98=E2=80=9C/etc/foo=E2=80=9D=E2=80=99 | tee /var/tmp= /foo.log > where /etc/foo is the file I want to watch =E2=80=94 i.e. something is upd= ating this file at awkward moments, and I want to identify what process does= this. >=20 >=20 >=20 > [...] >=20 > 1969 Dec 31 18:00:00 0 0 2739 1 isi_rpc_d open /etc/ifs/l= ocal.xml > 1969 Dec 31 18:00:00 0 0 2739 1 isi_rpc_d open /etc/ifs/l= ocal.xml > 1969 Dec 31 18:00:00 0 0 2739 1 isi_rpc_d open /etc/ifs/l= ocal.xml > 1969 Dec 31 18:00:00 0 0 3131 1 isi_celog_monitor open /e= tc/ifs/local.xml > 1969 Dec 31 18:00:00 0 0 3131 1 isi_celog_monitor open /e= tc/ifs/local.xml > 1969 Dec 31 18:00:00 0 0 3131 1 isi_celog_monitor open /e= tc/ifs/local.xml > 1969 Dec 31 18:00:00 0 0 3099 1 isi_celog_coalescer open /e= tc/ifs/local.xml > 1969 Dec 31 18:00:00 0 0 3099 1 isi_celog_coalescer open /e= tc/ifs/local.xml > 1969 Dec 31 18:00:00 0 0 3099 1 isi_celog_coalescer open /e= tc/ifs/local.xml > 1969 Dec 31 18:00:00 0 0 3099 1 isi_celog_coalescer open /e= tc/ifs/local.xml > ~ >=20 >=20 > =E2=80=94sk >=20 > 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"