Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 May 2012 12:03:40 -0400
From:      gnn@freebsd.org
To:        arch@freebsd.org
Subject:   RFC: A trial io provider for DTrace...
Message-ID:  <86wr40tfhf.wl%gnn@neville-neil.com>

next in thread | raw e-mail | index | archive | help
Howdy,

I have just put up the first patch that can give you something similar
to the io provider in DTrace.  The patch is against HEAD of about a
week ago.

You can find the patch here: freebsd.org:

http://people.freebsd.org/~gnn/dtio_provider.diff

Note that you need to create a src/sys/modules/dtrace/dtio/ directory
for this patch, since patch doesn't seem to create directories for me.

The arguments are not exactly the same as in Solaris, for instance I
don't yet support the fileinfo_t, but, you can get to the devstat and
bio structures via args[0] and args[1] respectively.

Here is an example of it working:

dtrace -n 'io:::start /args[0] != 0/{ trace(args[0]->bio_bcount)}'

Remember you need to be root to use DTrace.

I need to clean this up and get the translators working properly
before I can check this in.

Also, note that this patch doesn't catch all I/O, but should get most
of it, as it's hooked into the devstat system.

I will be adding manual pages for the internals of DTrace to our
section 9, as well as, hopefully, writing up a wiki page on how to add
your own kernel providers.

Comments welcome.

Best,
George



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86wr40tfhf.wl%gnn>