Ruby Tracer Module
Included with the patch is a built-in Ruby module called Tracer. The Tracer module provides a single method, fire which can take one or two arguments and an optional block.
The first argument passed will be passed to the D script as arg0 for the ruby-probe probe. This is conventionally a probe name.
Example:
Tracer.fire('foo')
The second argument is optional and can be used to pass additional data into the D script as arg1.
Example:
Tracer.fire('query', sql)
When a block is passed, Tracer will fire a probe before and after yielding the block. The first argument will be used as the base name of the probe. The probes which fire before and after the block runs will have “-start” and “-end” appended, respectively.
Example:
Tracer.fire('foo') { puts 'Hi, mom!' }
Will fire a probe with arg0 set to “foo-start”, run the block, the fire a probe with arg0 set to “foo-end”.