DTrace

from Wikipedia, the free encyclopedia
DTrace
Basic data

developer Sun Microsystems
Publishing year January 2005
operating system Unixoids
category Analysis, diagnosis
License CDDL
German speaking No
dtrace.org

DTrace (Dynamic Tracing) is a system tool developed by Sun Microsystems for kernel and application analysis in real time. Originally developed for Solaris , it has now been ported to several Unix-like systems.

DTrace offers inspection options in running processes, memory , processor time , file system and network resources.

description

DTrace was designed to optimize and debug applications and the operating system itself. It is therefore a programming tool for debugging , but it does not work with breakpoints like a classic debugger .

Monitoring programs are written in the D programming language (not to be confused with the "D" programming language ). D is a subset of C , which has been expanded with additional commands, variables and built-in functions for process monitoring. D programs are similar in structure to the awk programming language . They consist of a list of test probes, whereby each test probe can be linked to an action. Whenever the conditions of a probe are met, the associated action is carried out. A typical test probe is, for example, the opening of a file, the start of a process or when a machine instruction is being executed at a certain main memory address.

Particular attention has been paid to safe use in a productive environment. Therefore z. B. in the programming language D no loops allowed. Although DTrace changes the code to be run (in the kernel or in the application), even with several thousand probes, it slows the system down only slightly as the probes are run and nothing else. In addition, new probes can also be added for applications at runtime .

Examples

DTrace scripts can be called directly from the command line. They are always output on the standard output stream.

# Neuer Prozess mit Argumenten,
dtrace -n 'proc:::exec-success { trace(curpsinfo->pr_psargs); }' 
# Dateien wurden von einem Prozess geöffnet,
dtrace -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }' 
# Anzahl der System Prozedur aufrufe eines Programmes,
dtrace -n 'syscall:::entry { @num[execname] = count(); }' 
# Anzahl der System Prozedur aufrufe des Systems,
dtrace -n 'syscall:::entry { @num[probefunc] = count(); }' 
# Anzahl der System Prozedur aufrufe eines Prozesses,
dtrace -n 'syscall:::entry { @num[pid,execname] = count(); }' 
# Benötigter Speicherplatz eines Prozesses,
dtrace -n 'io:::start { printf("%d %s %d",pid,execname,args[0]->b_bcount); }' 
# Anzahl der Seiten welche durch den Prozess ausgelagert wurden,
dtrace -n 'vminfo:::pgpgin { @pg[execname] = sum(arg0); }'

Often, most of a DTrace script is just the formatted output of the results. Over 200 examples of open source DTrace scripts can be found in the DTraceToolkit, including documentation and demonstration.

Supported Platforms

DTrace was released in November 2003 and has been part of Solaris since January 2005 . DTrace was the first core component of Solaris, which was placed under the Common Development and Distribution License for Open Solaris .

DTrace has been ported to FreeBSD , NetBSD, and QNX .

Apple has ported Leopard DTrace to Mac OS X 10.5 as part of the Xcode development environment , along with a graphical interface called Instruments , 40 monitoring probe scripts, tools for examining disk access (iosnoop) and process execution (execsnoop) . In contrast to the other platforms to which DTrace has been ported, Mac OS X contains a flag (P_LNOATTACH) which a program can activate so that the respective process can no longer be examined by debugging software such as DTrace and gdb . In the original implementation on Mac OS X, however, this had an impact on independent test probes for monitoring the system information, because as long as a program was running that had this flag set, the system test probes were useless because they were no longer triggered. This problem was corrected a few months later in Mac OS X 10.5.3.

A port for Linux is currently in the beta phase, but it only works with some functions such as Syscall, FBT, USDT, and a new one called Instruction Power. The implementation is provided as an optional kernel module so that the source code of the kernel does not have to be changed. This is not only necessary to ensure portability, but also to avoid conflicts with the GPL .

Authors and Awards

DTrace was developed by Bryan Cantrill, Mike Shapiro and Adam Leventhal. In 2005, the authors were honored for innovations from Info World and Technology Review. DTrace also won the top prize in the Wall Street Journal 2006 Innovation Awards competition.

Individual evidence

  1. http://www.freebsd.org/doc/de/books/handbook/dtrace.html
  2. Archive link ( Memento of the original dated May 31, 2010 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice.  @1@ 2Template: Webachiv / IABot / hub.opensolaris.org
  3. http://www.freebsd.org/releases/7.1R/announce.html
  4. http://mail-index.netbsd.org/source-changes/2010/02/21/msg006855.html
  5. http://raichoo.blogspot.com/2008/08/dtrace-berall.html
  6. http://www.apple.com/macosx/developertools/instruments.html ( Memento of October 24, 2007 in the Internet Archive )
  7. Archive link ( Memento of the original from January 21, 2008 in the Internet Archive ) Info: The archive link was inserted automatically and not yet checked. Please check the original and archive link according to the instructions and then remove this notice.  @1@ 2Template: Webachiv / IABot / blogs.sun.com
  8. Archive link ( Memento of the original from June 18, 2008 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice.  @1@ 2Template: Webachiv / IABot / blogs.sun.com
  9. Archive link ( Memento of the original from March 27, 2010 in the Internet Archive ) Info: The archive link was inserted automatically and not yet checked. Please check the original and archive link according to the instructions and then remove this notice.  @1@ 2Template: Webachiv / IABot / www.infoworld.com
  10. http://www.technologyreview.com/tr35/Profile.aspx?Cand=T&TRID=91
  11. http://online.wsj.com/public/article/SB115755300770755096-R2Ct41cQ4ZIPMwk4_xh0xU_HnQI_20061011.html?mod=tff_main_tff_top
  12. http://www.pro-linux.de/news/1/10218/dtrace-mit-innovationspreis-ausgezeich.html