Valgrind用户手册(一)

来源:互联网 发布:淘宝买家好评率95% 编辑:程序博客网 时间:2024/06/10 08:53

1、介绍

1.1 valgrind概述

Valgrind是一个构建动态分析工具的测试框架。它由许多工具组成,能够通过调试、分析或相似功能改进程序。Valgrind的体系结构是模块化的,所以新工具可以很容易被创建,而不会对已存在工具有任何干扰。

许多有用的工具已经作为标准工具提供。

1、Memcheck是内存检测工具,帮助你改进程序,特别是对使用C C++编写的程序更准确。

2、Cachegrind是缓存和分支预测的工具,帮助你改进程序实质运行更快

3、Callgrind是一个图形化的缓存探测工具,与Cachegrind功能有一些重叠,但是Callgrind能够收集一些信息是Cachegrind没有的

4、Helgrind是线程错误检测工具,帮助改进多线程程序更准确。

5、DRD也是一个线程错误检测工具,DRDHelgrind相似,但是使用不同的分析技术,所以可能会发现不同的问题。

6、Massif是堆探测工具,帮助改进程序使用更少内存。

7、DHAT是另一个堆检测工具,帮助了解代码段的生命周期,利用率,效率规划。

8、SGcheck是一个实验性的工具,能够检测栈和全局数组溢出错误。它的功能是对Memcheck的补充,SGcheck能够找到Memcheck无法找到的问题,反之亦然。

9. BBV is an experimental SimPoint basic block vector generator. It is useful to people doing computer architecture research and development.

There are also a couple of minor tools that arent useful to most users: Lackey is an example tool that illustrates some instrumentation basics; and Nulgrind is the minimal Valgrind tool that does no analysis or instrumentation, and is only useful for testing purposes.

Valgrind is closely tied to details of the CPU and operating system, and to a lesser extent, the compiler and basic C libraries. Nonetheless, it supports a number of widely-used platforms, listed in full at http://www.valgrind.org/.

Valgrind is built via the standard Unix ./configure, make, make install process; full details are given in the README le in the distribution.Valgrind is licensed under the The GNU General Public License, version 2. The valgrind/*.h headers that you may wish to include in your code (eg. valgrind.h, memcheck.h, helgrind.h, etc.) are distributed under a BSD-style license, so you may include them in your code without worrying about license conicts. Some of the PThreads test cases, pth_*.c, are taken from "Pthreads Programming" by Bradford Nichols, Dick Buttlar & Jacqueline Proulx Farrell, ISBN 1-56592-115-1, published by OReilly & Associates, Inc.

If you contribute code to Valgrind, please ensure your contributions are licensed as "GPLv2, or (at your option) any later version." This is so as to allow the possibility of easily upgrading the license to GPLv3 in future. If you want to modify code in the VEX subdirectory, please also see the le VEX/HACKING.README in the distribution.

1.2手册导航

这个手册反映了Valgrind 本身的结构,首先描述了Valgrind Core,如何使用和支持的选项。每个工具在手册中有自己的章节。虽然你会发现很多工具有一些相似作用,但是你只需阅读Valgrind Core和你所使用的工具。如果你第一次阅读,也许你只需运行Memcheck工具,查看Valgrind 快速开发指南将对你有帮助。

原创粉丝点击