DTrace probe problem
DTrace probe problem
- Subject: DTrace probe problem
- From: radj <email@hidden>
- Date: Tue, 27 May 2008 13:35:58 +0800
Hello, everyone.
I'm not sure where to post this DTrace question but since the subject is
about tracing Cocoa calls, I decided to put it here.
I've been experimenting with DTrace since last week and I have found a way
to listen to the Cocoa methods called in my app using this little D script:
/* temp.d */
objc1234:::entry
{
/* etc */
}
It's fine, it catches lots of Cocoa methods in process 1234 but I have a
small problem. The app does not stay alive for long and different PIDs are
assigned to it every instance of it. So the PID in the probe isn't really
very helpful here.
I've made a little workaround by assigning a macro for the pid:
objc$1:::entry
{
/* etc */
}
and when I compile it, I just run "dtrace -s temp.d 1234" which makes the D
script a little dynamic with regards to the PID. Unfortunately, I need to
capture every call from the start to the end. Running the app, checking it's
PID, and then running the D script doesn't capture much of the start of the
app.
So my problem now is, how can I catch all Cocoa calls of the app without
knowing the PID it will have when it runs?
Thanks,
radj
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden