ttoulliu2002
2005-Nov-13 01:56 UTC
[dtrace-discuss] plockstat(1M) consumer and plockstat provider
Hi: As plockstat(1M) consumer implemented, plockstat$target:::mutex-acquire etc, which requires monitored CLI or pid. Anyway to customerize or create my own user-land lockstat consumer without rewrite a plockstat provider ? in addition, plockstat provider is not visible via dtrace(1M) consumer. Pointers are appreciated ! Thanks This message posted from opensolaris.org
Jim Mauro
2005-Nov-13 15:28 UTC
[dtrace-discuss] plockstat(1M) consumer and plockstat provider
Hi - If I am understanding your question correctly, you can
instrument the user lock primitives via the pid provider,
as they are implemented in libc.
# dtrace -n ''pid8967:libc:mutex_lock:entry { @[tid]=count() }''
dtrace: description ''pid8967:libc:mutex_lock:entry '' matched 1
probe
^C
12 1
17 1
13 6
16 7
14 11
15 12
You can instrument all the lock primitive entry and return points,
and use the passed args in the entry probes for aggregation keys.
(e.g. arg0 in mutex_enter is the address of the lock).
HTH,
/jim
ttoulliu2002 wrote:
>Hi:
>
>As plockstat(1M) consumer implemented,
>
>plockstat$target:::mutex-acquire etc,
>
>which requires monitored CLI or pid.
>
>Anyway to customerize or create my
>
>own user-land lockstat consumer without
>
>rewrite a plockstat provider ? in addition,
>
>plockstat provider is not visible via dtrace(1M)
>consumer.
>
>Pointers are appreciated !
>
>Thanks
>This message posted from opensolaris.org
>_______________________________________________
>dtrace-discuss mailing list
>dtrace-discuss at opensolaris.org
>
>
Adam Leventhal
2005-Nov-13 18:36 UTC
[dtrace-discuss] plockstat(1M) consumer and plockstat provider
The plockstat provider isn''t visibile until you''ve forced the probes to be created. For example: bash-3.00# dtrace -l -n plockstat\*::: ID PROVIDER MODULE FUNCTION NAME bash-3.00# dtrace -l -n plockstat1050::: ID PROVIDER MODULE FUNCTION NAME 34498 plockstat1050 libc.so.1 mutex_lock_impl mutex-error 34499 plockstat1050 libc.so.1 fast_process_lock mutex-error ... This is because the plockstat provider is lazily loaded. That is to say, it''s only instantiated when a DTrace consumer examines a given process. In terms of creating your own plockstat(1M)-like consumer, the best way to get started is to run plockstat wih the -V option to see the script it uses internally. Adam On Sat, Nov 12, 2005 at 05:56:32PM -0800, ttoulliu2002 wrote:> Hi: > > As plockstat(1M) consumer implemented, > > plockstat$target:::mutex-acquire etc, > > which requires monitored CLI or pid. > > Anyway to customerize or create my > > own user-land lockstat consumer without > > rewrite a plockstat provider ? in addition, > > plockstat provider is not visible via dtrace(1M) > consumer. > > Pointers are appreciated ! > > Thanks > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl
ttoulliu2002
2005-Nov-14 17:47 UTC
[dtrace-discuss] Re: plockstat(1M) consumer and plockstat provider
Adam: I can not terminate the plockstat(1M) consumer until I make instrumented pid or execname exit. Anyway to have plockstat(1M) consumer properly exit without touching process ? It does not work in prod env. Thanks This message posted from opensolaris.org
Adam Leventhal
2005-Nov-14 19:11 UTC
[dtrace-discuss] Re: plockstat(1M) consumer and plockstat provider
On Mon, Nov 14, 2005 at 09:47:10AM -0800, ttoulliu2002 wrote:> I can not terminate the plockstat(1M) consumer until > I make instrumented pid or execname exit.plockstat(1M) should exit when you hit crtl-C. Is this not happening? Adam -- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl