简介Valgrind工具包功能

简介:
我就不班门弄斧了。不过呢,有可能有些同学可能不知道Valgrind有哪些功能,那么我就从Valgrind的官方网站处,摘几段文字吧。

Memcheck

Memcheck detects memory-management problems, and is aimed primarily at C and C++ programs. When a program is run under Memcheck's supervision, all reads and writes of memory are checked, and calls to malloc/new/free/delete are intercepted. As a result, Memcheck can detect if your program:

  • Accesses memory it shouldn't (areas not yet allocated, areas that have been freed, areas past the end of heap blocks, inaccessible areas of the stack).
  • Uses uninitialised values in dangerous ways.
  • Leaks memory.
  • Does bad frees of heap blocks (double frees, mismatched frees).
  • Passes overlapping source and destination memory blocks to memcpy() and related functions.

Memcheck reports these errors as soon as they occur, giving the source line number at which it occurred, and also a stack trace of the functions called to reach that line. Memcheck tracks addressability at the byte-level, and initialisation of values at the bit-level. As a result, it can detect the use of single uninitialised bits, and does not report spurious errors on bitfield operations. Memcheck runs programs about 10--30x slower than normal.

Cachegrind

Cachegrind is a cache profiler. It performs detailed simulation of the I1, D1 and L2 caches in your CPU and so can accurately pinpoint the sources of cache misses in your code. It identifies the number of cache misses, memory references and instructions executed for each line of source code, with per-function, per-module and whole-program summaries. It is useful with programs written in any language. Cachegrind runs programs about 20--100x slower than normal.

Callgrind Callgrind, by Josef Weidendorfer, is an extension to  Cachegrind . It provides all the information that Cachegrind does, plus extra information about callgraphs. It was folded into the main Valgrind distribution in version 3.2.0. Available separately is an amazing visualisation tool,  KCachegrind , which gives a much better overview of the data that Callgrind collects; it can also be used to visualise Cachegrind's output.

Massif

Massif is a heap profiler. It performs detailed heap profiling by taking regular snapshots of a program's heap. It produces a graph showing heap usage over time, including information about which parts of the program are responsible for the most memory allocations. The graph is supplemented by a text or HTML file that includes more information for determining where the most memory is being allocated. Massif runs programs about 20x slower than normal.

Helgrind

Helgrind is a thread debugger which finds data races in multithreaded programs. It looks for memory locations which are accessed by more than one (POSIX p-)thread, but for which no consistently used (pthread_mutex_) lock can be found. Such locations are indicative of missing synchronisation between threads, and could cause hard-to-find timing-dependent problems. It is useful for any program that uses pthreads. It is a somewhat experimental tool, so your feedback is especially welcome here.

DRD

DRD is a tool for detecting errors in multithreaded C and C++ programs. The tool works for any program that uses the POSIX threading primitives or that uses threading concepts built on top of the POSIX threading primitives. While Helgrind can detect locking order violations, for most programs DRD needs less memory to perform its analysis.


目录
相关文章
|
10月前
|
监控 Python
推荐一些Python的内存分析工具。
【2月更文挑战第7天】【2月更文挑战第19篇】推荐一些Python的内存分析工具。
1209 1
3个常用的Python性能分析工具及其使用方法
以下是几个常用的性能分析工具及其使用方法和常用命令:
|
8月前
|
Windows
使用LabVIEW报告生成工具包时报错97
使用LabVIEW报告生成工具包时报错97
95 0
|
10月前
|
缓存 Linux iOS开发
【C/C++ 集成内存调试、内存泄漏检测和性能分析的工具 Valgrind 】Linux 下 Valgrind 工具的全面使用指南
【C/C++ 集成内存调试、内存泄漏检测和性能分析的工具 Valgrind 】Linux 下 Valgrind 工具的全面使用指南
828 1
|
监控 Unix Linux
[linux性能优化]python第三方库-PSUtil库
PSUtil库是Python的一个第三方库,它可以访问各种系统信息和资源利用率,如CPU,内存,磁盘,网络接口,进程等。在Linux、Windows、Mac OS X、FreeBSD等操作系统中,PSUtil提供了一致的接口,这使得它成为了Python系统管理和监控的有力工具。
|
IDE 编译器 测试技术
【从零学习python 】02. 开发工具介绍
【从零学习python 】02. 开发工具介绍
86 1
|
人工智能 并行计算
LabVIEW图形化TensoRT工具包的安装下载分享
LabVIEW图形化TensoRT工具包的安装下载分享
222 0
An工具介绍之3D工具
An工具介绍之3D工具
606 0
|
开发框架 数据可视化 Java
Python Qt GUI设计简介、环境下载和安装(基础篇—1)
Python Qt GUI设计简介、环境下载和安装(基础篇—1)
Python Qt GUI设计简介、环境下载和安装(基础篇—1)
|
Web App开发 缓存 网络协议
HttpWatch工具简介及使用技巧(转载)
一 概述: HttpWatch强大的网页数据分析工具.集成在Internet Explorer工具栏.包括网页摘要.Cookies管理.缓存管理.消息头发送/接受.字符查询.POST 数据和目录管理功能.报告输出 HttpWatch 是一款能够收集并显示页页深层信息的软件。
1067 0