[MacRuby-devel] dtrace and macruby

Scott Thompson easco at mac.com
Sun Dec 20 17:52:10 PST 2009


> I have not had any trouble running macruby through dtrace here, can you send the contents of your dtrace script so that I can compare to my working files?


Thanks to everyone for their suggestions. 

I was doing the prior work on my office computer (a Mac Pro).  I tried the same thing on this computer (a laptop) and it seems to work fine.

The dscript I was running wasn't very complicated, it was something like this:

-- macruby-dtrace.d --

	macruby$target:::method-entry 
	{
		printf("%s.%s", copyinstr(arg0), copyinstr(arg1));
	}

	macruby$target:::method-return 
	{
		printf("%s.%s", copyinstr(arg0), copyinstr(arg1));
	}

The ruby script is:

-- macruby-dtrace.rb --

	class World
	def say(message)
	  puts message
	end
	end

	world = World.new
	world.say('hello')


I was able to run this with the command:

sudo dtrace -F -s "macruby-dtrace.d" -c "/usr/local/bin/macruby ./macruby-dtrace.rb"

On the laptop it works fine.  I'll look at the problem again when I get to the office to see if it was some kind of keyboard-chair error.

Scott



More information about the MacRuby-devel mailing list