What kind of system is this, and what release of Solaris? Enabling all the probes for all the function entry points in a process (pid$1:::entry) can take some time, and may make your terminal window appear hung, but it should not almost hang your system (unless you did this on a laptop or small, single CPU machine).
If you have thread contention, use the plockstat provider. Run "plockstat -V ...." and save the output. The "-V" flag will generate the actual D that plockstat uses (to stderr if I remember right). You can save that and use it as a building block for chasing with threads are hitting your contended locks. Of course, you may find the output of "plockstat -A -p PID" is all you need... Thanks, /jim [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; > 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