Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 24, 2007, 11:09 AM   #1
Macabee
macrumors newbie
 
Join Date: Oct 2007
DTrace - Thanks for the breakage

So Apple put DTrace into OSX Leopard. It's pretty cool. Have been playing with it for a large chunk of the day.

Of course - useless without enabling it some of the languages we all use (PHP, Python and Ruby).

So - I spent a while hacking it about with the source code....

Now I have things like:

Quote:
class Something:
def foo(self):
print "In the class"

def foobar():
print "Nothing"

def helloworld():
print "Hello World!"
foobar()

helloworld()
a = Something()
a.foo()
Quote:
#!/usr/sbin/dtrace -ZCs

#pragma D option quiet

python$target:::function-entry,python$target:::function-return
{
printf("%s %s (%s:%d)\n", probename == "function-entry" ? "->" : "<-",
copyinstr(arg1), copyinstr(arg0), arg2);
}
Quote:
-> <module> (foo.py:1)
-> Something (foo.py:1)
<- Something (foo.py:2)
-> helloworld (foo.py:8)
-> foobar (foo.py:5)
<- foobar (foo.py:6)
<- helloworld (foo.py:10)
-> foo (foo.py:2)
<- foo (foo.py:3)
<- <module> (foo.py:14)
Would anybody be interested in the patches for the dtrace PEAR module for PHP and the MacPorts versions of Python and Ruby? Not sure if they'll accept the patches upstream - so I want to gauge whether people want that or not.
Macabee is offline   0 Reply With Quote
Old Oct 24, 2007, 11:38 AM   #2
toddburch
macrumors 6502a
 
Join Date: Dec 2006
Location: Katy, Texas
Send a message via AIM to toddburch Send a message via MSN to toddburch
Ruby - absolutely.
toddburch is offline   0 Reply With Quote
Old Oct 24, 2007, 12:05 PM   #3
Macabee
Thread Starter
macrumors newbie
 
Join Date: Oct 2007
Quote:
Originally Posted by toddburch View Post
Ruby - absolutely.
yeah the Ruby one by Joyenet appears to be broken on OSX. I have created a fix patch and the mini-site will go up shortly with all the details for patching/making dtrace work with these scripting languages.
Macabee is offline   0 Reply With Quote
Old Oct 24, 2007, 02:19 PM   #4
Macabee
Thread Starter
macrumors newbie
 
Join Date: Oct 2007
http://leenux.org.uk/dtrace-with-ruby-on-osx/

Have fun!
Macabee is offline   0 Reply With Quote
Old Oct 24, 2007, 05:18 PM   #5
HiRez
macrumors 601
 
HiRez's Avatar
 
Join Date: Jan 2004
Location: Western US
This sounds interesting. Can you explain how DTrace is different from other profiling tools? Does it integrate with compilers/debuggers or is it separate? Would it also be used for Objective-C/C/Cocoa?
__________________
Go outside, the graphics are amazing!
HiRez is offline   0 Reply With Quote
Old Oct 25, 2007, 02:39 AM   #6
Macabee
Thread Starter
macrumors newbie
 
Join Date: Oct 2007
Quote:
Originally Posted by HiRez View Post
This sounds interesting. Can you explain how DTrace is different from other profiling tools? Does it integrate with compilers/debuggers or is it separate? Would it also be used for Objective-C/C/Cocoa?
http://video.google.com/videoplay?do...01113289007228

The author/inventor can do it a lot better than I can.
Macabee is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Thanks for the advice - MBP Ordered badsmurf MacBook Pro 12 Aug 9, 2011 11:13 AM
Comin' home to Mac - And thanks for the Advice! chinarider Buying Tips and Advice 3 Jan 14, 2008 09:14 AM
Thanks for the help everyone, I took the plunge!! 840quadra Buying Tips, Advice and Discussion (archive) 7 Apr 1, 2005 11:26 PM
Thanks for the advice, pulled the trigger! ghostee Buying Tips, Advice and Discussion (archive) 3 Mar 15, 2004 02:08 PM


All times are GMT -5. The time now is 11:42 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC