On Wed, Nov 07, 2007 at 06:25:38PM -0800, Roman Shaposhnik wrote:
> On Wed, 2007-11-07 at 12:35 -0800, Neelam wrote:
> > Well I am trying to record the duration of user level mutex locks. Below is 
> > the simple script:
> > 
> > -----------------------------------------------------------------
> > #!/usr/sbin/dtrace -s
> > 
> > dtrace:::BEGIN
> > {
> > self->begin=timestamp;
> > self->mutex_acq=0;
> > }
> > 
> > plockstat$1:::mutex-acquire
> > {
> > self->ts[arg0]=timestamp;
> > self->mutex_acq++;
> > @mutex_acquired["No of mutexes acquired"]=count();
> 
>   One extra bit of advice -- get rid of aggregations. They might
> add to dilation quite significantly.

Certainly aggregating by a string is going to hurt; if you just change
that to "@mutex_acquired = count()", you should be happier.  And given
that you're trying to tune your enabling, you might want to consult
both the chapter on the subject in the DTrace documentation, and the
slides on the topic in the Advanced DTrace presenation (specifically,
look for "Trick: Measuring DTrace").

        - Bryan

--------------------------------------------------------------------------
Bryan Cantrill, Sun Microsystems FishWorks.       http://blogs.sun.com/bmc
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to