Ruby User-Space Markers
Some work has been done in Ruby to include support for SystemTap user-space markers in Red Hat Enterprise Linux 6.2 and allow SystemTap to probe the start and completion of each Ruby function. The Ruby user-space probes available are:
ruby.function.entry classname:string methodname:string file:string line:long $arg1:long $arg2:long $arg3:long $arg4:long ruby.function.return classname:string methodname:string file:string line:long $arg1:long $arg2:long $arg3:long $arg4:long ruby.gc.begin ruby.gc.end ruby.line file:string line:long $arg1:long $arg2:long ruby.object.free classname:string $arg1:long ruby.raise classname:string file:string line:long $arg1:long $arg2:long $arg3:long ruby.rescue file:string line:long $arg1:long $arg2:long ruby.ruby__probe probe_point:string probe_data:string $arg1:long $arg2:long
Using Ruby User-Space Markers
To use the Ruby user-space markers on a Fedora you will need:
- RPMs:
- ruby
- systemtap, systemtap-runtime
Membership to the appropriate unix groups (or root) to use systemtap in general. See also http://sourceware.org/systemtap/man/stap-server.8.html
Examples Scripts for Ruby Probing
Short example scripts:
"top" for Ruby, rubyfuntop.stp
tracing Ruby function calls, ruby-example.stp
counting method calls: http://lukas.zapletalovi.com/2012/01/probing-ruby-apps-with-systemtap-in.html
The SystemTap Ruby user-space probes provide similar functionality to the probe points used in:
http://tenderlovemaking.com/2011/12/05/profiling-rails-startup-with-dtrace/
