Re: -finstrument-functions and program startup

2009-01-29 Thread Colin Wheeler
Specify the methods you want to trace in the probefunc section. For example if you want to trace what lead up to and happened after a specific method you could do something like BEGIN { self->traceme = 0; } pid$target:::entry { self->traceme = 1; ustack(); } pid$target:::entry, pid$target:::retur

Re: -finstrument-functions and program startup

2009-01-29 Thread Benjamin Stiglitz
> How is this instrumentation done? I guess the text segment is modified > in RAM when the pid provider is attached to the process? Yes, when a probe is enabled a small thunk is dropped in that calls out to the DTrace pieces in the kernel and logs the event. USDT probes work similarly, but insert

Re: -finstrument-functions and program startup

2009-01-29 Thread Shawn Erickson
On Thu, Jan 29, 2009 at 12:55 PM, Benjamin Stiglitz wrote: > That's not correct—the pid provider instruments every user function call in > the target (well, every one that has an externally visible symbol). Ah must be lack of symbols preventing it from working in my tests. Was only ever getting

Re: -finstrument-functions and program startup

2009-01-29 Thread Benjamin Stiglitz
Actually, a probe of 'pidnnn:::entry' works just great (where nnn is the target process' pid.) Check out the pid provider documentation: Only for code that has such probes compiled into functions / methods. Apple has th

Re: -finstrument-functions and program startup

2009-01-29 Thread Shawn Erickson
On Thu, Jan 29, 2009 at 11:25 AM, Benjamin Stiglitz wrote: >> 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 wh

Re: -finstrument-functions and program startup

2009-01-29 Thread Benjamin Stiglitz
> 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. Actually, a probe of 'pidn

RE: -finstrument-functions and program startup

2009-01-29 Thread Karan, Cem (Civ, ARL/CISD)
Shawn Erickson wrote on Thursday, January 29, 2009 11:56 AM: > 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 provid

Re: -finstrument-functions and program startup

2009-01-29 Thread Shawn Erickson
On Thu, Jan 29, 2009 at 6:09 AM, Karan, Cem (Civ, ARL/CISD) 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

RE: -finstrument-functions and program startup

2009-01-29 Thread Karan, Cem (Civ, ARL/CISD)
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 l

Re: -finstrument-functions and program startup

2009-01-28 Thread Greg Parker
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 wo

-finstrument-functions and program startup

2009-01-28 Thread Karan, Cem (Civ, ARL/CISD)
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, laz