On Sun, Nov 16, 2008 at 01:50:52AM -0800, [EMAIL PROTECTED] wrote: > I tried this script (attached below) but it printed only 1 thread (shown > below). When I tried :::entry and my system was almost hung. I think pstack > is good enough for my purpose. :-) > > BTW any script to find out which two threads are causing lock contention > /deadlock? > > #!/usr/sbin/dtrace -s > #pragma D option quiet > #pragma D option defaultargs > > pid$1:::entry > / this->thread_is_already_printed != 1 / > { > this->thread_is_already_printed = 1; You should be using "self->", not "this->". this-> variables are only valid during a single probe firing (i.e. one or more enablings with the same probe name), and must be set before use. They are generally used for temporary results, to avoid recomputing things, and to communicate between multiple enablings of the same probe.
self-> variables are thread-local, and will do what you desire here. Cheers, - jonathan > printf("thread %d: \n", tid); > ustack(50); > } > > $./pstack.d 16028 > thread 11: > > libc.so.1`_lwp_mutex_lock > libc.so.1`_lwp_cond_reltimedwait+0x78 > libc.so.1`_lwp_cond_timedwait+0x1c > libjvm.so`__1cHMonitorEwait6Mil_i_+0x328 > libjvm.so`__1cIVMThreadDrun6M_v_+0x1b4 > libjvm.so`__1cG_start6Fpv_0_+0x208 > libc.so.1`_lwp_start > > > --- On Fri, 11/14/08, Adam Leventhal <[EMAIL PROTECTED]> wrote: > > > From: Adam Leventhal <[EMAIL PROTECTED]> > > Subject: Re: [dtrace-discuss] truss "-fall" equivalent in DTrace > > To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > Cc: "Mark Plotnick" <[EMAIL PROTECTED]>, dtrace-discuss@opensolaris.org > > Date: Friday, November 14, 2008, 7:32 PM > > On Fri, Nov 14, 2008 at 12:40:55AM -0800, > > [EMAIL PROTECTED] wrote: > > > Can I get pstack equivalent script using DTrace? > > > > You can use ustack() at any probe. > > > > Adam > > > > -- > > Adam Leventhal, Fishworks > > http://blogs.sun.com/ahl > > > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss@opensolaris.org _______________________________________________ dtrace-discuss mailing list dtrace-discuss@opensolaris.org