[f1607a4] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[8dfc5c3] | 7 | <!ENTITY valgrind-download-http "https://sourceware.org/ftp/valgrind/valgrind-&valgrind-version;.tar.bz2">
|
---|
[ec67287] | 8 | <!ENTITY valgrind-download-ftp "ftp://sourceware.org/pub/valgrind/valgrind-&valgrind-version;.tar.bz2">
|
---|
[119bb45] | 9 | <!ENTITY valgrind-md5sum "46e5fbdcbc3502a5976a317a0860a975">
|
---|
| 10 | <!ENTITY valgrind-size "19 MB">
|
---|
| 11 | <!ENTITY valgrind-buildsize "425 MB (add 70 MB for tests)">
|
---|
| 12 | <!ENTITY valgrind-time "0.6 SBU (Using parallelism=4; add 11 SBU for tests)">
|
---|
[f1607a4] | 13 | ]>
|
---|
| 14 |
|
---|
| 15 | <sect1 id="valgrind" xreflabel="Valgrind-&valgrind-version;">
|
---|
| 16 | <?dbhtml filename="valgrind.html"?>
|
---|
| 17 |
|
---|
| 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
| 22 |
|
---|
| 23 | <title>Valgrind-&valgrind-version;</title>
|
---|
| 24 |
|
---|
| 25 | <indexterm zone="valgrind">
|
---|
| 26 | <primary sortas="a-Valgrind">Valgrind</primary>
|
---|
| 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
| 30 | <title>Introduction to Valgrind</title>
|
---|
| 31 |
|
---|
| 32 | <para>
|
---|
| 33 | <application>Valgrind</application> is an instrumentation framework for
|
---|
| 34 | building dynamic analysis tools. There are Valgrind tools that can
|
---|
| 35 | automatically detect many memory management and threading bugs, and
|
---|
| 36 | profile programs in detail. Valgrind can also be used to build new
|
---|
[f3429309] | 37 | tools.
|
---|
[f1607a4] | 38 | </para>
|
---|
| 39 |
|
---|
[4c2c5ad] | 40 | &lfs90_checked;
|
---|
[f1607a4] | 41 |
|
---|
| 42 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 43 | <itemizedlist spacing="compact">
|
---|
| 44 | <listitem>
|
---|
| 45 | <para>
|
---|
| 46 | Download (HTTP): <ulink url="&valgrind-download-http;"/>
|
---|
| 47 | </para>
|
---|
| 48 | </listitem>
|
---|
| 49 | <listitem>
|
---|
| 50 | <para>
|
---|
| 51 | Download (FTP): <ulink url="&valgrind-download-ftp;"/>
|
---|
| 52 | </para>
|
---|
| 53 | </listitem>
|
---|
| 54 | <listitem>
|
---|
| 55 | <para>
|
---|
| 56 | Download MD5 sum: &valgrind-md5sum;
|
---|
| 57 | </para>
|
---|
| 58 | </listitem>
|
---|
| 59 | <listitem>
|
---|
| 60 | <para>
|
---|
| 61 | Download size: &valgrind-size;
|
---|
| 62 | </para>
|
---|
| 63 | </listitem>
|
---|
| 64 | <listitem>
|
---|
| 65 | <para>
|
---|
| 66 | Estimated disk space required: &valgrind-buildsize;
|
---|
| 67 | </para>
|
---|
| 68 | </listitem>
|
---|
| 69 | <listitem>
|
---|
| 70 | <para>
|
---|
| 71 | Estimated build time: &valgrind-time;
|
---|
| 72 | </para>
|
---|
| 73 | </listitem>
|
---|
| 74 | </itemizedlist>
|
---|
| 75 |
|
---|
| 76 | <bridgehead renderas="sect3">Valgrind Dependencies</bridgehead>
|
---|
| 77 |
|
---|
| 78 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 79 | <para role="optional">
|
---|
[ae6d3b8] | 80 | <xref linkend="bind"/> or <xref linkend="bind-utils"/> (for tests),
|
---|
[f1607a4] | 81 | <xref linkend="boost"/>,
|
---|
[35f1730] | 82 | <xref linkend="gdb"/> (for tests),
|
---|
[ae6d3b8] | 83 | <xref linkend="llvm"/> (with Clang), and
|
---|
| 84 | <xref linkend="which"/> (for tests)
|
---|
[f1607a4] | 85 | </para>
|
---|
| 86 |
|
---|
[ae6d3b8] | 87 | <!-- See "maintainer note", below
|
---|
[f1607a4] | 88 | <bridgehead renderas="sect4">Optional for regenerating the documentation</bridgehead>
|
---|
| 89 | <para role="optional">
|
---|
[f3429309] | 90 | <xref linkend="libxslt"/> and
|
---|
[2d98031c] | 91 | <xref linkend="texlive"/> (or <xref linkend="tl-installer"/>)
|
---|
[f1607a4] | 92 | </para>
|
---|
[ae6d3b8] | 93 | -->
|
---|
[f1607a4] | 94 | <para condition="html" role="usernotes">User Notes:
|
---|
| 95 | <ulink url="&blfs-wiki;/valgrind"/>
|
---|
| 96 | </para>
|
---|
| 97 | </sect2>
|
---|
| 98 |
|
---|
| 99 | <sect2 role="installation">
|
---|
| 100 | <title>Installation of Valgrind</title>
|
---|
| 101 |
|
---|
[bbe0fbf] | 102 | <para>
|
---|
| 103 | Install <application>Valgrind</application> by running the following
|
---|
[1b0d0188] | 104 | commands:
|
---|
| 105 | </para>
|
---|
| 106 |
|
---|
[29dbd37] | 107 | <screen><userinput>sed -i 's|/doc/valgrind||' docs/Makefile.in &&
|
---|
[1b0d0188] | 108 |
|
---|
| 109 | ./configure --prefix=/usr \
|
---|
[f1607a4] | 110 | --datadir=/usr/share/doc/valgrind-&valgrind-version; &&
|
---|
| 111 | make</userinput></screen>
|
---|
| 112 |
|
---|
| 113 | <para>
|
---|
[bbe0fbf] | 114 | To test the results, issue: <command>make regtest</command>. The tests
|
---|
[ae6d3b8] | 115 | may hang forever if <xref linkend="gdb"/> is not installed. Some tests
|
---|
| 116 | are known to hang also, depending on the version of glibc. Problematic
|
---|
| 117 | tests can be disabled by changing the <userinput>prereq:</userinput> line
|
---|
[0639bb6] | 118 | in the corresponding <filename>.vgtest</filename> file to
|
---|
[ae6d3b8] | 119 | <userinput>prereq: false</userinput>. For example:
|
---|
[f1607a4] | 120 | </para>
|
---|
| 121 |
|
---|
[ae6d3b8] | 122 | <screen><userinput>sed -e 's@prereq:.*@prereq: false@' \
|
---|
| 123 | -i {helgrind,drd}/tests/pth_cond_destroy_busy.vgtest</userinput></screen>
|
---|
| 124 |
|
---|
| 125 | <note>
|
---|
| 126 | <para>
|
---|
| 127 | The <application>OpenMP</application> tests are skipped if libgomp
|
---|
| 128 | has been compiled with <option>--enable-linux-futex</option> (the
|
---|
| 129 | default). If needed, just recompile the libgomp library from
|
---|
| 130 | the gcc build tree, passing <option>--disable-linux-futex</option>
|
---|
| 131 | to configure, storing the library to some place and changing the link
|
---|
| 132 | from <filename>/usr/lib/libgomp.so.1</filename> to point to the new
|
---|
| 133 | library.
|
---|
| 134 | </para>
|
---|
| 135 | </note>
|
---|
| 136 |
|
---|
| 137 | <!-- Note to maintainer: there is a long thread in ticket #5882 explaining
|
---|
| 138 | why we do not provide instructions to rebuild the documentation.
|
---|
| 139 | (still broken with TeXLive 2016) -->
|
---|
| 140 |
|
---|
[f1607a4] | 141 | <para>
|
---|
| 142 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 143 | </para>
|
---|
| 144 |
|
---|
| 145 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
| 146 |
|
---|
| 147 | </sect2>
|
---|
| 148 |
|
---|
| 149 | <sect2 role="commands">
|
---|
| 150 | <title>Command Explanations</title>
|
---|
| 151 |
|
---|
| 152 | <para>
|
---|
[9dfdd942] | 153 | <command>sed -i ... docs/Makefile.in </command>: This sed provides for
|
---|
[f1607a4] | 154 | installing the documentation in a versioned directory.
|
---|
| 155 | </para>
|
---|
| 156 |
|
---|
[d30b7e7] | 157 | <para>
|
---|
| 158 | <option>--enable-lto=yes</option>: This option allows building Valgrind
|
---|
| 159 | with LTO (link time optimization). This produces a smaller/faster
|
---|
| 160 | Valgrind (up to 10%), but build time increases to about 5.5 SBU.
|
---|
| 161 | </para>
|
---|
| 162 |
|
---|
[f1607a4] | 163 | </sect2>
|
---|
| 164 |
|
---|
| 165 | <sect2 role="content">
|
---|
| 166 | <title>Contents</title>
|
---|
| 167 |
|
---|
| 168 | <segmentedlist>
|
---|
| 169 | <segtitle>Installed Programs</segtitle>
|
---|
| 170 | <segtitle>Installed Library</segtitle>
|
---|
| 171 | <segtitle>Installed Directories</segtitle>
|
---|
| 172 |
|
---|
| 173 | <seglistitem>
|
---|
| 174 | <seg>
|
---|
[f3429309] | 175 | callgrind_annotate,
|
---|
| 176 | callgrind_control,
|
---|
| 177 | cg_annotate,
|
---|
| 178 | cg_diff,
|
---|
| 179 | cg_merge,
|
---|
| 180 | ms_print,
|
---|
| 181 | valgrind,
|
---|
[f1607a4] | 182 | valgrind-di-server,
|
---|
[f3429309] | 183 | valgrind-listener, and
|
---|
[f1607a4] | 184 | vgdb
|
---|
| 185 | </seg>
|
---|
| 186 | <seg>
|
---|
[528bf1b] | 187 | libcoregrind-<Arch>-linux.a,
|
---|
| 188 | libreplacemalloc_toolpreload-<Arch>-linux.a,
|
---|
| 189 | libvex-<Arch>-linux.a,
|
---|
[29dbd37] | 190 | libvexmultiarch-amd64-linux.a,
|
---|
[528bf1b] | 191 | vgpreload_core-<Arch>-linux.so,
|
---|
| 192 | vgpreload_drd-<Arch>-linux.so,
|
---|
| 193 | vgpreload_exp-dhat-<Arch>-linux.so,
|
---|
| 194 | vgpreload_exp-sgcheck-<Arch>-linux.so,
|
---|
| 195 | vgpreload_helgrind-<Arch>-linux.so,
|
---|
| 196 | vgpreload_massif-<Arch>-linux.so, and
|
---|
| 197 | vgpreload_memcheck-<Arch>-linux.so, where
|
---|
[29dbd37] | 198 | <Arch> is x86 or amd64
|
---|
[f1607a4] | 199 | </seg>
|
---|
| 200 | <seg>
|
---|
| 201 | /usr/lib/valgrind,
|
---|
[f3429309] | 202 | /usr/include/valgrind, and
|
---|
[f1607a4] | 203 | /usr/share/doc/valgrind-&valgrind-version;
|
---|
| 204 | </seg>
|
---|
| 205 | </seglistitem>
|
---|
| 206 | </segmentedlist>
|
---|
| 207 |
|
---|
| 208 | <variablelist>
|
---|
| 209 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 210 | <?dbfo list-presentation="list"?>
|
---|
| 211 | <?dbhtml list-presentation="table"?>
|
---|
| 212 |
|
---|
| 213 | <varlistentry id="valgrind-prog">
|
---|
| 214 | <term><command>valgrind</command></term>
|
---|
| 215 | <listitem>
|
---|
| 216 | <para>
|
---|
| 217 | is a program for debugging and profiling Linux executables.
|
---|
| 218 | </para>
|
---|
| 219 | <indexterm zone="valgrind valgrind-prog">
|
---|
| 220 | <primary sortas="b-valgrind">valgrind</primary>
|
---|
| 221 | </indexterm>
|
---|
| 222 | </listitem>
|
---|
| 223 | </varlistentry>
|
---|
| 224 |
|
---|
| 225 | <varlistentry id="callgrind_annotate">
|
---|
| 226 | <term><command>callgrind_annotate</command></term>
|
---|
| 227 | <listitem>
|
---|
| 228 | <para>
|
---|
| 229 | takes an output file produced by the
|
---|
| 230 | <application>Valgrind</application> tool Callgrind and prints the
|
---|
| 231 | information in an easy-to-read form.
|
---|
| 232 | </para>
|
---|
[6076396] | 233 | <indexterm zone="valgrind callgrind_annotate">
|
---|
[f1607a4] | 234 | <primary sortas="b-callgrind_annotate">callgrind_annotate</primary>
|
---|
| 235 | </indexterm>
|
---|
| 236 | </listitem>
|
---|
| 237 | </varlistentry>
|
---|
| 238 |
|
---|
| 239 | <varlistentry id="callgrind_control">
|
---|
| 240 | <term><command>callgrind_control</command></term>
|
---|
| 241 | <listitem>
|
---|
| 242 | <para>
|
---|
[f3429309] | 243 | controls programs being run by the <application>Valgrind</application>
|
---|
[f1607a4] | 244 | tool Callgrind.
|
---|
| 245 | </para>
|
---|
| 246 | <indexterm zone="valgrind callgrind_control">
|
---|
| 247 | <primary sortas="b-callgrind_control">callgrind_control</primary>
|
---|
| 248 | </indexterm>
|
---|
| 249 | </listitem>
|
---|
| 250 | </varlistentry>
|
---|
| 251 |
|
---|
| 252 | <varlistentry id="cg_annotate">
|
---|
| 253 | <term><command>cg_annotate</command></term>
|
---|
| 254 | <listitem>
|
---|
| 255 | <para>
|
---|
[f3429309] | 256 | is a post-processing tool for the <application>Valgrind</application>
|
---|
[f1607a4] | 257 | tool Cachegrind.
|
---|
| 258 | </para>
|
---|
| 259 | <indexterm zone="valgrind cg_annotate">
|
---|
| 260 | <primary sortas="b-cg_annotate">cg_annotate</primary>
|
---|
| 261 | </indexterm>
|
---|
| 262 | </listitem>
|
---|
| 263 | </varlistentry>
|
---|
| 264 |
|
---|
| 265 | <varlistentry id="cg_diff">
|
---|
| 266 | <term><command>cg_diff</command></term>
|
---|
| 267 | <listitem>
|
---|
| 268 | <para>
|
---|
| 269 | compares two Cachegrind output files.
|
---|
| 270 | </para>
|
---|
| 271 | <indexterm zone="valgrind cg_diff">
|
---|
| 272 | <primary sortas="b-cg_diff">cg_diff</primary>
|
---|
| 273 | </indexterm>
|
---|
| 274 | </listitem>
|
---|
| 275 | </varlistentry>
|
---|
| 276 |
|
---|
| 277 | <varlistentry id="cg_merge">
|
---|
| 278 | <term><command>cg_merge</command></term>
|
---|
| 279 | <listitem>
|
---|
| 280 | <para>
|
---|
| 281 | merges multiple Cachegrind output files into one.
|
---|
| 282 | </para>
|
---|
| 283 | <indexterm zone="valgrind cg_merge">
|
---|
| 284 | <primary sortas="b-cg_merge">cg_merge</primary>
|
---|
| 285 | </indexterm>
|
---|
| 286 | </listitem>
|
---|
| 287 | </varlistentry>
|
---|
| 288 |
|
---|
| 289 | <varlistentry id="ms_print">
|
---|
| 290 | <term><command>ms_print</command></term>
|
---|
| 291 | <listitem>
|
---|
| 292 | <para>
|
---|
| 293 | takes an output file produced by the <application>Valgrind</application>
|
---|
| 294 | tool Massif and prints the information in an easy-to-read form.
|
---|
| 295 | </para>
|
---|
| 296 | <indexterm zone="valgrind ms_print">
|
---|
| 297 | <primary sortas="b-ms_print">ms_print</primary>
|
---|
| 298 | </indexterm>
|
---|
| 299 | </listitem>
|
---|
| 300 | </varlistentry>
|
---|
| 301 |
|
---|
| 302 | <varlistentry id="valgrind-di-server">
|
---|
| 303 | <term><command>valgrind-di-server</command></term>
|
---|
| 304 | <listitem>
|
---|
| 305 | <para>
|
---|
[f3429309] | 306 | is a server that reads debuginfo from objects stored on a
|
---|
[f1607a4] | 307 | different machine.
|
---|
| 308 | </para>
|
---|
| 309 | <indexterm zone="valgrind valgrind-di-server">
|
---|
| 310 | <primary sortas="b-valgrind-di-server">valgrind-di-server</primary>
|
---|
| 311 | </indexterm>
|
---|
| 312 | </listitem>
|
---|
| 313 | </varlistentry>
|
---|
| 314 |
|
---|
| 315 | <varlistentry id="valgrind-listener">
|
---|
| 316 | <term><command>valgrind-listener</command></term>
|
---|
| 317 | <listitem>
|
---|
| 318 | <para>
|
---|
| 319 | listens on a socket for Valgrind commentary.
|
---|
| 320 | </para>
|
---|
| 321 | <indexterm zone="valgrind valgrind-listener">
|
---|
| 322 | <primary sortas="b-valgrind-listener">valgrind-listener</primary>
|
---|
| 323 | </indexterm>
|
---|
| 324 | </listitem>
|
---|
| 325 | </varlistentry>
|
---|
| 326 |
|
---|
| 327 | <varlistentry id="vgdb">
|
---|
| 328 | <term><command>vgdb</command></term>
|
---|
| 329 | <listitem>
|
---|
| 330 | <para>
|
---|
| 331 | is an intermediary between Valgrind and GDB or a shell.
|
---|
| 332 | </para>
|
---|
| 333 | <indexterm zone="valgrind vgdb">
|
---|
| 334 | <primary sortas="b-vgdb">vgdb</primary>
|
---|
| 335 | </indexterm>
|
---|
| 336 | </listitem>
|
---|
| 337 | </varlistentry>
|
---|
| 338 |
|
---|
| 339 | </variablelist>
|
---|
| 340 |
|
---|
| 341 | </sect2>
|
---|
| 342 |
|
---|
| 343 | </sect1>
|
---|