Hi all,

I've just released a new version of my ruby-dtrace gem. This is a
separate project to the interpreter probes patch available from
Joyent, and provides:

 * a binding to libdtrace - trace directly from Ruby
 * creation of USDT probes from Ruby

The libdtrace bindings let you write D scripts in Ruby, and build
tracing directly into bigger applications. As examples, I've ported
the scsi.d script to Ruby, and there's a simple Rails plugin included
with the gem which appends a "DTrace report" to each page.

The USDT probes feature is pretty experimental right now - it uses
RubyInline's approach of automatically building Ruby C extensions to
dynamically create probes in the running Ruby process -- that are
meaningful to your Ruby application rather than generically in the
interpreter.

I've tried to minimise the disabled-probe overhead by using the
is-enabled macros, but right now there will undoubtedly be some. These
probes don't require a patched interpreter at the moment, but it might
well be possible to reduce the overhead with some interpreter support.

The gem should be available from Rubyforge, and there is documentation here:

  http://ruby-dtrace.rubyforge.org/ruby-dtrace/

An example rails plugin which adds a handful of probes is here:

  http://sourcefarce.net/svn/rails/trunk/plugins/dtrace_probes/

I'd welcome any feedback on this, especially the approach to adding
USDT probes -- though it's clearly a hack! I'm not sure at the moment
how to go about adding a provider directly, but it looks like Java is
getting this feature:
http://blogs.sun.com/kamg/entry/adding_user_defined_dtrace_probes .


Cheers,
Chris.
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to