• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
DTrace probe problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: DTrace probe problem
      • From: Bill Bumgarner <email@hidden>
  • Prev by Date: Re: running an external app
  • Next by Date: Re: Cocoa-dev Digest, Vol 5, Issue 919
  • Previous by thread: Re: Cocoa-dev Digest, Vol 5, Issue 919
  • Next by thread: Re: DTrace probe problem
  • Index(es):
    • Date
    • Thread