« Cloning Zones | Main | RMI »

Chime

Chime is a tool that all users of OpenSolaris should take the time to install. Chime is a graphical user interface for DTrace that makes viewing DTrace output enjoyable. It has traces that can provide valuable feedback on your system (and you don't even have to know DTrace to use it). For example, take this simple script that aggregates the system calls over the period of time the script is run:

bleonard@os200906:~$ cat syscalls_overtime.d 
syscall:::entry
{
	@a[execname] = count();
}

When run from the terminal for a couple of seconds the output looks as follows:

bleonard@os200906:~$ dtrace -qs syscalls_overtime.d 
\^C

  devfsadm                                                          2
  updatemanagernot                                                  2
  dhcpagent                                                         3
  gam_server                                                        6
  gvfsd-trash                                                       6
  dlmgmtd                                                           8
  gvfs-hal-volume-                                                  8
  nautilus                                                          9
  clock-applet                                                     12
  gnome-panel                                                      12
  gnome-settings-d                                                 16
  metacity                                                         16
  java                                                             26
  bonobo-activatio                                                 56
  gnome-netstatus-                                                 80
  gnome-terminal                                                   93
  VBoxClient                                                      120
  firefox-bin                                                     160
  Xorg                                                            281

The same script run from Chime is much more useful. The columns are sortable, you can control the interval (I only have a rough estimate of how long the script from the terminal above ran) and you can navigate through the samples.


 You can also drill-down:




To Install Chime

  • Download the 10 MB compressed package (i386, SPARC).
  • Extract it:
    bleonard@os200906:~$ gunzip Downloads/osol0chime-i386-1.4.pkg.gz
  • Install it:
  • bleonard@os200906:~$ pfexec pkgadd -d Downloads/osol0chime-i386-1.4.pkg 
    
    The following packages are available:
      1  OSOL0chime     Chime Visualization Tool for DTrace
                        (i386) 1.4.44
    
    Select package(s) you wish to process (or 'all' to process
    all packages). (default: all) [?,??,q]: 
    Processing package instance <OSOL0chime> from </export/home/bleonard/Downloads/osol0chime-i386-1.4.pkg>
    
    Chime Visualization Tool for DTrace(i386) 1.4.44
    http://www.opensolaris.org/os/project/dtrace-chime/
    Using </opt> as the package base directory.
    ## Processing package information.
    ## Processing system information.
    ## Verifying disk space requirements.
    ## Checking for conflicts with packages already installed.
    ## Checking for setuid/setgid programs.
    
    Installing Chime Visualization Tool for DTrace as <OSOL0chime>
    
    ## Installing part 1 of 1.
    /opt/OSOL0chime/bin/chime
    ...
    Installation of <OSOL0chime> was successful
  • Put chime on the path. I'm simply going to add a link to the chime executable in my /usr/bin directory:
    pfexec ln -s /opt/OSOL0chime/bin/chime /usr/bin/chime
  • Add permissions to execute DTrace scripts:
    bleonard@os200906:~$ pfexec usermod -K defaultpriv=basic,dtrace_proc,dtrace_kernel bleonard
    UX: usermod: bleonard is currently logged in, some changes may not take effect until next login.
    
    You can log in again as follows:
    bleonard@os200906:$ su bleonard
    Password: 
    
  • Run chime:

Chime as a Learning Tool

DTrace itself can be a bit daunting. A default installation of OpenSolaris has over 54,000 probes available:

bleonard@os200906:~$ dtrace -l | wc -l
54012

And this number only grows as you install additional DTrace enabled software. My base installation of OpenSolaris has almost 70,000!

bleonard@opensolaris:~$ dtrace -l | wc -l
69229

Probes are grouped by:

  • provider (a library of related probes)
  • module (the module that contains the function)
  • function (the function that contains the probe)
  • name (the name of the probe)
For example, the probe used above was from the syscall provider named entry (syscall:::entry). So, how would you even know that "syscall" was the name of a provider? Chime provides a nice utility for viewing and filtering the DTrace probes. From the Chime main menu, select File > List Probes:



For more information on probes see the Probes topic in the DTrace Topics Guide.

Chime itself comes with over 70 traces. And if you look at the context menu above, one of the options is to look at the DTrace program, which provides an excellent opportunity to learn DTrace by example. Here's the program used for the drill-down into Firefox shown above:


If you're interested in learning more about DTrace, I found the Dynamic Tracing Guide and excellent resource.

Additional Resources

« Cloning Zones | Main | RMI »
Comments:

This tool has come a long way... Now, how do I run chime against a remote system without painfully expensive X forwarding? Is there a remote option? Nothing interesting happens on my workstation -- only the servers behind two firewalls half-way across the world.

Posted by Theo Schlossnagle on July 24, 2009 at 12:15 PM GMT #

Any plans on integrating it to /contrib repo?

Posted by Robert Milkowski on July 27, 2009 at 03:46 AM GMT #

Theo, see if http://blogs.sun.com/observatory/entry/remote_systems_tracing_with_chime works for you.

Posted by Brian Leonard on July 29, 2009 at 03:17 PM GMT #

Robert, I was wondering/hoping for the same. I just posted the question on the dtrace forum: http://www.opensolaris.org/jive/thread.jspa?threadID=109076

Posted by Brian Leonard on July 29, 2009 at 03:24 PM GMT #

Cooool......

Posted by Dave on August 25, 2009 at 07:19 PM GMT #

Just a note that I seemed to have bumped into this on snv_118:

http://defect.opensolaris.org/bz/show_bug.cgi?id=10134

Posted by Dave on August 25, 2009 at 09:33 PM GMT #

Theo Schlossnagle: I just use VNC. It's much faster than X forwarding.

Posted by Michael Kozlowicz on December 28, 2009 at 11:41 PM GMT #

this is the coolest thing I had waited for to learn about kernel
great!

Posted by srinidhi on December 29, 2009 at 01:28 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
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today