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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
|
<?xml version='1.0'?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="using-setup">
<title>Installation and Setup</title>
<remark>
required packages, installation thru yum, repos (?); possibly, a script to install all required packages
</remark>
<remark>
notes in ~/Desktop/SystemTap/aug21chatlog and ~/Desktop/SystemTap/noted_wcohenmeeting
</remark>
<indexterm>
<primary>Installation</primary>
<secondary>Setup and Installation</secondary>
</indexterm>
<indexterm>
<primary>Setup and Installation</primary>
</indexterm>
<para>To deploy SystemTap, install the SystemTap packages along
with the corresponding set of <package>-devel</package>,
<package>-debuginfo</package>, and <package>-debuginfo-common</package>
packages for your kernel. If your system has multiple kernels installed and
you intend to use SystemTap on more than one of them, also
install the <package>-devel</package> and <package>-debuginfo</package>
packages for <emphasis>each</emphasis> of those kernel versions.
</para>
<para>The following sections discuss the installation procedures in greater detail.
</para>
<important>
<title>Important</title> <para>Many users confuse
<package>-debuginfo</package> with <package>-debug</package>. Remember
that the deployment of SystemTap requires the installation of the
<package>-debuginfo</package> package of the kernel, not the
<package>-debug</package> version of the kernel.</para>
</important>
<section id="installproper">
<title>Installing SystemTap</title>
<para>To deploy SystemTap, install the following RPM packages:
</para>
<indexterm>
<primary>Installation</primary>
<secondary>systemtap package</secondary>
</indexterm>
<indexterm>
<primary>systemtap package</primary>
</indexterm>
<!-- next 2 indexterms for systemtap-runtime package -->
<indexterm>
<primary>Installation</primary>
<secondary>systemtap-runtime package</secondary>
</indexterm>
<indexterm>
<primary>systemtap-runtime package</primary>
</indexterm>
<itemizedlist>
<listitem><para><package>systemtap</package></para></listitem>
<listitem><para><package>systemtap-runtime</package></para></listitem>
</itemizedlist>
<para>
To do so, run the following command as root:
</para>
<screen><command>yum install systemtap systemtap-runtime</command></screen>
<para>
Note that before using SystemTap, you still need to install the required
kernel information packages. On modern systems, run the following command
as root to install these packages:
</para>
<screen><command>stap-prep</command></screen>
<para>
If this command does not work, try manual installation as described below.
</para>
</section>
<section id="install-kinfo">
<title>Installing Required Kernel Information Packages Manually</title>
<indexterm>
<primary>Installation</primary>
<secondary>required packages</secondary>
</indexterm>
<indexterm>
<primary>required packages</primary>
</indexterm>
<indexterm>
<primary>packages required to run SystemTap</primary>
</indexterm>
<indexterm>
<primary>RPMs required to run SystemTap</primary>
</indexterm>
<indexterm>
<primary>Installation</primary>
<secondary>kernel information packages</secondary>
</indexterm>
<indexterm>
<primary>kernel information packages</primary>
</indexterm>
<para>
SystemTap needs information about the kernel in order to place instrumentation in it (in other words, probe it). This
information also allows SystemTap to generate the code for the instrumentation.
</para>
<para>
The required information is contained
in the matching <package>-devel</package>, <package>-debuginfo</package>, and <package>-debuginfo-common</package>
packages for your kernel. The necessary <package>-devel</package> and <package>-debuginfo</package> packages for the ordinary
"vanilla" kernel are as follows:
</para>
<itemizedlist>
<listitem><para><package>kernel-debuginfo</package></para></listitem>
<listitem><para><package>kernel-debuginfo-common</package></para></listitem>
<listitem><para><package>kernel-devel</package></para></listitem>
</itemizedlist>
<para>
Likewise, the necessary packages for the PAE kernel are
<package>kernel-PAE-debuginfo</package>, <package>kernel-PAE-debuginfo-common</package>,
and <package>kernel-PAE-devel</package>.
</para>
<indexterm>
<primary>Installation</primary>
<secondary>kernel version, determining the</secondary>
</indexterm>
<indexterm>
<primary>kernel version, determining the</primary>
</indexterm>
<indexterm>
<primary>determining the kernel version</primary>
</indexterm>
<indexterm>
<primary>uname -r</primary>
</indexterm>
<para> To determine what kernel your system is currently using, use:</para>
<screen>uname -r</screen>
<para>
For example, if you intend to use SystemTap on kernel version <emphasis>2.6.18-53.el5</emphasis> on an <emphasis>i686</emphasis> machine,
download and install the following RPM packages:
</para>
<itemizedlist>
<listitem><para><package>kernel-debuginfo-2.6.18-53.1.13.el5.i686.rpm</package></para></listitem>
<listitem><para><package>kernel-debuginfo-common-2.6.18-53.1.13.el5.i686.rpm</package></para></listitem>
<listitem><para><package>kernel-devel-2.6.18-53.1.13.el5.i686.rpm</package></para></listitem>
</itemizedlist>
<important>
<title>Important</title>
<para>
The version, variant, and architecture of the <package>-devel</package>, <package>-debuginfo</package> and
<package>-debuginfo-common</package> packages must match the kernel you wish to probe with SystemTap <emphasis>exactly</emphasis>.
</para>
</important>
<para>
The easiest way to install the required kernel information
packages is through <command>yum install</command> and
<command>debuginfo-install</command> commands.
The <command>debuginfo-install</command> command is included with
later versions of the <package>yum-utils</package>
package (for example, version 1.1.10) and also requires
an appropriate <command>yum</command> repository from
which to download and install
<package>-debuginfo</package> and <package>-debuginfo-common</package>
packages. You can install the required
<package>-devel</package>,
<package>-debuginfo</package>, and
<package>-debuginfo-common</package> packages for your
kernel.
</para>
<!-- next 2 indexterms for rhelchannels.sh -->
<para>
When the appropriate software repositories are enabled,
install the corresponding packages for a specific kernel
with the following commands:
</para>
<screen><command>yum install <replaceable>kernelname</replaceable>-devel-<replaceable>version</replaceable></command>
<command>debuginfo-install <replaceable>kernelname</replaceable>-<replaceable>version</replaceable></command></screen>
<para>
Replace <replaceable>kernelname</replaceable> with the appropriate kernel variant name
(for example, <option>kernel-PAE</option>), and <replaceable>version</replaceable>
with the target kernel's version. For example, to install the required kernel information packages for
the <systemitem>kernel-PAE-2.6.18-53.1.13.el5</systemitem> kernel, run:
</para>
<screen><command>yum install kernel-PAE-devel-2.6.18-53.1.13.el5</command>
<command>debuginfo-install kernel-PAE-2.6.18-53.1.13.el5</command></screen>
<para>
Once you have manually downloaded the required packages to the machine, run the following command as root to install them:
</para>
<screen><command>rpm --force -ivh <replaceable>package_names</replaceable></command></screen>
</section>
<section id="testing">
<title>Initial Testing</title>
<indexterm>
<primary>Installation</primary>
<secondary>initial testing</secondary>
</indexterm>
<indexterm>
<primary>initial testing</primary>
</indexterm>
<indexterm>
<primary>testing, initial</primary>
</indexterm>
<para>If you are currently using the kernel you intend to probe with
SystemTap, you can immediately test whether the deployment was
successful. If not, you restart the system and load the appropriate
kernel.
</para>
<para>
To start the test, run the following command:
</para>
<screen><command>stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}'</command></screen>
<para>
This command instructs SystemTap
to print <computeroutput>read performed</computeroutput> and then exit
properly once a virtual file system read is detected. If the SystemTap
deployment was successful, it prints output similar to the
following:
</para>
<!-- <para>To start the test, run the command <command>stap -v -e 'probe vfs.read
{exit()}'</command>. This command simply instructs SystemTap to exit
properly once a virtual file system read is detected. If the SystemTap
deployment was successful, you should get output very similar to the
following:
</para>-->
<screen>Pass 1: parsed user script and 45 library script(s) in 340usr/0sys/358real ms.
Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s) in 290usr/260sys/568real ms.
Pass 3: translated to C into "/tmp/stapiArgLX/stap_e5886fa50499994e6a87aacdc43cd392_399.c" in 490usr/430sys/938real ms.
Pass 4: compiled C into "stap_e5886fa50499994e6a87aacdc43cd392_399.ko" in 3310usr/430sys/3714real ms.
Pass 5: starting run.
read performed
Pass 5: run completed in 10usr/40sys/73real ms.</screen>
<para> The last three lines of the output (beginning with
<computeroutput>Pass 5</computeroutput>) indicate that SystemTap was able to
successfully create the instrumentation to probe the kernel, run the
instrumentation, detect the event being probed (in this case, a virtual file
system read), and execute a valid handler (print text then close it with no errors).
</para>
</section>
</section>
|