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 |
|
---|
7 | <!ENTITY valgrind-download-http "https://sourceware.org/ftp/valgrind/valgrind-&valgrind-version;.tar.bz2">
|
---|
8 | <!ENTITY valgrind-download-ftp "ftp://sourceware.org/pub/valgrind/valgrind-&valgrind-version;.tar.bz2">
|
---|
9 | <!ENTITY valgrind-md5sum "afe11b5572c3121a781433b7c0ab741b">
|
---|
10 | <!ENTITY valgrind-size "16 MB">
|
---|
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)">
|
---|
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
|
---|
36 | tools.
|
---|
37 | </para>
|
---|
38 |
|
---|
39 | &lfs110a_checked;
|
---|
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 |
|
---|
75 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
76 | <itemizedlist spacing="compact">
|
---|
77 | <listitem>
|
---|
78 | <para>
|
---|
79 | Required patch:
|
---|
80 | <ulink url="&patch-root;/valgrind-&valgrind-version;-upstream_fixes-1.patch"/>
|
---|
81 | </para>
|
---|
82 | </listitem>
|
---|
83 | </itemizedlist>
|
---|
84 |
|
---|
85 | <bridgehead renderas="sect3">Valgrind Dependencies</bridgehead>
|
---|
86 |
|
---|
87 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
88 | <para role="optional">
|
---|
89 | <!-- The below programs are no longer used or looked for. -->
|
---|
90 | <!--<xref linkend="bind"/> or <xref linkend="bind-utils"/> (for tests),
|
---|
91 | <xref linkend="boost"/>, -->
|
---|
92 | <xref linkend="gdb"/> (for tests),
|
---|
93 | <xref linkend="llvm"/> (with Clang), and
|
---|
94 | <xref linkend="which"/> (for tests)
|
---|
95 | </para>
|
---|
96 |
|
---|
97 | <!-- See "maintainer note", below
|
---|
98 | <bridgehead renderas="sect4">Optional for regenerating the documentation</bridgehead>
|
---|
99 | <para role="optional">
|
---|
100 | <xref linkend="libxslt"/> and
|
---|
101 | <xref linkend="texlive"/> (or <xref linkend="tl-installer"/>)
|
---|
102 | </para>
|
---|
103 | -->
|
---|
104 | <para condition="html" role="usernotes">User Notes:
|
---|
105 | <ulink url="&blfs-wiki;/valgrind"/>
|
---|
106 | </para>
|
---|
107 | </sect2>
|
---|
108 |
|
---|
109 | <sect2 role="installation">
|
---|
110 | <title>Installation of Valgrind</title>
|
---|
111 |
|
---|
112 | <para>
|
---|
113 | First, make several changes that are required for Valgrind to function on
|
---|
114 | systems with glibc-2.34 installed:
|
---|
115 | </para>
|
---|
116 |
|
---|
117 | <screen><userinput remap="pre">patch -Np1 -i ../valgrind-&valgrind-version;-upstream_fixes-1.patch</userinput></screen>
|
---|
118 |
|
---|
119 | <!-- Not needed with 3.17.0
|
---|
120 | <para>
|
---|
121 | First, adapt the tests to glibc-2.33:
|
---|
122 | </para>
|
---|
123 |
|
---|
124 | <screen><userinput remap="pre">sed -i 's/arm64/amd64/' gdbserver_tests/nlcontrolc.vgtest</userinput></screen>
|
---|
125 | -->
|
---|
126 |
|
---|
127 | <para>
|
---|
128 | Install <application>Valgrind</application> by running the following
|
---|
129 | commands:
|
---|
130 | </para>
|
---|
131 |
|
---|
132 | <screen><userinput>autoreconf -fiv &&
|
---|
133 | sed -i 's|/doc/valgrind||' docs/Makefile.in &&
|
---|
134 |
|
---|
135 | ./configure --prefix=/usr \
|
---|
136 | --datadir=/usr/share/doc/valgrind-&valgrind-version; &&
|
---|
137 | make</userinput></screen>
|
---|
138 |
|
---|
139 | <para>
|
---|
140 | To test the results, issue: <command>make regtest</command>. The tests
|
---|
141 | may hang forever if <xref linkend="gdb"/> is not installed. Some tests
|
---|
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
|
---|
144 | tests can be disabled by changing the <userinput>prereq:</userinput> line
|
---|
145 | in the corresponding <filename>.vgtest</filename> file to
|
---|
146 | <userinput>prereq: false</userinput>. For example:
|
---|
147 | </para>
|
---|
148 |
|
---|
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 |
|
---|
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>
|
---|
180 | <command>sed -i ... docs/Makefile.in </command>: This sed provides for
|
---|
181 | installing the documentation in a versioned directory.
|
---|
182 | </para>
|
---|
183 |
|
---|
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 |
|
---|
190 | </sect2>
|
---|
191 |
|
---|
192 | <sect2 role="content">
|
---|
193 | <title>Contents</title>
|
---|
194 |
|
---|
195 | <segmentedlist>
|
---|
196 | <segtitle>Installed Programs</segtitle>
|
---|
197 | <segtitle>Installed Libraries</segtitle>
|
---|
198 | <segtitle>Installed Directories</segtitle>
|
---|
199 |
|
---|
200 | <seglistitem>
|
---|
201 | <seg>
|
---|
202 | callgrind_annotate,
|
---|
203 | callgrind_control,
|
---|
204 | cg_annotate,
|
---|
205 | cg_diff,
|
---|
206 | cg_merge,
|
---|
207 | ms_print,
|
---|
208 | valgrind,
|
---|
209 | valgrind-di-server,
|
---|
210 | valgrind-listener, and
|
---|
211 | vgdb
|
---|
212 | </seg>
|
---|
213 | <seg>
|
---|
214 | <!-- Moved to /usr/lib/valgrind in 3.17.0
|
---|
215 | libcoregrind-<Arch>-linux.a,
|
---|
216 | libgcc-sup-<Arch>-linux.a,
|
---|
217 | libreplacemalloc_toolpreload-<Arch>-linux.a,
|
---|
218 | libvex-<Arch>-linux.a,
|
---|
219 | libvexmultiarch-amd64-linux.a,
|
---|
220 | vgpreload_core-<Arch>-linux.so,
|
---|
221 | vgpreload_drd-<Arch>-linux.so,
|
---|
222 | vgpreload_exp-dhat-<Arch>-linux.so,
|
---|
223 | vgpreload_helgrind-<Arch>-linux.so,
|
---|
224 | vgpreload_massif-<Arch>-linux.so, and
|
---|
225 | vgpreload_memcheck-<Arch>-linux.so, where
|
---|
226 | <Arch> is x86 or amd64
|
---|
227 | -->
|
---|
228 | None
|
---|
229 | </seg>
|
---|
230 | <seg>
|
---|
231 | /usr/lib/valgrind,
|
---|
232 | /usr/libexec/valgrind,
|
---|
233 | /usr/include/valgrind, and
|
---|
234 | /usr/share/doc/valgrind-&valgrind-version;
|
---|
235 | </seg>
|
---|
236 | </seglistitem>
|
---|
237 | </segmentedlist>
|
---|
238 |
|
---|
239 | <variablelist>
|
---|
240 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
241 | <?dbfo list-presentation="list"?>
|
---|
242 | <?dbhtml list-presentation="table"?>
|
---|
243 |
|
---|
244 | <varlistentry id="valgrind-prog">
|
---|
245 | <term><command>valgrind</command></term>
|
---|
246 | <listitem>
|
---|
247 | <para>
|
---|
248 | is a program for debugging and profiling Linux executables
|
---|
249 | </para>
|
---|
250 | <indexterm zone="valgrind valgrind-prog">
|
---|
251 | <primary sortas="b-valgrind">valgrind</primary>
|
---|
252 | </indexterm>
|
---|
253 | </listitem>
|
---|
254 | </varlistentry>
|
---|
255 |
|
---|
256 | <varlistentry id="callgrind_annotate">
|
---|
257 | <term><command>callgrind_annotate</command></term>
|
---|
258 | <listitem>
|
---|
259 | <para>
|
---|
260 | takes an output file produced by the
|
---|
261 | <application>Valgrind</application> tool Callgrind and prints the
|
---|
262 | information in an easy-to-read form
|
---|
263 | </para>
|
---|
264 | <indexterm zone="valgrind callgrind_annotate">
|
---|
265 | <primary sortas="b-callgrind_annotate">callgrind_annotate</primary>
|
---|
266 | </indexterm>
|
---|
267 | </listitem>
|
---|
268 | </varlistentry>
|
---|
269 |
|
---|
270 | <varlistentry id="callgrind_control">
|
---|
271 | <term><command>callgrind_control</command></term>
|
---|
272 | <listitem>
|
---|
273 | <para>
|
---|
274 | controls programs being run by the <application>Valgrind</application>
|
---|
275 | tool Callgrind
|
---|
276 | </para>
|
---|
277 | <indexterm zone="valgrind callgrind_control">
|
---|
278 | <primary sortas="b-callgrind_control">callgrind_control</primary>
|
---|
279 | </indexterm>
|
---|
280 | </listitem>
|
---|
281 | </varlistentry>
|
---|
282 |
|
---|
283 | <varlistentry id="cg_annotate">
|
---|
284 | <term><command>cg_annotate</command></term>
|
---|
285 | <listitem>
|
---|
286 | <para>
|
---|
287 | is a post-processing tool for the <application>Valgrind</application>
|
---|
288 | tool Cachegrind
|
---|
289 | </para>
|
---|
290 | <indexterm zone="valgrind cg_annotate">
|
---|
291 | <primary sortas="b-cg_annotate">cg_annotate</primary>
|
---|
292 | </indexterm>
|
---|
293 | </listitem>
|
---|
294 | </varlistentry>
|
---|
295 |
|
---|
296 | <varlistentry id="cg_diff">
|
---|
297 | <term><command>cg_diff</command></term>
|
---|
298 | <listitem>
|
---|
299 | <para>
|
---|
300 | compares two Cachegrind output files
|
---|
301 | </para>
|
---|
302 | <indexterm zone="valgrind cg_diff">
|
---|
303 | <primary sortas="b-cg_diff">cg_diff</primary>
|
---|
304 | </indexterm>
|
---|
305 | </listitem>
|
---|
306 | </varlistentry>
|
---|
307 |
|
---|
308 | <varlistentry id="cg_merge">
|
---|
309 | <term><command>cg_merge</command></term>
|
---|
310 | <listitem>
|
---|
311 | <para>
|
---|
312 | merges multiple Cachegrind output files into one
|
---|
313 | </para>
|
---|
314 | <indexterm zone="valgrind cg_merge">
|
---|
315 | <primary sortas="b-cg_merge">cg_merge</primary>
|
---|
316 | </indexterm>
|
---|
317 | </listitem>
|
---|
318 | </varlistentry>
|
---|
319 |
|
---|
320 | <varlistentry id="ms_print">
|
---|
321 | <term><command>ms_print</command></term>
|
---|
322 | <listitem>
|
---|
323 | <para>
|
---|
324 | takes an output file produced by the <application>Valgrind</application>
|
---|
325 | tool Massif and prints the information in an easy-to-read form
|
---|
326 | </para>
|
---|
327 | <indexterm zone="valgrind ms_print">
|
---|
328 | <primary sortas="b-ms_print">ms_print</primary>
|
---|
329 | </indexterm>
|
---|
330 | </listitem>
|
---|
331 | </varlistentry>
|
---|
332 |
|
---|
333 | <varlistentry id="valgrind-di-server">
|
---|
334 | <term><command>valgrind-di-server</command></term>
|
---|
335 | <listitem>
|
---|
336 | <para>
|
---|
337 | is a server that reads debuginfo from objects stored on a
|
---|
338 | different machine
|
---|
339 | </para>
|
---|
340 | <indexterm zone="valgrind valgrind-di-server">
|
---|
341 | <primary sortas="b-valgrind-di-server">valgrind-di-server</primary>
|
---|
342 | </indexterm>
|
---|
343 | </listitem>
|
---|
344 | </varlistentry>
|
---|
345 |
|
---|
346 | <varlistentry id="valgrind-listener">
|
---|
347 | <term><command>valgrind-listener</command></term>
|
---|
348 | <listitem>
|
---|
349 | <para>
|
---|
350 | listens on a socket for Valgrind commentary
|
---|
351 | </para>
|
---|
352 | <indexterm zone="valgrind valgrind-listener">
|
---|
353 | <primary sortas="b-valgrind-listener">valgrind-listener</primary>
|
---|
354 | </indexterm>
|
---|
355 | </listitem>
|
---|
356 | </varlistentry>
|
---|
357 |
|
---|
358 | <varlistentry id="vgdb">
|
---|
359 | <term><command>vgdb</command></term>
|
---|
360 | <listitem>
|
---|
361 | <para>
|
---|
362 | is an intermediary between Valgrind and GDB or a shell
|
---|
363 | </para>
|
---|
364 | <indexterm zone="valgrind vgdb">
|
---|
365 | <primary sortas="b-vgdb">vgdb</primary>
|
---|
366 | </indexterm>
|
---|
367 | </listitem>
|
---|
368 | </varlistentry>
|
---|
369 |
|
---|
370 | </variablelist>
|
---|
371 |
|
---|
372 | </sect2>
|
---|
373 |
|
---|
374 | </sect1>
|
---|