What makes OpenSolaris interesting? Reason #3: DTrace

For the first two reasons see the posts about ZFS and SMF

Today I delivered an OpenSolaris training at the Masaryk university in Brno together with Zdenek Kotala from Prague PostreSQL team. One of the cool things that Zdenek showed during his DTrace session was the following script:

pfexec dtrace -F -n 'fbt:conskbd:conskbdlrput:entry { self->in = 1; }' -n 'fbt:::/self->in/{}' -n 'fbt:conskbd:conskbdlrput:return/self->in/{ exit(0); }'

What does it do? It gives you an answer to a question you always wanted to know - what happens in your system once you press a single key. You might get surprised how much work has to be done. You can run this script on OpenSolaris, no extra package is necessary  (and it should work on Solaris, too) to see what happens. Kudos to whoever wrote the script - Zdenek told me who it was but I forgot.

DTrace is very cool. I was skeptical first - because I hate learning a new language for a task, but learning D language is worth it, you can get so much information from the system - you can intercept every system call, every byte moved using IO, monitor your Java garbage collection, debug Python scripts - you can ask very complex questions and get precise answers. DTrace is one tool which lets you see what really happens both in the kernel and in any applications.

I could write a lot about DTrace, but the best thing you can do is to try it yourself. There is an extensive hands-on-lab from Java One about DTrace I recommend to look at - just run some of the DTrace scripts and see for yourself how much you can learn about your OS and applications. You can download the hands-on-lab from developers.sun.com.

Comments:

gud

Posted by guest on June 19, 2009 at 09:57 AM GMT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

The Observatory is a blog for users of Oracle Solaris. Tune in here for tips, tricks and more as we explore the Solaris operating system from Oracle.

Connect with Oracle Solaris:


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
20
21
22
23
24
25
26
27
28
29
30
   
       
Today