diff --git a/en_US.ISO8859-1/books/handbook/dtrace/chapter.xml b/en_US.ISO8859-1/books/handbook/dtrace/chapter.xml index e57cd3a6e2..10363f641b 100644 --- a/en_US.ISO8859-1/books/handbook/dtrace/chapter.xml +++ b/en_US.ISO8859-1/books/handbook/dtrace/chapter.xml @@ -215,25 +215,43 @@ options DEBUG=-g Using &dtrace; + &dtrace; scripts consist of a list of one or more + probes, or instrumentation points, where + each probe is associated with an action. Whenever the condition + for a probe is met, the associated action is executed. For + example, an action may occur when a file is opened, a process is + started, or a line of code is executed. The action might be to + log some information or to modify context variables. The + reading and writing of context variables allows probes to share + information and to cooperatively analyze the correlation of + different events. + To view all probes, the administrator can execute the following command: &prompt.root; dtrace -l | more - This section demonstrates how to use two of the fully supported scripts from the + Each probe has an ID, a + PROVIDER (dtrace or fbt), a + MODULE, and a + FUNCTION NAME. Refer to &man.dtrace.1; for + more information about this command. + + The examples in this section provide an overview of how to + use two of the fully supported scripts from the &dtrace; Toolkit: the hotkernel and procsystime scripts. The hotkernel script is designed to identify - which function is using the most kernel time. Run normally, it + which function is using the most kernel time. It will produce output similar to the following: &prompt.root; cd /usr/share/dtrace/toolkit &prompt.root; ./hotkernel Sampling... Hit Ctrl-C to end. - The system administrator must use the + As instructed, use the CtrlC key combination to stop the process. Upon termination, the script will display a list of kernel functions @@ -272,8 +290,7 @@ kernel`sched_idletd 137 0.3% how we should look that up. --> This script will also work with kernel modules. To use this - feature, run the script with the - flag: + feature, run the script with : &prompt.root; ./hotkernel -m Sampling... Hit Ctrl-C to end. @@ -297,10 +314,10 @@ kernel 874 0.4% seriously obvious. It is 5AM btw. --> The procsystime script captures and - prints the system call time usage for a given - PID or process name. In the following + prints the system call time usage for a given process ID + (PID) or process name. In the following example, a new instance of /bin/csh was - spawned. The procsystime was executed and + spawned. Then, procsystime was executed and remained waiting while a few commands were typed on the other incarnation of csh. These are the results of this test: @@ -331,8 +348,8 @@ Elapsed Times for processes csh, sigsuspend 6985124 read 3988049784 - As shown, the read() system call seems - to use the most time in nanoseconds with the + As shown, the read() system call + used the most time in nanoseconds while the getpid() system call used the least amount of time.