[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">
|
---|
[dc96204] | 9 | <!ENTITY valgrind-md5sum "d1b153f1ab17cf1f311705e7a83ef589">
|
---|
[50cbddce] | 10 | <!ENTITY valgrind-size "16 MB">
|
---|
| 11 | <!ENTITY valgrind-buildsize "615 MB (add 100 MB for tests)">
|
---|
[dc96204] | 12 | <!ENTITY valgrind-time "0.6 SBU (Using parallelism=4; add 7.7 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 |
|
---|
[72592375] | 40 | &lfs10_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 |
|
---|
[50cbddce] | 76 | <!-- Not needed with 3.16.0
|
---|
[a67b5f3] | 77 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 78 | <itemizedlist spacing="compact">
|
---|
| 79 | <listitem>
|
---|
| 80 | <para>
|
---|
| 81 | Required patch:
|
---|
| 82 | <ulink url="&patch-root;/valgrind-&valgrind-version;-gcc_10-fixes-1.patch"/>
|
---|
| 83 | </para>
|
---|
| 84 | </listitem>
|
---|
| 85 | </itemizedlist>
|
---|
[50cbddce] | 86 | -->
|
---|
[a67b5f3] | 87 |
|
---|
[f1607a4] | 88 | <bridgehead renderas="sect3">Valgrind Dependencies</bridgehead>
|
---|
| 89 |
|
---|
| 90 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 91 | <para role="optional">
|
---|
[72592375] | 92 | <!-- The below programs are no longer used or looked for. -->
|
---|
| 93 | <!--<xref linkend="bind"/> or <xref linkend="bind-utils"/> (for tests),
|
---|
| 94 | <xref linkend="boost"/>, -->
|
---|
[35f1730] | 95 | <xref linkend="gdb"/> (for tests),
|
---|
[ae6d3b8] | 96 | <xref linkend="llvm"/> (with Clang), and
|
---|
| 97 | <xref linkend="which"/> (for tests)
|
---|
[f1607a4] | 98 | </para>
|
---|
| 99 |
|
---|
[ae6d3b8] | 100 | <!-- See "maintainer note", below
|
---|
[f1607a4] | 101 | <bridgehead renderas="sect4">Optional for regenerating the documentation</bridgehead>
|
---|
| 102 | <para role="optional">
|
---|
[f3429309] | 103 | <xref linkend="libxslt"/> and
|
---|
[2d98031c] | 104 | <xref linkend="texlive"/> (or <xref linkend="tl-installer"/>)
|
---|
[f1607a4] | 105 | </para>
|
---|
[ae6d3b8] | 106 | -->
|
---|
[f1607a4] | 107 | <para condition="html" role="usernotes">User Notes:
|
---|
| 108 | <ulink url="&blfs-wiki;/valgrind"/>
|
---|
| 109 | </para>
|
---|
| 110 | </sect2>
|
---|
| 111 |
|
---|
| 112 | <sect2 role="installation">
|
---|
| 113 | <title>Installation of Valgrind</title>
|
---|
| 114 |
|
---|
[50cbddce] | 115 | <!-- Not needed with 3.16.0
|
---|
[a67b5f3] | 116 | <para>
|
---|
| 117 | First, adapt the tests to GCC-10, and fix the build:
|
---|
| 118 | </para>
|
---|
| 119 |
|
---|
| 120 | <screen><userinput remap="pre">patch -Np1 -i ../valgrind-&valgrind-version;-gcc_10-fixes-1.patch</userinput></screen>
|
---|
[50cbddce] | 121 | -->
|
---|
[a67b5f3] | 122 |
|
---|
[bbe0fbf] | 123 | <para>
|
---|
| 124 | Install <application>Valgrind</application> by running the following
|
---|
[1b0d0188] | 125 | commands:
|
---|
| 126 | </para>
|
---|
| 127 |
|
---|
[29dbd37] | 128 | <screen><userinput>sed -i 's|/doc/valgrind||' docs/Makefile.in &&
|
---|
[1b0d0188] | 129 |
|
---|
| 130 | ./configure --prefix=/usr \
|
---|
[f1607a4] | 131 | --datadir=/usr/share/doc/valgrind-&valgrind-version; &&
|
---|
| 132 | make</userinput></screen>
|
---|
| 133 |
|
---|
| 134 | <para>
|
---|
[bbe0fbf] | 135 | To test the results, issue: <command>make regtest</command>. The tests
|
---|
[ae6d3b8] | 136 | may hang forever if <xref linkend="gdb"/> is not installed. Some tests
|
---|
[72592375] | 137 | are known to hang also, depending on the version of glibc. Some tests
|
---|
| 138 | in the "drd" test suite are known to fail as well. Problematic
|
---|
[ae6d3b8] | 139 | tests can be disabled by changing the <userinput>prereq:</userinput> line
|
---|
[0639bb6] | 140 | in the corresponding <filename>.vgtest</filename> file to
|
---|
[ae6d3b8] | 141 | <userinput>prereq: false</userinput>. For example:
|
---|
[f1607a4] | 142 | </para>
|
---|
| 143 |
|
---|
[ae6d3b8] | 144 | <screen><userinput>sed -e 's@prereq:.*@prereq: false@' \
|
---|
| 145 | -i {helgrind,drd}/tests/pth_cond_destroy_busy.vgtest</userinput></screen>
|
---|
| 146 |
|
---|
| 147 | <note>
|
---|
| 148 | <para>
|
---|
| 149 | The <application>OpenMP</application> tests are skipped if libgomp
|
---|
| 150 | has been compiled with <option>--enable-linux-futex</option> (the
|
---|
| 151 | default). If needed, just recompile the libgomp library from
|
---|
| 152 | the gcc build tree, passing <option>--disable-linux-futex</option>
|
---|
| 153 | to configure, storing the library to some place and changing the link
|
---|
| 154 | from <filename>/usr/lib/libgomp.so.1</filename> to point to the new
|
---|
| 155 | library.
|
---|
| 156 | </para>
|
---|
| 157 | </note>
|
---|
| 158 |
|
---|
| 159 | <!-- Note to maintainer: there is a long thread in ticket #5882 explaining
|
---|
| 160 | why we do not provide instructions to rebuild the documentation.
|
---|
| 161 | (still broken with TeXLive 2016) -->
|
---|
| 162 |
|
---|
[f1607a4] | 163 | <para>
|
---|
| 164 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 165 | </para>
|
---|
| 166 |
|
---|
| 167 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
| 168 |
|
---|
| 169 | </sect2>
|
---|
| 170 |
|
---|
| 171 | <sect2 role="commands">
|
---|
| 172 | <title>Command Explanations</title>
|
---|
| 173 |
|
---|
| 174 | <para>
|
---|
[9dfdd942] | 175 | <command>sed -i ... docs/Makefile.in </command>: This sed provides for
|
---|
[f1607a4] | 176 | installing the documentation in a versioned directory.
|
---|
| 177 | </para>
|
---|
| 178 |
|
---|
[d30b7e7] | 179 | <para>
|
---|
| 180 | <option>--enable-lto=yes</option>: This option allows building Valgrind
|
---|
| 181 | with LTO (link time optimization). This produces a smaller/faster
|
---|
| 182 | Valgrind (up to 10%), but build time increases to about 5.5 SBU.
|
---|
| 183 | </para>
|
---|
| 184 |
|
---|
[f1607a4] | 185 | </sect2>
|
---|
| 186 |
|
---|
| 187 | <sect2 role="content">
|
---|
| 188 | <title>Contents</title>
|
---|
| 189 |
|
---|
| 190 | <segmentedlist>
|
---|
| 191 | <segtitle>Installed Programs</segtitle>
|
---|
| 192 | <segtitle>Installed Library</segtitle>
|
---|
| 193 | <segtitle>Installed Directories</segtitle>
|
---|
| 194 |
|
---|
| 195 | <seglistitem>
|
---|
| 196 | <seg>
|
---|
[f3429309] | 197 | callgrind_annotate,
|
---|
| 198 | callgrind_control,
|
---|
| 199 | cg_annotate,
|
---|
| 200 | cg_diff,
|
---|
| 201 | cg_merge,
|
---|
| 202 | ms_print,
|
---|
| 203 | valgrind,
|
---|
[f1607a4] | 204 | valgrind-di-server,
|
---|
[f3429309] | 205 | valgrind-listener, and
|
---|
[f1607a4] | 206 | vgdb
|
---|
| 207 | </seg>
|
---|
| 208 | <seg>
|
---|
[528bf1b] | 209 | libcoregrind-<Arch>-linux.a,
|
---|
[50cbddce] | 210 | libgcc-sup-<Arch>-linux.a,
|
---|
[528bf1b] | 211 | libreplacemalloc_toolpreload-<Arch>-linux.a,
|
---|
| 212 | libvex-<Arch>-linux.a,
|
---|
[29dbd37] | 213 | libvexmultiarch-amd64-linux.a,
|
---|
[528bf1b] | 214 | vgpreload_core-<Arch>-linux.so,
|
---|
| 215 | vgpreload_drd-<Arch>-linux.so,
|
---|
| 216 | vgpreload_exp-dhat-<Arch>-linux.so,
|
---|
| 217 | vgpreload_helgrind-<Arch>-linux.so,
|
---|
| 218 | vgpreload_massif-<Arch>-linux.so, and
|
---|
| 219 | vgpreload_memcheck-<Arch>-linux.so, where
|
---|
[29dbd37] | 220 | <Arch> is x86 or amd64
|
---|
[f1607a4] | 221 | </seg>
|
---|
| 222 | <seg>
|
---|
| 223 | /usr/lib/valgrind,
|
---|
[50cbddce] | 224 | /usr/libexec/valgrind,
|
---|
[f3429309] | 225 | /usr/include/valgrind, and
|
---|
[f1607a4] | 226 | /usr/share/doc/valgrind-&valgrind-version;
|
---|
| 227 | </seg>
|
---|
| 228 | </seglistitem>
|
---|
| 229 | </segmentedlist>
|
---|
| 230 |
|
---|
| 231 | <variablelist>
|
---|
| 232 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 233 | <?dbfo list-presentation="list"?>
|
---|
| 234 | <?dbhtml list-presentation="table"?>
|
---|
| 235 |
|
---|
| 236 | <varlistentry id="valgrind-prog">
|
---|
| 237 | <term><command>valgrind</command></term>
|
---|
| 238 | <listitem>
|
---|
| 239 | <para>
|
---|
| 240 | is a program for debugging and profiling Linux executables.
|
---|
| 241 | </para>
|
---|
| 242 | <indexterm zone="valgrind valgrind-prog">
|
---|
| 243 | <primary sortas="b-valgrind">valgrind</primary>
|
---|
| 244 | </indexterm>
|
---|
| 245 | </listitem>
|
---|
| 246 | </varlistentry>
|
---|
| 247 |
|
---|
| 248 | <varlistentry id="callgrind_annotate">
|
---|
| 249 | <term><command>callgrind_annotate</command></term>
|
---|
| 250 | <listitem>
|
---|
| 251 | <para>
|
---|
| 252 | takes an output file produced by the
|
---|
| 253 | <application>Valgrind</application> tool Callgrind and prints the
|
---|
| 254 | information in an easy-to-read form.
|
---|
| 255 | </para>
|
---|
[6076396] | 256 | <indexterm zone="valgrind callgrind_annotate">
|
---|
[f1607a4] | 257 | <primary sortas="b-callgrind_annotate">callgrind_annotate</primary>
|
---|
| 258 | </indexterm>
|
---|
| 259 | </listitem>
|
---|
| 260 | </varlistentry>
|
---|
| 261 |
|
---|
| 262 | <varlistentry id="callgrind_control">
|
---|
| 263 | <term><command>callgrind_control</command></term>
|
---|
| 264 | <listitem>
|
---|
| 265 | <para>
|
---|
[f3429309] | 266 | controls programs being run by the <application>Valgrind</application>
|
---|
[f1607a4] | 267 | tool Callgrind.
|
---|
| 268 | </para>
|
---|
| 269 | <indexterm zone="valgrind callgrind_control">
|
---|
| 270 | <primary sortas="b-callgrind_control">callgrind_control</primary>
|
---|
| 271 | </indexterm>
|
---|
| 272 | </listitem>
|
---|
| 273 | </varlistentry>
|
---|
| 274 |
|
---|
| 275 | <varlistentry id="cg_annotate">
|
---|
| 276 | <term><command>cg_annotate</command></term>
|
---|
| 277 | <listitem>
|
---|
| 278 | <para>
|
---|
[f3429309] | 279 | is a post-processing tool for the <application>Valgrind</application>
|
---|
[f1607a4] | 280 | tool Cachegrind.
|
---|
| 281 | </para>
|
---|
| 282 | <indexterm zone="valgrind cg_annotate">
|
---|
| 283 | <primary sortas="b-cg_annotate">cg_annotate</primary>
|
---|
| 284 | </indexterm>
|
---|
| 285 | </listitem>
|
---|
| 286 | </varlistentry>
|
---|
| 287 |
|
---|
| 288 | <varlistentry id="cg_diff">
|
---|
| 289 | <term><command>cg_diff</command></term>
|
---|
| 290 | <listitem>
|
---|
| 291 | <para>
|
---|
| 292 | compares two Cachegrind output files.
|
---|
| 293 | </para>
|
---|
| 294 | <indexterm zone="valgrind cg_diff">
|
---|
| 295 | <primary sortas="b-cg_diff">cg_diff</primary>
|
---|
| 296 | </indexterm>
|
---|
| 297 | </listitem>
|
---|
| 298 | </varlistentry>
|
---|
| 299 |
|
---|
| 300 | <varlistentry id="cg_merge">
|
---|
| 301 | <term><command>cg_merge</command></term>
|
---|
| 302 | <listitem>
|
---|
| 303 | <para>
|
---|
| 304 | merges multiple Cachegrind output files into one.
|
---|
| 305 | </para>
|
---|
| 306 | <indexterm zone="valgrind cg_merge">
|
---|
| 307 | <primary sortas="b-cg_merge">cg_merge</primary>
|
---|
| 308 | </indexterm>
|
---|
| 309 | </listitem>
|
---|
| 310 | </varlistentry>
|
---|
| 311 |
|
---|
| 312 | <varlistentry id="ms_print">
|
---|
| 313 | <term><command>ms_print</command></term>
|
---|
| 314 | <listitem>
|
---|
| 315 | <para>
|
---|
| 316 | takes an output file produced by the <application>Valgrind</application>
|
---|
| 317 | tool Massif and prints the information in an easy-to-read form.
|
---|
| 318 | </para>
|
---|
| 319 | <indexterm zone="valgrind ms_print">
|
---|
| 320 | <primary sortas="b-ms_print">ms_print</primary>
|
---|
| 321 | </indexterm>
|
---|
| 322 | </listitem>
|
---|
| 323 | </varlistentry>
|
---|
| 324 |
|
---|
| 325 | <varlistentry id="valgrind-di-server">
|
---|
| 326 | <term><command>valgrind-di-server</command></term>
|
---|
| 327 | <listitem>
|
---|
| 328 | <para>
|
---|
[f3429309] | 329 | is a server that reads debuginfo from objects stored on a
|
---|
[f1607a4] | 330 | different machine.
|
---|
| 331 | </para>
|
---|
| 332 | <indexterm zone="valgrind valgrind-di-server">
|
---|
| 333 | <primary sortas="b-valgrind-di-server">valgrind-di-server</primary>
|
---|
| 334 | </indexterm>
|
---|
| 335 | </listitem>
|
---|
| 336 | </varlistentry>
|
---|
| 337 |
|
---|
| 338 | <varlistentry id="valgrind-listener">
|
---|
| 339 | <term><command>valgrind-listener</command></term>
|
---|
| 340 | <listitem>
|
---|
| 341 | <para>
|
---|
| 342 | listens on a socket for Valgrind commentary.
|
---|
| 343 | </para>
|
---|
| 344 | <indexterm zone="valgrind valgrind-listener">
|
---|
| 345 | <primary sortas="b-valgrind-listener">valgrind-listener</primary>
|
---|
| 346 | </indexterm>
|
---|
| 347 | </listitem>
|
---|
| 348 | </varlistentry>
|
---|
| 349 |
|
---|
| 350 | <varlistentry id="vgdb">
|
---|
| 351 | <term><command>vgdb</command></term>
|
---|
| 352 | <listitem>
|
---|
| 353 | <para>
|
---|
| 354 | is an intermediary between Valgrind and GDB or a shell.
|
---|
| 355 | </para>
|
---|
| 356 | <indexterm zone="valgrind vgdb">
|
---|
| 357 | <primary sortas="b-vgdb">vgdb</primary>
|
---|
| 358 | </indexterm>
|
---|
| 359 | </listitem>
|
---|
| 360 | </varlistentry>
|
---|
| 361 |
|
---|
| 362 | </variablelist>
|
---|
| 363 |
|
---|
| 364 | </sect2>
|
---|
| 365 |
|
---|
| 366 | </sect1>
|
---|