with an action. These probes are comparable to a pointcut in aspect-oriented programming. Whenever the condition for the probe is met, the associated action is executed (the probe "fires"). A typical probe might fire when a certain file is opened, or a process is started, or a certain line of code is executed. A probe that fires may analyze the run-time situation by accessing the call stack and context variables and evaluating expressions; it can then print out or log some information, record it in a database, or modify context variables. The reading and writing of context variables allows probes to pass information to each other, allowing them to cooperatively analyze the correlation of different events. Special consideration has been taken to make DTrace safe to use in a production environment. For example, there is minimal probe effect when tracing is underway, and no performance impact associated with any disabled probe; this is important since there are tens of thousands of DTrace probes that can be enabled. New probes can also be created dynamically. Command line examples DTrace scripts can be invoked directly from the command line, providing one or more probes and actions as arguments. Some examples: # New processes with arguments dtrace -n 'proc:::exec-success { trace(curpsinfo->pr_psargs); }' # Files opened by process dtrace -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }' # Syscall count by program dtrace -n 'syscall:::entry { @num[execname] = count(); }' # Syscall count by syscall dtrace -n 'syscall:::entry { @num[probefunc] = count(); }' # Syscall count by process dtrace -n 'syscall:::entry { @num[pid,execname] = count(); }' # Disk size by process dtrace -n 'io:::start { printf("%d %s %d",pid,execname,args[0]->b_bcount); }' # Pages paged in by process dtrace -n 'vminfo:::pgpgin { @pg[execname] = sum(arg0); }' Scripts can also be written which can reach hundreds of lines in length, although typically only tens of lines are needed for advanced troubleshooting and analysis. Over 200 examples of open source DTrace scripts can be found in the DTraceToolkit, created by Brendan Gregg (author of the DTrace book), which also provides documentation and demonstrations of each. Supported platforms DTrace first became available for use in November 2003, and was formally released as part of Sun's Solaris 10 in January 2005. DTrace was the first component of the OpenSolaris project to have its source code released under the Common Development and Distribution License (CDDL). DTrace is an integral part of illumos and related