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