I pulled up the sample dtrace scripts from the Macruby 0.5 b2 source and was working with the script:
class World
def say(message)
puts message
end
end
world = World.new
world.say('hello')
I tried to run the trace as:
$ sudo dtrace -s methods_count.d -c "macruby world.rb"
(where methods_count.d is one of the sample dtrace scripts)
This doesn't produce any meaningful results.
After playing around for a bit, I have learned that if I add a bit to the end of my ruby script:
while(true)
sleep 1
end
What I take from that is if the ruby script runs for a longer time, dtrace has a chance plugging into the ruby application which it does not have when the script exits quickly.
Am I doing something the wrong way? Is there a better way to ask dtrace to attach to my ruby application and catch information?
Scott