On Thu, Jan 29, 2009 at 6:09 AM, Karan, Cem (Civ, ARL/CISD)
<cka...@arl.army.mil> wrote:
> Greg Parker wrote on Wednesday, January 28, 2009 4:22 PM
>
>> On Jan 28, 2009, at 10:33 AM, Karan, Cem (Civ, ARL/CISD) wrote:
>> > First off, I know this question is going to the wrong list,
>> but I have
>> > NO idea which list would be best.  If anyone wants to jump
>> in and tell
>> > me a better list, I'll gladly move there.
>> >
>> > Background:
>> > I have an application that is working very, very hard to drive me
>> > insane.  It is multithreaded, lazy, and has my broken attempt at
>> > trampoline code.  Now, it crashes once in a while, but I'm not sure
>> > what the trail of broken bits are that causes the crash.  If only I
>> > had a way of instrumenting every single entry and exit of each
>> > function, I could log it all… which is exactly what -finstrument-
>> > functions does.
>>
>> You'll likely get better results from dtrace than
>> -finstrument- functions. DTrace can be programmed to act on
>> function entry or exit for all functions in a specified file.
>> (DTrace experts: this is your cue to chime in.)
>
> I thought DTrace was primarily statistical in nature, right?

DTrace is probe based. If a probe exists and is enabled it will fire
and allow you to collect information.

For example try the following in terminal...

sudo dtrace -n 'syscall:::entry'

With that said you need a provider that provides the probe points that
you need. Apple has implemented many providers in 10.5. For example
you can probe many aspects of message dispatch in the objective-c
runtime or syscalls without any need to instrument your code. In
terminal run "sudo dtrace -l" to see a list of providers in the
system.

I don't believe an Apple provider exist (or can exist) for general
probing of C++ or C function entry and exit. You will have to
instrument C++ methods and C function (aka make your own provider) to
be able to use DTrace for what I think you are attempting to do.

-Shawn
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to