RFC: A trial io provider for DTrace...
gnn at freebsd.org
gnn at freebsd.org
Fri May 25 16:02:47 UTC 2012
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
More information about the freebsd-arch
mailing list