Some editorial changes to the DTrace chapter.

Will finish the editorial pass on this chapter once I confirm with
devs whether PR150255 is correct and get more info on inconsistencies
about the Toolkit.

Sponsored by:	iXsystems
This commit is contained in:
Dru Lavigne 2014-04-15 17:34:53 +00:00
parent b2dd94546a
commit a1c9a8f7d4
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=44564

View file

@ -43,12 +43,13 @@ that might make this chapter too large.
<para>&dtrace; is a remarkable profiling tool, with an impressive <para>&dtrace; is a remarkable profiling tool, with an impressive
array of features for diagnosing system issues. It may also array of features for diagnosing system issues. It may also
be used to run pre-written scripts to take advantage of its be used to run pre-written scripts to take advantage of its
capabilities. Users may even author their own utilities using capabilities. Users can author their own utilities using
the &dtrace; D Language, allowing them to customize their the &dtrace; D Language, allowing them to customize their
profiling based on specific needs.</para> profiling based on specific needs.</para>
<para>The &dtrace; implementation in &os; provides experimental <para>The &os; implementation in provides full support for kernel
support for userland &dtrace;. This feature allows users to &dtrace; and experimental
support for userland &dtrace;. Userland &dtrace; allows users to
perform function boundary tracing for userland programs using perform function boundary tracing for userland programs using
the <literal>pid</literal> provider, and to insert static probes the <literal>pid</literal> provider, and to insert static probes
into userland programs for later tracing. Some ports, such as into userland programs for later tracing. Some ports, such as
@ -87,11 +88,6 @@ that might make this chapter too large.
<para>Have some familiarity with security and how it <para>Have some familiarity with security and how it
pertains to &os; (<xref linkend="security"/>).</para> pertains to &os; (<xref linkend="security"/>).</para>
</listitem> </listitem>
<listitem>
<para>Understand how to obtain and rebuild the &os; sources
(<xref linkend="updating-upgrading"/>).</para>
</listitem>
</itemizedlist> </itemizedlist>
</sect1> </sect1>
@ -143,7 +139,7 @@ that might make this chapter too large.
<filename>/dev/dtrace/dtrace</filename> is strictly limited to <filename>/dev/dtrace/dtrace</filename> is strictly limited to
<systemitem class="username">root</systemitem>.</para> <systemitem class="username">root</systemitem>.</para>
<para>&dtrace; falls under &sun;'s Common Development and <para>&dtrace; falls under the Common Development and
Distribution License (<acronym>CDDL</acronym>) license. To view Distribution License (<acronym>CDDL</acronym>) license. To view
this license on &os;, see this license on &os;, see
<filename>/usr/src/cddl/contrib/opensolaris/OPENSOLARIS.LICENSE</filename> <filename>/usr/src/cddl/contrib/opensolaris/OPENSOLARIS.LICENSE</filename>
@ -163,12 +159,11 @@ that might make this chapter too large.
of &os; or who prefer to statically compile in &dtrace; support of &os; or who prefer to statically compile in &dtrace; support
should add the following lines to a custom kernel configuration should add the following lines to a custom kernel configuration
file and recompile the kernel using the instructions in <xref file and recompile the kernel using the instructions in <xref
linkend="kernelconfig"/>.</para> linkend="kernelconfig"/>:</para>
<programlisting>options KDTRACE_HOOKS <programlisting>options KDTRACE_HOOKS
options DDB_CTF</programlisting> options DDB_CTF</programlisting>
<note>
<para>Users of the AMD64 architecture should also add this <para>Users of the AMD64 architecture should also add this
line:</para> line:</para>
@ -178,7 +173,6 @@ options DDB_CTF</programlisting>
<acronym>FBT</acronym>. While &dtrace; will work without <acronym>FBT</acronym>. While &dtrace; will work without
this option, there will be limited support for this option, there will be limited support for
function boundary tracing.</para> function boundary tracing.</para>
</note>
<para>Once the &os; system has rebooted into the new kernel, or <para>Once the &os; system has rebooted into the new kernel, or
the &dtrace; kernel modules have been loaded using the &dtrace; kernel modules have been loaded using
@ -198,25 +192,27 @@ options DDB_CTF</programlisting>
Otherwise, install the &dtrace; Toolkit using the Otherwise, install the &dtrace; Toolkit using the
<package>sysutils/DTraceToolkit</package> package or <package>sysutils/DTraceToolkit</package> package or
port.</para> port.</para>
<para>The &dtrace; Toolkit includes many scripts in the special
language of &dtrace;. This language is called the D
language and it is very similar
to C++. An in depth discussion of the language is beyond the
scope of this document. It is extensively discussed at <uri
xlink:href="http://wikis.oracle.com/display/DTrace/Documentation">http://wikis.oracle.com/display/DTrace/Documentation</uri>.</para>
</sect1> </sect1>
<sect1 xml:id="dtrace-using"> <sect1 xml:id="dtrace-using">
<title>Using &dtrace;</title> <title>Using &dtrace;</title>
<para>To view all <para>To view all
probes the administrator may now execute the following probes, the administrator can execute the following
command:</para> command:</para>
<screen>&prompt.root; <userinput>dtrace -l | more</userinput></screen> <screen>&prompt.root; <userinput>dtrace -l | more</userinput></screen>
<para>All output is passed to the <command>more</command> <para>The &dtrace; Toolkit is a collection of ready-made scripts
utility as it will quickly overflow the screen buffer. At for collecting system information. There are scripts
this point, &dtrace; should be considered working. It is now to check open files, memory, <acronym>CPU</acronym> usage, and
time to review the toolkit.</para>
<para>The toolkit is a collection of ready-made scripts to run
with &dtrace; to collect system information. There are scripts
to check open files, memory, <acronym>CPU</acronym> usage and
a lot more. Extract the scripts with the following a lot more. Extract the scripts with the following
command:</para> command:</para>
@ -353,15 +349,4 @@ Elapsed Times for processes csh,
<function>getpid()</function> system call used the least amount <function>getpid()</function> system call used the least amount
of time.</para> of time.</para>
</sect1> </sect1>
<sect1 xml:id="dtrace-language">
<title>The D Language</title>
<para>The &dtrace; Toolkit includes many scripts in the special
language of &dtrace;. This language is called <quote>the D
language</quote> by &sun; documentation, and it is very similar
to C++. An in depth discussion of the language is beyond the
scope of this document. It is extensively discussed at <uri
xlink:href="http://wikis.oracle.com/display/DTrace/Documentation">http://wikis.oracle.com/display/DTrace/Documentation</uri>.</para>
</sect1>
</chapter> </chapter>