Yes, I am trying to find my hotspots.

However - NO dtrace script will work.

Yes, the process does exist. ( I have to change the pid for each test 
performed. )
Yes, I am running dtrace as root, so I do have access to the process.

wr




-----Original Message-----
From: Chad Mynhier [mailto:cmynh...@gmail.com] 
Sent: Friday, May 07, 2010 2:53 PM
To: William Reich
Subject: Re: [dtrace-discuss] dtrace / c++ / lots of threads

On Fri, May 7, 2010 at 2:43 PM, William Reich <re...@ulticom.com> wrote:
>
>
>
> #!/usr/sbin/dtrace -qs
>
> BEGIN
>
> {       flag =  1 ; }
>
>
>
> END
>
> {       flag = 0 ; }
>
> pid$1:::entry
>
> {
>
> self->t[probefunc] = timestamp ;
>
> }
>
>
>
> pid$1:::return
>
> /self->t[probefunc] && flag /
>
> {       this->time = timestamp - self->t[probefunc] ;
>
>         @[probefunc] = avg(this->time) ;
>
>         self->t[probefunc] = 0 ;
>
> }

Unrelated question, but what is it that you're trying to achieve with
this script?  Do you need to know how much time you're spending in
each and every function you call?  Or are you just trying to get a
feel for your hotspots?  If it's the latter, just use sampling,
something like this:

profile-997
/ arg1 && pid == $1 /
{
    @[ufunc(arg1)] = count();
}

This is going to be far more lightweight, but it will still give you a
feel for your hotspots.  Enabling every single function entry and
return probe is going to be very expensive.

Chad


++++++++++++++++++++++++++++
>I have a very simple dtrace script ( shown below ).
>This script works on simple programs just fine.
>
>Now I want to use this script on a large C++ executable.
>The executable is 8.5 meg in size on a x86 platform.
>This executable has more than 10 threads in it.
>
>I try to execute that  the dtrace script and I get this error - 
>
>./adc.d 24930
>dtrace: failed to compile script  ./adc.d: line 7: failed to grab process 24930
>
>What is the error really trying to tell me ?

_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to