April 29, 2010

Solaris 10: how see lwp creation

Posted in Dtrace at 3:24 pm by alessiodini

Recently i followed a Solaris 8 system that had issue during lwp ( light-weight process ) creation.
This problem was solved through software tuning by other people.

But i thought … “and if i should meet a similar problem on Solaris 10 , how i can exactly measure lwp creation by process?”

Today i found a reply for this question!
I’m studying “Dynamic Performance Tuning and Troubleshooting with Dtrace”. I wrote this script.
I have tested it running in one terminal and opening a new connection to the system:

trace: script ‘./lwp.d’ matched 2 probes
0 44530 :tick-10sec

value ————- Distribution ————- count
-2147483648 | 0
-1073741824 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 14
-536870912 | 0

value ————- Distribution ————- count
-2147483648 | 0
-1073741824 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
-536870912 | 0

value ————- Distribution ————- count
-2147483648 | 0
-1073741824 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
-536870912 | 0

This output shows that during execution of the script ksh has created 14 lwp , sshd 5 and sh 1
Very simple with dtrace !



  1. Ed Austin said,


    Actually lwp performance efficiency as you know has greatly improved since Sol 8 due to the 1:1 mapping between user and kthreads via the lwp.

    I will save this script and play around with it!


    • alessiodini said,

      thanks !
      Let me know if u will find something interesting about dtrace and lwp.
      Anyway if u will write some dtrace script i’ll be curious to play with it πŸ™‚

  2. Ed Austin said,

    Wouldn’t this be simpler?

    dtrace -n ‘proc:genunix:lwp_create:lwp-create{trace(execname)}’

    Nice web site πŸ™‚

    • alessiodini said,

      hi πŸ™‚
      u wrote similar code but u did in cli format !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: