Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Aug 2015 13:24:31 -0400
From:      "Michael W. Lucas" <mwlucas@michaelwlucas.com>
To:        fs@freebsd.org
Subject:   dtrace script for io latency/throughput
Message-ID:  <20150818172431.GA97967@mail.michaelwlucas.com>

next in thread | raw e-mail | index | archive | help
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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150818172431.GA97967>