[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 |
|
---|
[ec67287] | 7 | <!ENTITY valgrind-download-http " ">
|
---|
| 8 | <!ENTITY valgrind-download-ftp "ftp://sourceware.org/pub/valgrind/valgrind-&valgrind-version;.tar.bz2">
|
---|
| 9 | <!ENTITY valgrind-md5sum "817dd08f1e8a66336b9ff206400a5369">
|
---|
| 10 | <!ENTITY valgrind-size "14 MB">
|
---|
| 11 | <!ENTITY valgrind-buildsize "347 MB (additional 228 MB for tests)">
|
---|
| 12 | <!ENTITY valgrind-time "1.1 SBU (additional 5.1 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 |
|
---|
[7fd2c27] | 40 | &lfs80_checked;
|
---|
[ec67287] | 41 | &gcc7_checked;
|
---|
[f1607a4] | 42 |
|
---|
| 43 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 44 | <itemizedlist spacing="compact">
|
---|
| 45 | <listitem>
|
---|
| 46 | <para>
|
---|
| 47 | Download (HTTP): <ulink url="&valgrind-download-http;"/>
|
---|
| 48 | </para>
|
---|
| 49 | </listitem>
|
---|
| 50 | <listitem>
|
---|
| 51 | <para>
|
---|
| 52 | Download (FTP): <ulink url="&valgrind-download-ftp;"/>
|
---|
| 53 | </para>
|
---|
| 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
| 56 | <para>
|
---|
| 57 | Download MD5 sum: &valgrind-md5sum;
|
---|
| 58 | </para>
|
---|
| 59 | </listitem>
|
---|
| 60 | <listitem>
|
---|
| 61 | <para>
|
---|
| 62 | Download size: &valgrind-size;
|
---|
| 63 | </para>
|
---|
| 64 | </listitem>
|
---|
| 65 | <listitem>
|
---|
| 66 | <para>
|
---|
| 67 | Estimated disk space required: &valgrind-buildsize;
|
---|
| 68 | </para>
|
---|
| 69 | </listitem>
|
---|
| 70 | <listitem>
|
---|
| 71 | <para>
|
---|
| 72 | Estimated build time: &valgrind-time;
|
---|
| 73 | </para>
|
---|
| 74 | </listitem>
|
---|
| 75 | </itemizedlist>
|
---|
| 76 |
|
---|
| 77 | <bridgehead renderas="sect3">Valgrind Dependencies</bridgehead>
|
---|
| 78 |
|
---|
| 79 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 80 | <para role="optional">
|
---|
[ae6d3b8] | 81 | <xref linkend="bind"/> or <xref linkend="bind-utils"/> (for tests),
|
---|
[f1607a4] | 82 | <xref linkend="boost"/>,
|
---|
[35f1730] | 83 | <xref linkend="gdb"/> (for tests),
|
---|
[ae6d3b8] | 84 | <xref linkend="llvm"/> (with Clang), and
|
---|
| 85 | <xref linkend="which"/> (for tests)
|
---|
[f1607a4] | 86 | </para>
|
---|
| 87 |
|
---|
[ae6d3b8] | 88 | <!-- See "maintainer note", below
|
---|
[f1607a4] | 89 | <bridgehead renderas="sect4">Optional for regenerating the documentation</bridgehead>
|
---|
| 90 | <para role="optional">
|
---|
[f3429309] | 91 | <xref linkend="libxslt"/> and
|
---|
[2d98031c] | 92 | <xref linkend="texlive"/> (or <xref linkend="tl-installer"/>)
|
---|
[f1607a4] | 93 | </para>
|
---|
[ae6d3b8] | 94 | -->
|
---|
[f1607a4] | 95 | <para condition="html" role="usernotes">User Notes:
|
---|
| 96 | <ulink url="&blfs-wiki;/valgrind"/>
|
---|
| 97 | </para>
|
---|
| 98 | </sect2>
|
---|
| 99 |
|
---|
| 100 | <sect2 role="installation">
|
---|
| 101 | <title>Installation of Valgrind</title>
|
---|
| 102 |
|
---|
[bbe0fbf] | 103 | <para>
|
---|
| 104 | Install <application>Valgrind</application> by running the following
|
---|
[1b0d0188] | 105 | commands:
|
---|
| 106 | </para>
|
---|
| 107 |
|
---|
[29dbd37] | 108 | <screen><userinput>sed -i 's|/doc/valgrind||' docs/Makefile.in &&
|
---|
[1b0d0188] | 109 |
|
---|
| 110 | ./configure --prefix=/usr \
|
---|
[f1607a4] | 111 | --datadir=/usr/share/doc/valgrind-&valgrind-version; &&
|
---|
| 112 | make</userinput></screen>
|
---|
| 113 |
|
---|
[0990e658] | 114 | <note>
|
---|
| 115 | <para>
|
---|
| 116 | To run the tests for this package, valgrind requires a version of the
|
---|
| 117 | /lib/ld-2.24.so (or later) library with debugging symbols present.
|
---|
| 118 | Normally in LFS these debugging symbols are stripped at the end of
|
---|
| 119 | Chapter 6. To get this library, glibc must be rebuilt with the current
|
---|
| 120 | glibc version using the same compiler that was used to build LFS. The
|
---|
| 121 | ld.so can then be renamed to ld-2.24.so.dbg and copied to /lib.
|
---|
| 122 | Then a symlink needs to be changed:</para>
|
---|
| 123 |
|
---|
[294664ef] | 124 | <screen role="nodump"><userinput>ln -sfv ld-2.24.so.dbg /lib/ld-linux-x86-64.so.2</userinput></screen>
|
---|
[0990e658] | 125 |
|
---|
| 126 | <para>
|
---|
| 127 | Adjust the above instruction as needed for a 32-bit system or for a
|
---|
| 128 | different version of glibc.
|
---|
| 129 | </para>
|
---|
| 130 |
|
---|
| 131 | <para>
|
---|
| 132 | In addition, other glibc libraries with debugging symbols present
|
---|
| 133 | may be needed for some tests.
|
---|
| 134 | </para>
|
---|
| 135 | </note>
|
---|
| 136 |
|
---|
[f1607a4] | 137 | <para>
|
---|
[bbe0fbf] | 138 | To test the results, issue: <command>make regtest</command>. The tests
|
---|
[ae6d3b8] | 139 | may hang forever if <xref linkend="gdb"/> is not installed. Some tests
|
---|
| 140 | are known to hang also, depending on the version of glibc. Problematic
|
---|
| 141 | tests can be disabled by changing the <userinput>prereq:</userinput> line
|
---|
[0639bb6] | 142 | in the corresponding <filename>.vgtest</filename> file to
|
---|
[ae6d3b8] | 143 | <userinput>prereq: false</userinput>. For example:
|
---|
[f1607a4] | 144 | </para>
|
---|
| 145 |
|
---|
[ae6d3b8] | 146 | <!-- For valgrind-3.12.0, the pth_cond_destroy_busy test hangs forever because
|
---|
| 147 | of some change in glibc-2.25. Should be fixed in next versions of
|
---|
| 148 | valgrind.-->
|
---|
| 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 |
|
---|
| 184 | </sect2>
|
---|
| 185 |
|
---|
| 186 | <sect2 role="content">
|
---|
| 187 | <title>Contents</title>
|
---|
| 188 |
|
---|
| 189 | <segmentedlist>
|
---|
| 190 | <segtitle>Installed Programs</segtitle>
|
---|
| 191 | <segtitle>Installed Library</segtitle>
|
---|
| 192 | <segtitle>Installed Directories</segtitle>
|
---|
| 193 |
|
---|
| 194 | <seglistitem>
|
---|
| 195 | <seg>
|
---|
[f3429309] | 196 | callgrind_annotate,
|
---|
| 197 | callgrind_control,
|
---|
| 198 | cg_annotate,
|
---|
| 199 | cg_diff,
|
---|
| 200 | cg_merge,
|
---|
| 201 | ms_print,
|
---|
| 202 | valgrind,
|
---|
[f1607a4] | 203 | valgrind-di-server,
|
---|
[f3429309] | 204 | valgrind-listener, and
|
---|
[f1607a4] | 205 | vgdb
|
---|
| 206 | </seg>
|
---|
| 207 | <seg>
|
---|
[528bf1b] | 208 | libcoregrind-<Arch>-linux.a,
|
---|
| 209 | libreplacemalloc_toolpreload-<Arch>-linux.a,
|
---|
| 210 | libvex-<Arch>-linux.a,
|
---|
[29dbd37] | 211 | libvexmultiarch-amd64-linux.a,
|
---|
[528bf1b] | 212 | vgpreload_core-<Arch>-linux.so,
|
---|
| 213 | vgpreload_drd-<Arch>-linux.so,
|
---|
| 214 | vgpreload_exp-dhat-<Arch>-linux.so,
|
---|
| 215 | vgpreload_exp-sgcheck-<Arch>-linux.so,
|
---|
| 216 | vgpreload_helgrind-<Arch>-linux.so,
|
---|
| 217 | vgpreload_massif-<Arch>-linux.so, and
|
---|
| 218 | vgpreload_memcheck-<Arch>-linux.so, where
|
---|
[29dbd37] | 219 | <Arch> is x86 or amd64
|
---|
[f1607a4] | 220 | </seg>
|
---|
| 221 | <seg>
|
---|
| 222 | /usr/lib/valgrind,
|
---|
[f3429309] | 223 | /usr/include/valgrind, and
|
---|
[f1607a4] | 224 | /usr/share/doc/valgrind-&valgrind-version;
|
---|
| 225 | </seg>
|
---|
| 226 | </seglistitem>
|
---|
| 227 | </segmentedlist>
|
---|
| 228 |
|
---|
| 229 | <variablelist>
|
---|
| 230 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 231 | <?dbfo list-presentation="list"?>
|
---|
| 232 | <?dbhtml list-presentation="table"?>
|
---|
| 233 |
|
---|
| 234 | <varlistentry id="valgrind-prog">
|
---|
| 235 | <term><command>valgrind</command></term>
|
---|
| 236 | <listitem>
|
---|
| 237 | <para>
|
---|
| 238 | is a program for debugging and profiling Linux executables.
|
---|
| 239 | </para>
|
---|
| 240 | <indexterm zone="valgrind valgrind-prog">
|
---|
| 241 | <primary sortas="b-valgrind">valgrind</primary>
|
---|
| 242 | </indexterm>
|
---|
| 243 | </listitem>
|
---|
| 244 | </varlistentry>
|
---|
| 245 |
|
---|
| 246 | <varlistentry id="callgrind_annotate">
|
---|
| 247 | <term><command>callgrind_annotate</command></term>
|
---|
| 248 | <listitem>
|
---|
| 249 | <para>
|
---|
| 250 | takes an output file produced by the
|
---|
| 251 | <application>Valgrind</application> tool Callgrind and prints the
|
---|
| 252 | information in an easy-to-read form.
|
---|
| 253 | </para>
|
---|
| 254 | <indexterm zone="callgrind_annotate">
|
---|
| 255 | <primary sortas="b-callgrind_annotate">callgrind_annotate</primary>
|
---|
| 256 | </indexterm>
|
---|
| 257 | </listitem>
|
---|
| 258 | </varlistentry>
|
---|
| 259 |
|
---|
| 260 | <varlistentry id="callgrind_control">
|
---|
| 261 | <term><command>callgrind_control</command></term>
|
---|
| 262 | <listitem>
|
---|
| 263 | <para>
|
---|
[f3429309] | 264 | controls programs being run by the <application>Valgrind</application>
|
---|
[f1607a4] | 265 | tool Callgrind.
|
---|
| 266 | </para>
|
---|
| 267 | <indexterm zone="valgrind callgrind_control">
|
---|
| 268 | <primary sortas="b-callgrind_control">callgrind_control</primary>
|
---|
| 269 | </indexterm>
|
---|
| 270 | </listitem>
|
---|
| 271 | </varlistentry>
|
---|
| 272 |
|
---|
| 273 | <varlistentry id="cg_annotate">
|
---|
| 274 | <term><command>cg_annotate</command></term>
|
---|
| 275 | <listitem>
|
---|
| 276 | <para>
|
---|
[f3429309] | 277 | is a post-processing tool for the <application>Valgrind</application>
|
---|
[f1607a4] | 278 | tool Cachegrind.
|
---|
| 279 | </para>
|
---|
| 280 | <indexterm zone="valgrind cg_annotate">
|
---|
| 281 | <primary sortas="b-cg_annotate">cg_annotate</primary>
|
---|
| 282 | </indexterm>
|
---|
| 283 | </listitem>
|
---|
| 284 | </varlistentry>
|
---|
| 285 |
|
---|
| 286 | <varlistentry id="cg_diff">
|
---|
| 287 | <term><command>cg_diff</command></term>
|
---|
| 288 | <listitem>
|
---|
| 289 | <para>
|
---|
| 290 | compares two Cachegrind output files.
|
---|
| 291 | </para>
|
---|
| 292 | <indexterm zone="valgrind cg_diff">
|
---|
| 293 | <primary sortas="b-cg_diff">cg_diff</primary>
|
---|
| 294 | </indexterm>
|
---|
| 295 | </listitem>
|
---|
| 296 | </varlistentry>
|
---|
| 297 |
|
---|
| 298 | <varlistentry id="cg_merge">
|
---|
| 299 | <term><command>cg_merge</command></term>
|
---|
| 300 | <listitem>
|
---|
| 301 | <para>
|
---|
| 302 | merges multiple Cachegrind output files into one.
|
---|
| 303 | </para>
|
---|
| 304 | <indexterm zone="valgrind cg_merge">
|
---|
| 305 | <primary sortas="b-cg_merge">cg_merge</primary>
|
---|
| 306 | </indexterm>
|
---|
| 307 | </listitem>
|
---|
| 308 | </varlistentry>
|
---|
| 309 |
|
---|
| 310 | <varlistentry id="ms_print">
|
---|
| 311 | <term><command>ms_print</command></term>
|
---|
| 312 | <listitem>
|
---|
| 313 | <para>
|
---|
| 314 | takes an output file produced by the <application>Valgrind</application>
|
---|
| 315 | tool Massif and prints the information in an easy-to-read form.
|
---|
| 316 | </para>
|
---|
| 317 | <indexterm zone="valgrind ms_print">
|
---|
| 318 | <primary sortas="b-ms_print">ms_print</primary>
|
---|
| 319 | </indexterm>
|
---|
| 320 | </listitem>
|
---|
| 321 | </varlistentry>
|
---|
| 322 |
|
---|
| 323 | <varlistentry id="valgrind-di-server">
|
---|
| 324 | <term><command>valgrind-di-server</command></term>
|
---|
| 325 | <listitem>
|
---|
| 326 | <para>
|
---|
[f3429309] | 327 | is a server that reads debuginfo from objects stored on a
|
---|
[f1607a4] | 328 | different machine.
|
---|
| 329 | </para>
|
---|
| 330 | <indexterm zone="valgrind valgrind-di-server">
|
---|
| 331 | <primary sortas="b-valgrind-di-server">valgrind-di-server</primary>
|
---|
| 332 | </indexterm>
|
---|
| 333 | </listitem>
|
---|
| 334 | </varlistentry>
|
---|
| 335 |
|
---|
| 336 | <varlistentry id="valgrind-listener">
|
---|
| 337 | <term><command>valgrind-listener</command></term>
|
---|
| 338 | <listitem>
|
---|
| 339 | <para>
|
---|
| 340 | listens on a socket for Valgrind commentary.
|
---|
| 341 | </para>
|
---|
| 342 | <indexterm zone="valgrind valgrind-listener">
|
---|
| 343 | <primary sortas="b-valgrind-listener">valgrind-listener</primary>
|
---|
| 344 | </indexterm>
|
---|
| 345 | </listitem>
|
---|
| 346 | </varlistentry>
|
---|
| 347 |
|
---|
| 348 | <varlistentry id="vgdb">
|
---|
| 349 | <term><command>vgdb</command></term>
|
---|
| 350 | <listitem>
|
---|
| 351 | <para>
|
---|
| 352 | is an intermediary between Valgrind and GDB or a shell.
|
---|
| 353 | </para>
|
---|
| 354 | <indexterm zone="valgrind vgdb">
|
---|
| 355 | <primary sortas="b-vgdb">vgdb</primary>
|
---|
| 356 | </indexterm>
|
---|
| 357 | </listitem>
|
---|
| 358 | </varlistentry>
|
---|
| 359 |
|
---|
| 360 | </variablelist>
|
---|
| 361 |
|
---|
| 362 | </sect2>
|
---|
| 363 |
|
---|
| 364 | </sect1>
|
---|