blob: e98c777679604b562add8076b7b7d77bd3739b9d [file] [log] [blame]
Elliott Hughesa0664b92017-04-18 17:46:52 -07001<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
4<title>1. Introduction</title>
5<link rel="stylesheet" type="text/css" href="vg_basic.css">
Elliott Hughesed398002017-06-21 14:41:24 -07006<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
Elliott Hughesa0664b92017-04-18 17:46:52 -07007<link rel="home" href="index.html" title="Valgrind Documentation">
8<link rel="up" href="manual.html" title="Valgrind User Manual">
9<link rel="prev" href="manual.html" title="Valgrind User Manual">
10<link rel="next" href="manual-core.html" title="2. Using and understanding the Valgrind core">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<div><table class="nav" width="100%" cellspacing="3" cellpadding="3" border="0" summary="Navigation header"><tr>
14<td width="22px" align="center" valign="middle"><a accesskey="p" href="manual.html"><img src="images/prev.png" width="18" height="21" border="0" alt="Prev"></a></td>
15<td width="25px" align="center" valign="middle"><a accesskey="u" href="manual.html"><img src="images/up.png" width="21" height="18" border="0" alt="Up"></a></td>
16<td width="31px" align="center" valign="middle"><a accesskey="h" href="index.html"><img src="images/home.png" width="27" height="20" border="0" alt="Up"></a></td>
17<th align="center" valign="middle">Valgrind User Manual</th>
18<td width="22px" align="center" valign="middle"><a accesskey="n" href="manual-core.html"><img src="images/next.png" width="18" height="21" border="0" alt="Next"></a></td>
19</tr></table></div>
20<div class="chapter">
21<div class="titlepage"><div><div><h1 class="title">
22<a name="manual-intro"></a>1. Introduction</h1></div></div></div>
23<div class="toc">
24<p><b>Table of Contents</b></p>
25<dl class="toc">
26<dt><span class="sect1"><a href="manual-intro.html#manual-intro.overview">1.1. An Overview of Valgrind</a></span></dt>
27<dt><span class="sect1"><a href="manual-intro.html#manual-intro.navigation">1.2. How to navigate this manual</a></span></dt>
28</dl>
29</div>
30<div class="sect1">
31<div class="titlepage"><div><div><h2 class="title" style="clear: both">
32<a name="manual-intro.overview"></a>1.1. An Overview of Valgrind</h2></div></div></div>
33<p>Valgrind is an instrumentation framework for building dynamic analysis
34tools. It comes with a set of tools each of which performs some kind of
35debugging, profiling, or similar task that helps you improve your programs.
36Valgrind's architecture is modular, so new tools can be created easily
37and without disturbing the existing structure.</p>
38<p>A number of useful tools are supplied as standard.</p>
39<div class="orderedlist"><ol class="orderedlist" type="1">
40<li class="listitem"><p><span class="command"><strong>Memcheck</strong></span> is a memory error detector. It helps
41 you make your programs, particularly those written in C and C++, more
42 correct.</p></li>
43<li class="listitem"><p><span class="command"><strong>Cachegrind</strong></span> is a cache and branch-prediction
44 profiler. It helps you make your programs run faster.</p></li>
45<li class="listitem"><p><span class="command"><strong>Callgrind</strong></span> is a call-graph generating cache
46 profiler. It has some overlap with Cachegrind, but also gathers some
47 information that Cachegrind does not.</p></li>
48<li class="listitem"><p><span class="command"><strong>Helgrind</strong></span> is a thread error detector.
49 It helps you make your multi-threaded programs more correct.
50 </p></li>
51<li class="listitem"><p><span class="command"><strong>DRD</strong></span> is also a thread error detector. It is
52 similar to Helgrind but uses different analysis techniques and so may
53 find different problems.</p></li>
54<li class="listitem"><p><span class="command"><strong>Massif</strong></span> is a heap profiler. It helps you
55 make your programs use less memory.</p></li>
56<li class="listitem"><p><span class="command"><strong>DHAT</strong></span> is a different kind of heap
57 profiler. It helps you understand issues of block lifetimes,
58 block utilisation, and layout inefficiencies.</p></li>
59<li class="listitem"><p><span class="command"><strong>SGcheck</strong></span> is an experimental tool that can
60 detect overruns of stack and global arrays. Its functionality is
61 complementary to that of Memcheck: SGcheck finds problems that
62 Memcheck can't, and vice versa..</p></li>
63<li class="listitem"><p><span class="command"><strong>BBV</strong></span> is an experimental SimPoint basic block
64 vector generator. It is useful to people doing computer architecture
65 research and development.</p></li>
66</ol></div>
67<p>There are also a couple of minor tools that aren't useful to
68most users: <span class="command"><strong>Lackey</strong></span> is an example tool that illustrates
69some instrumentation basics; and <span class="command"><strong>Nulgrind</strong></span> is the minimal
70Valgrind tool that does no analysis or instrumentation, and is only useful
71for testing purposes.</p>
72<p>Valgrind is closely tied to details of the CPU and operating
73system, and to a lesser extent, the compiler and basic C libraries.
74Nonetheless, it supports a number of widely-used platforms, listed in full
75at <a class="ulink" href="http://www.valgrind.org/" target="_top">http://www.valgrind.org/</a>.</p>
76<p>Valgrind is built via the standard Unix
77<code class="computeroutput">./configure</code>,
78<code class="computeroutput">make</code>, <code class="computeroutput">make
79install</code> process; full details are given in the
80README file in the distribution.</p>
81<p>Valgrind is licensed under the <a class="xref" href="license.gpl.html" title="1. The GNU General Public License"> The GNU General Public License</a>,
82version 2. The <code class="computeroutput">valgrind/*.h</code> headers
83that you may wish to include in your code (eg.
84<code class="filename">valgrind.h</code>, <code class="filename">memcheck.h</code>,
85<code class="filename">helgrind.h</code>, etc.) are
86distributed under a BSD-style license, so you may include them in your
87code without worrying about license conflicts. Some of the PThreads
88test cases, <code class="filename">pth_*.c</code>, are taken from "Pthreads
89Programming" by Bradford Nichols, Dick Buttlar &amp; Jacqueline Proulx
90Farrell, ISBN 1-56592-115-1, published by O'Reilly &amp; Associates,
91Inc.</p>
92<p>If you contribute code to Valgrind, please ensure your
93contributions are licensed as "GPLv2, or (at your option) any later
94version." This is so as to allow the possibility of easily upgrading
95the license to GPLv3 in future. If you want to modify code in the VEX
96subdirectory, please also see the file VEX/HACKING.README in the
97distribution.</p>
98</div>
99<div class="sect1">
100<div class="titlepage"><div><div><h2 class="title" style="clear: both">
101<a name="manual-intro.navigation"></a>1.2. How to navigate this manual</h2></div></div></div>
102<p>This manual's structure reflects the structure of Valgrind itself.
103First, we describe the Valgrind core, how to use it, and the options
104it supports. Then, each tool has its own chapter in this manual. You
105only need to read the documentation for the core and for the tool(s) you
106actually use, although you may find it helpful to be at least a little
107bit familiar with what all tools do. If you're new to all this, you probably
108want to run the Memcheck tool and you might find the <a class="xref" href="quick-start.html" title="The Valgrind Quick Start Guide">The Valgrind Quick Start Guide</a> useful.</p>
109<p>Be aware that the core understands some command line options, and
110the tools have their own options which they know about. This means
111there is no central place describing all the options that are
112accepted -- you have to read the options documentation both for
113<a class="xref" href="manual-core.html" title="2. Using and understanding the Valgrind core">Valgrind's core</a> and for the tool you want to use.</p>
114</div>
115</div>
116<div>
117<br><table class="nav" width="100%" cellspacing="3" cellpadding="2" border="0" summary="Navigation footer">
118<tr>
119<td rowspan="2" width="40%" align="left">
120<a accesskey="p" href="manual.html">&lt;&lt; Valgrind User Manual</a> </td>
121<td width="20%" align="center"><a accesskey="u" href="manual.html">Up</a></td>
122<td rowspan="2" width="40%" align="right"> <a accesskey="n" href="manual-core.html">2. Using and understanding the Valgrind core &gt;&gt;</a>
123</td>
124</tr>
125<tr><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td></tr>
126</table>
127</div>
128</body>
129</html>