Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Dec 2010 00:21:05 -0800
From:      Artem Belevich <fbsdlist@src.cx>
To:        Thomas Zander <thomas.e.zander@googlemail.com>
Cc:        freebsd-stable <freebsd-stable@freebsd.org>
Subject:   Re: DTrace (or other monitor) access to LBA of a block device
Message-ID:  <AANLkTikWoCmRQE6VDG1S88s5UCtXY7acP1Q_pwo=gYY%2B@mail.gmail.com>
In-Reply-To: <AANLkTi=2Ln5s-mD%2B%2B-iKEq2v-1f31fpavXB7kUfTC2Lf@mail.gmail.com>
References:  <AANLkTi=2Ln5s-mD%2B%2B-iKEq2v-1f31fpavXB7kUfTC2Lf@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Dec 2, 2010 at 1:33 PM, Thomas Zander
<thomas.e.zander@googlemail.com> wrote:
> Hi,
>
> do we have any way to monitor which LBAs of which block device are
> read/written at a given time?
>
> I stumbled upon this,
> http://southbrain.com/south/2008/02/fun-with-dtrace-and-zfs-mirror.html
>
> which is pretty intriguing. Unfortunately on FreeBSD we do not have
> the DTrace io provider, so his dtrace script would not work.
> Do we have another option to monitor block device access in a similar fashion?

GEOM sounds like a good candidate for probing of that kind.

sudo dtrace -n 'fbt:kernel:g_io_deliver:entry { printf("%s %d %d
%d\n",stringof(args[0]->bio_from->geom->name), args[0]->bio_cmd,
args[0]->bio_offset, args[0]->bio_length); }'

Keep in mind that g_io_deliver will be called for each GEOM node from
top to bottom for each completed request. You may need to add some
filtering on device name to avoid redundant info.

--Artem



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikWoCmRQE6VDG1S88s5UCtXY7acP1Q_pwo=gYY%2B>