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