From owner-freebsd-fs@freebsd.org Tue Aug 18 17:25:49 2015 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A09DE9BC892 for ; Tue, 18 Aug 2015 17:25:49 +0000 (UTC) (envelope-from mwlucas@mail.michaelwlucas.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 867841931 for ; Tue, 18 Aug 2015 17:25:49 +0000 (UTC) (envelope-from mwlucas@mail.michaelwlucas.com) Received: by mailman.ysv.freebsd.org (Postfix) id 8350B9BC890; Tue, 18 Aug 2015 17:25:49 +0000 (UTC) Delivered-To: fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82E229BC88F for ; Tue, 18 Aug 2015 17:25:49 +0000 (UTC) (envelope-from mwlucas@mail.michaelwlucas.com) Received: from mail.michaelwlucas.com (mail.michaelwlucas.com [104.236.197.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D1861930 for ; Tue, 18 Aug 2015 17:25:48 +0000 (UTC) (envelope-from mwlucas@mail.michaelwlucas.com) Received: from mail.michaelwlucas.com (localhost [127.0.0.1]) by mail.michaelwlucas.com (8.14.9/8.14.7) with ESMTP id t7IHOV7d098039 for ; Tue, 18 Aug 2015 13:24:32 -0400 (EDT) (envelope-from mwlucas@mail.michaelwlucas.com) Received: (from mwlucas@localhost) by mail.michaelwlucas.com (8.14.9/8.14.7/Submit) id t7IHOVfX098038 for fs@freebsd.org; Tue, 18 Aug 2015 13:24:31 -0400 (EDT) (envelope-from mwlucas) Date: Tue, 18 Aug 2015 13:24:31 -0400 From: "Michael W. Lucas" To: fs@freebsd.org Subject: dtrace script for io latency/throughput Message-ID: <20150818172431.GA97967@mail.michaelwlucas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail.michaelwlucas.com X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mail.michaelwlucas.com [127.0.0.1]); Tue, 18 Aug 2015 13:24:32 -0400 (EDT) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2015 17:25:49 -0000 Hi, I'm working on the performance part of allanjude@'s & mine next ZFS book. There's an incredibly useful latency/throughput script at http://dtrace.org/blogs/ahl/2014/08/31/openzfs-tuning/, but it doesn't work on FreeBSD. I try to run this script on FreeBSD and get: # dtrace -s rw.d -c 'sleep 60' dtrace: failed to compile script rw.d: line 10: b_edev is not a member of struct bio Which seems pretty clear: FreeBSD is not Solarisy. Is there a similar (or simpler) way to map latency vs throughput on FreeBSD? Thanks, ==ml PS: The script is: #pragma D option quiet BEGIN { start = timestamp; } io:::start { ts[args[0]->b_edev, args[0]->b_lblkno] = timestamp; } io:::done /ts[args[0]->b_edev, args[0]->b_lblkno]/ { this->delta = (timestamp - ts[args[0]->b_edev, args[0]->b_lblkno]) / 1000; this->name = (args[0]->b_flags & (B_READ | B_WRITE)) == B_READ ? "read " : "write "; @q[this->name] = quantize(this->delta); @a[this->name] = avg(this->delta); @v[this->name] = stddev(this->delta); @i[this->name] = count(); @b[this->name] = sum(args[0]->b_bcount); ts[args[0]->b_edev, args[0]->b_lblkno] = 0; } END { printa(@q); normalize(@i, (timestamp - start) / 1000000000); normalize(@b, (timestamp - start) / 1000000000 * 1024); printf("%-30s %11s %11s %11s %11s\n", "", "avg latency", "stddev", "iops", "throughput"); printa("%-30s %@9uus %@9uus %@9u/s %@8uk/s\n", @a, @v, @i, @b); } -- Michael W. Lucas - mwlucas@michaelwlucas.com, Twitter @mwlauthor http://www.MichaelWLucas.com/, http://blather.MichaelWLucas.com/